coeff.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _COEFF_H_
  13. #define _COEFF_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_COEFF_BASE (0x18200000)
  17. typedef volatile struct
  18. {
  19. uint32_t qfqt_start; // 0x00000000
  20. uint32_t qfqt_state; // 0x00000004
  21. uint32_t qf_conf; // 0x00000008
  22. uint32_t qt_conf; // 0x0000000c
  23. uint32_t sw_in; // 0x00000010
  24. uint32_t sw_out; // 0x00000014
  25. } HWP_COEFF_T;
  26. #define hwp_coeff ((HWP_COEFF_T *)REG_ACCESS_ADDRESS(REG_COEFF_BASE))
  27. // qfqt_start
  28. typedef union {
  29. uint32_t v;
  30. struct
  31. {
  32. uint32_t qfqt_en : 1; // [0]
  33. uint32_t cp_type : 1; // [1]
  34. uint32_t qfqt_inten : 1; // [2]
  35. uint32_t __3_3 : 1; // [3]
  36. uint32_t port_sel : 1; // [4]
  37. uint32_t fast_mod : 1; // [5]
  38. uint32_t cat_sel : 1; // [6]
  39. uint32_t buf_sel : 2; // [8:7]
  40. uint32_t ldtc_en : 1; // [9]
  41. uint32_t meas_en : 1; // [10]
  42. uint32_t __31_11 : 21; // [31:11]
  43. } b;
  44. } REG_COEFF_QFQT_START_T;
  45. // qfqt_state
  46. typedef union {
  47. uint32_t v;
  48. struct
  49. {
  50. uint32_t qfqt_intf : 1; // [0], write clear
  51. uint32_t err_state : 1; // [1], write clear
  52. uint32_t which_err : 2; // [3:2], write clear
  53. uint32_t __31_4 : 28; // [31:4]
  54. } b;
  55. } REG_COEFF_QFQT_STATE_T;
  56. // qf_conf
  57. typedef union {
  58. uint32_t v;
  59. struct
  60. {
  61. uint32_t cha_mod : 2; // [1:0]
  62. uint32_t __3_2 : 2; // [3:2]
  63. uint32_t coeff_qf_snr : 11; // [14:4]
  64. uint32_t sys_band_sel : 3; // [17:15]
  65. uint32_t __31_18 : 14; // [31:18]
  66. } b;
  67. } REG_COEFF_QF_CONF_T;
  68. // qt_conf
  69. typedef union {
  70. uint32_t v;
  71. struct
  72. {
  73. uint32_t ss_sel : 4; // [3:0]
  74. uint32_t coeff_qt_snr : 11; // [14:4]
  75. uint32_t tdd_fdd : 1; // [15]
  76. uint32_t doppler : 2; // [17:16]
  77. uint32_t __31_18 : 14; // [31:18]
  78. } b;
  79. } REG_COEFF_QT_CONF_T;
  80. // sw_in
  81. typedef union {
  82. uint32_t v;
  83. struct
  84. {
  85. uint32_t sw_in : 16; // [15:0]
  86. uint32_t __31_16 : 16; // [31:16]
  87. } b;
  88. } REG_COEFF_SW_IN_T;
  89. // sw_out
  90. typedef union {
  91. uint32_t v;
  92. struct
  93. {
  94. uint32_t sw_out : 16; // [15:0], read only
  95. uint32_t __31_16 : 16; // [31:16]
  96. } b;
  97. } REG_COEFF_SW_OUT_T;
  98. // qfqt_start
  99. #define COEFF_QFQT_EN (1 << 0)
  100. #define COEFF_CP_TYPE (1 << 1)
  101. #define COEFF_QFQT_INTEN (1 << 2)
  102. #define COEFF_PORT_SEL (1 << 4)
  103. #define COEFF_FAST_MOD (1 << 5)
  104. #define COEFF_CAT_SEL (1 << 6)
  105. #define COEFF_BUF_SEL(n) (((n)&0x3) << 7)
  106. #define COEFF_LDTC_EN (1 << 9)
  107. #define COEFF_MEAS_EN (1 << 10)
  108. // qfqt_state
  109. #define COEFF_QFQT_INTF (1 << 0)
  110. #define COEFF_ERR_STATE (1 << 1)
  111. #define COEFF_WHICH_ERR(n) (((n)&0x3) << 2)
  112. // qf_conf
  113. #define COEFF_CHA_MOD(n) (((n)&0x3) << 0)
  114. #define COEFF_COEFF_QF_SNR(n) (((n)&0x7ff) << 4)
  115. #define COEFF_SYS_BAND_SEL(n) (((n)&0x7) << 15)
  116. // qt_conf
  117. #define COEFF_SS_SEL(n) (((n)&0xf) << 0)
  118. #define COEFF_COEFF_QT_SNR(n) (((n)&0x7ff) << 4)
  119. #define COEFF_TDD_FDD (1 << 15)
  120. #define COEFF_DOPPLER(n) (((n)&0x3) << 16)
  121. // sw_in
  122. #define COEFF_SW_IN(n) (((n)&0xffff) << 0)
  123. // sw_out
  124. #define COEFF_SW_OUT(n) (((n)&0xffff) << 0)
  125. #endif // _COEFF_H_