cmt2300_defs.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. /*
  2. * THE FOLLOWING FIRMWARE IS PROVIDED: (1) "AS IS" WITH NO WARRANTY; AND
  3. * (2)TO ENABLE ACCESS TO CODING INFORMATION TO GUIDE AND FACILITATE CUSTOMER.
  4. * CONSEQUENTLY, CMOSTEK SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR
  5. * CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
  6. * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
  7. * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  8. *
  9. * Copyright (C) CMOSTEK SZ.
  10. */
  11. /*!
  12. * @file cmt2300_defs.h
  13. * @brief cmt2300 registers defines
  14. *
  15. * @version 1.1
  16. * @date Feb 08 2017
  17. * @author CMOSTEK R@D
  18. */
  19. #ifndef __CMT2300_DEFS_H
  20. #define __CMT2300_DEFS_H
  21. /* ---------- CMT bank defines ---------- */
  22. #define CMT2300_CMT_BANK_ADDR 0x00
  23. #define CMT2300_CMT_BANK_SIZE 12
  24. #define CMT2300_CUS_CMT1 0x00
  25. #define CMT2300_CUS_CMT2 0x01
  26. #define CMT2300_CUS_CMT3 0x02
  27. #define CMT2300_CUS_CMT4 0x03
  28. #define CMT2300_CUS_CMT5 0x04
  29. #define CMT2300_CUS_CMT6 0x05
  30. #define CMT2300_CUS_CMT7 0x06
  31. #define CMT2300_CUS_CMT8 0x07
  32. #define CMT2300_CUS_CMT9 0x08
  33. #define CMT2300_CUS_CMT10 0x09
  34. #define CMT2300_CUS_CMT11 0x0A
  35. #define CMT2300_CUS_RSSI 0x0B
  36. /* ---------- System bank defines ---------- */
  37. #define CMT2300_SYSTEM_BANK_ADDR 0x0C
  38. #define CMT2300_SYSTEM_BANK_SIZE 12
  39. #define CMT2300_CUS_SYS1 0x0C
  40. #define CMT2300_CUS_SYS2 0x0D
  41. #define CMT2300_CUS_SYS3 0x0E
  42. #define CMT2300_CUS_SYS4 0x0F
  43. #define CMT2300_CUS_SYS5 0x10
  44. #define CMT2300_CUS_SYS6 0x11
  45. #define CMT2300_CUS_SYS7 0x12
  46. #define CMT2300_CUS_SYS8 0x13
  47. #define CMT2300_CUS_SYS9 0x14
  48. #define CMT2300_CUS_SYS10 0x15
  49. #define CMT2300_CUS_SYS11 0x16
  50. #define CMT2300_CUS_SYS12 0x17
  51. /* ---------- Frequency bank defines ---------- */
  52. #define CMT2300_FREQUENCY_BANK_ADDR 0x18
  53. #define CMT2300_FREQUENCY_BANK_SIZE 8
  54. #define CMT2300_CUS_RF1 0x18
  55. #define CMT2300_CUS_RF2 0x19
  56. #define CMT2300_CUS_RF3 0x1A
  57. #define CMT2300_CUS_RF4 0x1B
  58. #define CMT2300_CUS_RF5 0x1C
  59. #define CMT2300_CUS_RF6 0x1D
  60. #define CMT2300_CUS_RF7 0x1E
  61. #define CMT2300_CUS_RF8 0x1F
  62. /* ---------- Data rate bank defines ---------- */
  63. #define CMT2300_DATA_RATE_BANK_ADDR 0x20
  64. #define CMT2300_DATA_RATE_BANK_SIZE 24
  65. #define CMT2300_CUS_RF9 0x20
  66. #define CMT2300_CUS_RF10 0x21
  67. #define CMT2300_CUS_RF11 0x22
  68. #define CMT2300_CUS_RF12 0x23
  69. #define CMT2300_CUS_FSK1 0x24
  70. #define CMT2300_CUS_FSK2 0x25
  71. #define CMT2300_CUS_FSK3 0x26
  72. #define CMT2300_CUS_FSK4 0x27
  73. #define CMT2300_CUS_FSK5 0x28
  74. #define CMT2300_CUS_FSK6 0x29
  75. #define CMT2300_CUS_FSK7 0x2A
  76. #define CMT2300_CUS_CDR1 0x2B
  77. #define CMT2300_CUS_CDR2 0x2C
  78. #define CMT2300_CUS_CDR3 0x2D
  79. #define CMT2300_CUS_CDR4 0x2E
  80. #define CMT2300_CUS_AGC1 0x2F
  81. #define CMT2300_CUS_AGC2 0x30
  82. #define CMT2300_CUS_AGC3 0x31
  83. #define CMT2300_CUS_AGC4 0x32
  84. #define CMT2300_CUS_OOK1 0x33
  85. #define CMT2300_CUS_OOK2 0x34
  86. #define CMT2300_CUS_OOK3 0x35
  87. #define CMT2300_CUS_OOK4 0x36
  88. #define CMT2300_CUS_OOK5 0x37
  89. typedef enum
  90. {
  91. BINDWIDTH_50,
  92. BINDWIDTH_100,
  93. BINDWIDTH_200,
  94. BINDWIDTH_500,
  95. }rfBandWidth_te;
  96. typedef union
  97. {
  98. uint8_t value;
  99. struct
  100. {
  101. uint8_t recv1 : 4;
  102. uint8_t bandWidth : 2;
  103. uint8_t recv2 : 2;
  104. }bits;
  105. }cmtCusRf11_tu;
  106. /* ---------- Baseband bank defines ---------- */
  107. #define CMT2300_BASEBAND_BANK_ADDR 0x38
  108. #define CMT2300_BASEBAND_BANK_SIZE 29
  109. #define CMT2300_CUS_PKT1 0x38
  110. #define CMT2300_CUS_PKT2 0x39
  111. #define CMT2300_CUS_PKT3 0x3A
  112. #define CMT2300_CUS_PKT4 0x3B
  113. #define CMT2300_CUS_PKT5 0x3C
  114. #define CMT2300_CUS_PKT6 0x3D
  115. #define CMT2300_CUS_PKT7 0x3E
  116. #define CMT2300_CUS_PKT8 0x3F
  117. #define CMT2300_CUS_PKT9 0x40
  118. #define CMT2300_CUS_PKT10 0x41
  119. #define CMT2300_CUS_PKT11 0x42
  120. #define CMT2300_CUS_PKT12 0x43
  121. #define CMT2300_CUS_PKT13 0x44
  122. #define CMT2300_CUS_PKT14 0x45
  123. #define CMT2300_CUS_PKT15 0x46
  124. #define CMT2300_CUS_PKT16 0x47
  125. #define CMT2300_CUS_PKT17 0x48
  126. #define CMT2300_CUS_PKT18 0x49
  127. #define CMT2300_CUS_PKT19 0x4A
  128. #define CMT2300_CUS_PKT20 0x4B
  129. #define CMT2300_CUS_PKT21 0x4C
  130. #define CMT2300_CUS_PKT22 0x4D
  131. #define CMT2300_CUS_PKT23 0x4E
  132. #define CMT2300_CUS_PKT24 0x4F
  133. #define CMT2300_CUS_PKT25 0x50
  134. #define CMT2300_CUS_PKT26 0x51
  135. #define CMT2300_CUS_PKT27 0x52
  136. #define CMT2300_CUS_PKT28 0x53
  137. #define CMT2300_CUS_PKT29 0x54
  138. /* ---------- Tx bank defines ---------- */
  139. #define CMT2300_TX_BANK_ADDR 0x55
  140. #define CMT2300_TX_BANK_SIZE 11
  141. #define CMT2300_CUS_TX1 0x55
  142. #define CMT2300_CUS_TX2 0x56
  143. #define CMT2300_CUS_TX3 0x57
  144. #define CMT2300_CUS_TX4 0x58
  145. #define CMT2300_CUS_TX5 0x59
  146. #define CMT2300_CUS_TX6 0x5A
  147. #define CMT2300_CUS_TX7 0x5B
  148. #define CMT2300_CUS_TX8 0x5C
  149. #define CMT2300_CUS_TX9 0x5D
  150. #define CMT2300_CUS_TX10 0x5E
  151. #define CMT2300_CUS_LBD 0x5F
  152. typedef enum
  153. {
  154. GSNBT_0_3,
  155. GSNBT_0_5,
  156. GSNBT_0_8,
  157. GSNBT_1_0,
  158. }gfskGsnBt_te;
  159. typedef union
  160. {
  161. uint8_t value;
  162. struct
  163. {
  164. uint8_t recv : 6;
  165. uint8_t gfskGsnBt : 2;
  166. }bits;
  167. }cmtCusTx1_tu;
  168. /* ---------- Control1 bank defines ---------- */
  169. #define CMT2300_CONTROL1_BANK_ADDR 0x60
  170. #define CMT2300_CONTROL1_BANK_SIZE 11
  171. #define CMT2300_CUS_MODE_CTL 0x60
  172. #define CMT2300_CUS_MODE_STA 0x61
  173. #define CMT2300_CUS_EN_CTL 0x62
  174. #define CMT2300_CUS_FREQ_CHNL 0x63
  175. #define CMT2300_CUS_FREQ_OFS 0x64
  176. #define CMT2300_CUS_IO_SEL 0x65
  177. #define CMT2300_CUS_INT1_CTL 0x66
  178. #define CMT2300_CUS_INT2_CTL 0x67
  179. #define CMT2300_CUS_INT_EN 0x68
  180. #define CMT2300_CUS_FIFO_CTL 0x69
  181. #define CMT2300_CUS_INT_CLR1 0x6A
  182. /* ---------- Control2 bank defines ---------- */
  183. #define CMT2300_CONTROL2_BANK_ADDR 0x6B
  184. #define CMT2300_CONTROL2_BANK_SIZE 7
  185. #define CMT2300_CUS_INT_CLR2 0x6B
  186. #define CMT2300_CUS_FIFO_CLR 0x6C
  187. #define CMT2300_CUS_INT_FLAG 0x6D
  188. #define CMT2300_CUS_FIFO_FLAG 0x6E
  189. #define CMT2300_CUS_RSSI_CODE 0x6F
  190. #define CMT2300_CUS_RSSI_DBM 0x70
  191. #define CMT2300_CUS_LBD_RESULT 0x71
  192. /* ********** CMT2300_CUS_CMT2 registers ********** */
  193. #define CMT2300_MASK_PRODUCT_ID 0xFF
  194. /* ********** CMT2300_CUS_CMT5 registers ********** */
  195. #define CMT2300_MASK_LMT_CODE 0xC0
  196. /* ********** CMT2300_CUS_CMT9 registers ********** */
  197. #define CMT2300_MASK_RSSI_OFFSET_SIGN 0x80
  198. #define CMT2300_MASK_DIG_CLKDIV 0x1F
  199. /* ********** CMT2300_CUS_RSSI registers ********** */
  200. #define CMT2300_MASK_RSSI_OFFSET 0xF8
  201. #define CMT2300_MASK_RSSI_SLOPE 0x07
  202. /* ********** CMT2300_CUS_SYS1 registers ********** */
  203. #define CMT2300_MASK_LMT_VTR 0xC0
  204. #define CMT2300_MASK_MIXER_BIAS 0x30
  205. #define CMT2300_MASK_LNA_MODE 0x0C
  206. #define CMT2300_MASK_LNA_BIAS 0x03
  207. /* ********** CMT2300_CUS_SYS2 registers ********** */
  208. #define CMT2300_MASK_LFOSC_RECAL_EN 0x80
  209. #define CMT2300_MASK_LFOSC_CAL1_EN 0x40
  210. #define CMT2300_MASK_LFOSC_CAL2_EN 0x20
  211. #define CMT2300_MASK_RX_TIMER_EN 0x10
  212. #define CMT2300_MASK_SLEEP_TIMER_EN 0x08
  213. #define CMT2300_MASK_TX_DC_EN 0x04
  214. #define CMT2300_MASK_RX_DC_EN 0x02
  215. #define CMT2300_MASK_DC_PAUSE 0x01
  216. /* ********** CMT2300_CUS_SYS3 registers ********** */
  217. #define CMT2300_MASK_SLEEP_BYPASS_EN 0x80
  218. #define CMT2300_MASK_XTAL_STB_TIME 0x70
  219. #define CMT2300_MASK_TX_EXIT_STATE 0x0C
  220. #define CMT2300_MASK_RX_EXIT_STATE 0x03
  221. /* ********** CMT2300_CUS_SYS4 registers ********** */
  222. #define CMT2300_MASK_SLEEP_TIMER_M_7_0 0xFF
  223. /* ********** CMT2300_CUS_SYS5 registers ********** */
  224. #define CMT2300_MASK_SLEEP_TIMER_M_10_8 0x70
  225. #define CMT2300_MASK_SLEEP_TIMER_R 0x0F
  226. /* ********** CMT2300_CUS_SYS6 registers ********** */
  227. #define CMT2300_MASK_RX_TIMER_T1_M_7_0 0xFF
  228. /* ********** CMT2300_CUS_SYS7 registers ********** */
  229. #define CMT2300_MASK_RX_TIMER_T1_M_10_8 0x70
  230. #define CMT2300_MASK_RX_TIMER_T1_R 0x0F
  231. /* ********** CMT2300_CUS_SYS8 registers ********** */
  232. #define CMT2300_MASK_RX_TIMER_T2_M_7_0 0xFF
  233. /* ********** CMT2300_CUS_SYS9 registers ********** */
  234. #define CMT2300_MASK_RX_TIMER_T2_M_10_8 0x70
  235. #define CMT2300_MASK_RX_TIMER_T2_R 0x0F
  236. /* ********** CMT2300_CUS_SYS10 registers ********** */
  237. #define CMT2300_MASK_COL_DET_EN 0x80
  238. #define CMT2300_MASK_COL_OFS_SEL 0x40
  239. #define CMT2300_MASK_RX_AUTO_EXIT_DIS 0x20
  240. #define CMT2300_MASK_DOUT_MUTE 0x10
  241. #define CMT2300_MASK_RX_EXTEND_MODE 0x0F
  242. /* ********** CMT2300_CUS_SYS11 registers ********** */
  243. #define CMT2300_MASK_PJD_TH_SEL 0x80
  244. #define CMT2300_MASK_CCA_INT_SEL 0x60
  245. #define CMT2300_MASK_RSSI_DET_SEL 0x18
  246. #define CMT2300_MASK_RSSI_AVG_MODE 0x07
  247. typedef enum
  248. {
  249. RDS_ALWAYS,
  250. RDS_AT_PREM_OK,
  251. RDS_AT_SYNC_OK,
  252. RDS_AT_PKT_OK,
  253. }rssiDetSel_te;
  254. typedef union
  255. {
  256. uint8_t value;
  257. struct
  258. {
  259. uint8_t rssi_avg_mode : 3;
  260. uint8_t rssi_det_sel : 2;
  261. uint8_t rssi_vld_src : 2;
  262. uint8_t pjd_th_sel : 1;
  263. }bits;
  264. }cmtCusSys11_tu;
  265. /* ********** CMT2300_CUS_SYS12 registers ********** */
  266. #define CMT2300_MASK_PJD_WIN_SEL 0xC0
  267. #define CMT2300_MASK_CLKOUT_EN 0x20
  268. #define CMT2300_MASK_CLKOUT_DIV 0x1F
  269. /* ********** CMT2300_CUS_RF1 registers ********** */
  270. #define CMT2300_MASK_FREQ_RX_N 0xFF
  271. /* ********** CMT2300_CUS_RF2 registers ********** */
  272. #define CMT2300_MASK_FREQ_RX_K_7_0 0xFF
  273. /* ********** CMT2300_CUS_RF3 registers ********** */
  274. #define CMT2300_MASK_FREQ_RX_K_15_8 0xFF
  275. /* ********** CMT2300_CUS_RF4 registers ********** */
  276. #define CMT2300_MASK_FREQ_PALDO_SEL 0x80
  277. #define CMT2300_MASK_FREQ_DIVX_CODE 0x70
  278. #define CMT2300_MASK_FREQ_RX_K_19_16 0x0F
  279. /* ********** CMT2300_CUS_RF5 registers ********** */
  280. #define CMT2300_MASK_FREQ_TX_N 0xFF
  281. /* ********** CMT2300_CUS_RF6 registers ********** */
  282. #define CMT2300_MASK_FREQ_TX_K_7_0 0xFF
  283. /* ********** CMT2300_CUS_RF7 registers ********** */
  284. #define CMT2300_MASK_FREQ_TX_K_15_8 0xFF
  285. /* ********** CMT2300_CUS_RF8 registers ********** */
  286. #define CMT2300_MASK_FSK_SWT 0x80
  287. #define CMT2300_MASK_FREQ_VCO_BANK 0x70
  288. #define CMT2300_MASK_FREQ_TX_K_19_16 0x0F
  289. /* ********** CMT2300_CUS_PKT1 registers ********** */
  290. #define CMT2300_MASK_RX_PREAM_SIZE 0xF8
  291. #define CMT2300_MASK_PREAM_LENG_UNIT 0x04
  292. #define CMT2300_MASK_DATA_MODE 0x03
  293. /* CMT2300_MASK_PREAM_LENG_UNIT options */
  294. #define CMT2300_PREAM_LENG_UNIT_8_BITS 0x00
  295. #define CMT2300_PREAM_LENG_UNIT_4_BITS 0x04
  296. /* CMT2300_MASK_DATA_MODE options */
  297. #define CMT2300_DATA_MODE_DIRECT 0x00
  298. #define CMT2300_DATA_MODE_PACKET 0x02
  299. typedef enum
  300. {
  301. DM_DIRECT,
  302. DM_PACKET,
  303. }dataMode_te;
  304. typedef enum
  305. {
  306. PLU_8BIT,
  307. PLU_4BIT,
  308. }preamLengUnit_te;
  309. typedef union
  310. {
  311. uint8_t value;
  312. struct
  313. {
  314. uint8_t data_mode : 2;
  315. uint8_t pream_leng_unit : 1;
  316. uint8_t rx_pream_size : 5;
  317. }bits;
  318. }cmtCusPkt1_tu;
  319. /* ********** CMT2300_CUS_PKT2 registers ********** */
  320. #define CMT2300_MASK_TX_PREAM_SIZE_7_0 0xFF
  321. /* ********** CMT2300_CUS_PKT3 registers ********** */
  322. #define CMT2300_MASK_TX_PREAM_SIZE_15_8 0xFF
  323. /* ********** CMT2300_CUS_PKT4 registers ********** */
  324. #define CMT2300_MASK_PREAM_VALUE 0xFF
  325. /* ********** CMT2300_CUS_PKT5 registers ********** */
  326. #define CMT2300_MASK_SYNC_TOL 0x70
  327. #define CMT2300_MASK_SYNC_SIZE 0x0E
  328. #define CMT2300_MASK_SYNC_MAN_EN 0x01
  329. typedef union
  330. {
  331. uint8_t value;
  332. struct
  333. {
  334. uint8_t sync_man_en : 1;
  335. uint8_t sync_size : 3;
  336. uint8_t sync_tol : 3;
  337. uint8_t resv : 1;
  338. }bits;
  339. }cmtCusPkt5_tu;
  340. /* ********** CMT2300_CUS_PKT6 registers ********** */
  341. #define CMT2300_MASK_SYNC_VALUE_7_0 0xFF
  342. /* ********** CMT2300_CUS_PKT7 registers ********** */
  343. #define CMT2300_MASK_SYNC_VALUE_15_8 0xFF
  344. /* ********** CMT2300_CUS_PKT8 registers ********** */
  345. #define CMT2300_MASK_SYNC_VALUE_23_16 0xFF
  346. /* ********** CMT2300_CUS_PKT9 registers ********** */
  347. #define CMT2300_MASK_SYNC_VALUE_31_24 0xFF
  348. /* ********** CMT2300_CUS_PKT10 registers ********** */
  349. #define CMT2300_MASK_SYNC_VALUE_39_32 0xFF
  350. /* ********** CMT2300_CUS_PKT11 registers ********** */
  351. #define CMT2300_MASK_SYNC_VALUE_47_40 0xFF
  352. /* ********** CMT2300_CUS_PKT12 registers ********** */
  353. #define CMT2300_MASK_SYNC_VALUE_55_48 0xFF
  354. /* ********** CMT2300_CUS_PKT13 registers ********** */
  355. #define CMT2300_MASK_SYNC_VALUE_63_56 0xFF
  356. /* ********** CMT2300_CUS_PKT14 registers ********** */
  357. #define CMT2300_MASK_PAYLOAD_LENG_10_8 0x70
  358. #define CMT2300_MASK_AUTO_ACK_EN 0x08
  359. #define CMT2300_MASK_NODE_LENG_POS_SEL 0x04
  360. #define CMT2300_MASK_PAYLOAD_BIT_ORDER 0x02
  361. #define CMT2300_MASK_PKT_TYPE 0x01
  362. /* CMT2300_MASK_NODE_LENG_POS_SEL options */
  363. #define CMT2300_NODE_LENG_FIRST_NODE 0x00
  364. #define CMT2300_NODE_LENG_FIRST_LENGTH 0x04
  365. /* CMT2300_MASK_PAYLOAD_BIT_ORDER options */
  366. #define CMT2300_PAYLOAD_BIT_ORDER_MSB 0x00
  367. #define CMT2300_PAYLOAD_BIT_ORDER_LSB 0x02
  368. /* CMT2300_MASK_PKT_TYPE options */
  369. #define CMT2300_PKT_TYPE_FIXED 0x00
  370. #define CMT2300_PKT_TYPE_VARIABLE 0x01
  371. typedef union
  372. {
  373. uint8_t value;
  374. struct
  375. {
  376. uint8_t pkt_type : 1;
  377. uint8_t payload_bit_order : 1;
  378. uint8_t node_leng_pos : 1;
  379. uint8_t auto_ack : 1;
  380. uint8_t payload_leng : 3;
  381. uint8_t resv : 1;
  382. }bits;
  383. }cmtCusPkt14_tu;
  384. /* ********** CMT2300_CUS_PKT15 registers ********** */
  385. #define CMT2300_MASK_PAYLOAD_LENG_7_0 0xFF
  386. /* ********** CMT2300_CUS_PKT16 registers ********** */
  387. #define CMT2300_MASK_NODE_FREE_EN 0x20
  388. #define CMT2300_MASK_NODE_ERR_MASK 0x10
  389. #define CMT2300_MASK_NODE_SIZE 0x0C
  390. #define CMT2300_MASK_NODE_DET_MODE 0x03
  391. /* CMT2300_MASK_NODE_DET_MODE options */
  392. #define CMT2300_NODE_DET_NODE 0x00
  393. #define CMT2300_NODE_DET_VALUE 0x01
  394. #define CMT2300_NODE_DET_VALUE_0 0x02
  395. #define CMT2300_NODE_DET_VALUE_0_1 0x03
  396. /* ********** CMT2300_CUS_PKT17 registers ********** */
  397. #define CMT2300_MASK_NODE_VALUE_7_0 0xFF
  398. /* ********** CMT2300_CUS_PKT18 registers ********** */
  399. #define CMT2300_MASK_NODE_VALUE_15_8 0xFF
  400. /* ********** CMT2300_CUS_PKT19 registers ********** */
  401. #define CMT2300_MASK_NODE_VALUE_23_16 0xFF
  402. /* ********** CMT2300_CUS_PKT20 registers ********** */
  403. #define CMT2300_MASK_NODE_VALUE_31_24 0xFF
  404. /* ********** CMT2300_CUS_PKT21 registers ********** */
  405. #define CMT2300_MASK_FEC_TYPE 0x80
  406. #define CMT2300_MASK_FEC_EN 0x40
  407. #define CMT2300_MASK_CRC_BYTE_SWAP 0x20
  408. #define CMT2300_MASK_CRC_BIT_INV 0x10
  409. #define CMT2300_MASK_CRC_RANGE 0x08
  410. #define CMT2300_MASK_CRC_TYPE 0x06
  411. #define CMT2300_MASK_CRC_EN 0x01
  412. /* CMT2300_MASK_CRC_BYTE_SWAP options */
  413. #define CMT2300_CRC_ORDER_HBYTE 0x00
  414. #define CMT2300_CRC_ORDER_LBYTE 0x20
  415. /* CMT2300_MASK_CRC_RANGE options */
  416. #define CMT2300_CRC_RANGE_PAYLOAD 0x00
  417. #define CMT2300_CRC_RANGE_DATA 0x08
  418. /* CMT2300_MASK_CRC_TYPE options */
  419. #define CMT2300_CRC_TYPE_CCITT16 0x00
  420. #define CMT2300_CRC_TYPE_IBM16 0x02
  421. #define CMT2300_CRC_TYPE_ITU16 0x04
  422. typedef union
  423. {
  424. uint8_t value;
  425. struct
  426. {
  427. uint8_t crc_en : 1;
  428. uint8_t crc_type : 2;
  429. uint8_t crc_range : 1;
  430. uint8_t crc_bit_inv : 1;
  431. uint8_t crc_byte_swap : 1;
  432. uint8_t fec_en : 1;
  433. uint8_t fec_type : 1;
  434. }bits;
  435. }cus_pkt21_tu;
  436. /* ********** CMT2300_CUS_PKT22 registers ********** */
  437. #define CMT2300_MASK_CRC_SEED_7_0 0xFF
  438. /* ********** CMT2300_CUS_PKT23 registers ********** */
  439. #define CMT2300_MASK_CRC_SEED_15_8 0xFF
  440. /* ********** CMT2300_CUS_PKT24 registers ********** */
  441. #define CMT2300_MASK_CRC_BIT_ORDER 0x80
  442. #define CMT2300_MASK_WHITEN_SEED_8_8 0x40
  443. #define CMT2300_MASK_WHITEN_SEED_TYPE 0x20
  444. #define CMT2300_MASK_WHITEN_TYPE 0x18
  445. #define CMT2300_MASK_WHITEN_EN 0x04
  446. #define CMT2300_MASK_MANCH_TYPE 0x02
  447. #define CMT2300_MASK_MANCH_EN 0x01
  448. /* CMT2300_MASK_CRC_BIT_ORDER options */
  449. #define CMT2300_CRC_BIT_ORDER_MSB 0x00
  450. #define CMT2300_CRC_BIT_ORDER_LSB 0x80
  451. /* CMT2300_MASK_WHITEN_SEED_TYPE options */
  452. #define CMT2300_WHITEN_SEED_TYPE_1 0x00
  453. #define CMT2300_WHITEN_SEED_TYPE_2 0x20
  454. /* CMT2300_MASK_WHITEN_TYPE options */
  455. #define CMT2300_WHITEN_TYPE_PN9_CCITT 0x00
  456. #define CMT2300_WHITEN_TYPE_PN9_IBM 0x08
  457. #define CMT2300_WHITEN_TYPE_PN7 0x10
  458. /* CMT2300_MASK_MANCH_TYPE options */
  459. #define CMT2300_MANCH_TYPE_ONE_01 0x00
  460. #define CMT2300_MANCH_TYPE_ONE_10 0x02
  461. /* ********** CMT2300_CUS_PKT25 registers ********** */
  462. #define CMT2300_MASK_WHITEN_SEED_7_0 0xFF
  463. /* ********** CMT2300_CUS_PKT26 registers ********** */
  464. #define CMT2300_MASK_TX_PREFIX_TYPE 0x03
  465. /* ********** CMT2300_CUS_PKT27 registers ********** */
  466. #define CMT2300_MASK_TX_PKT_NUM 0xFF
  467. /* ********** CMT2300_CUS_PKT28 registers ********** */
  468. #define CMT2300_MASK_TX_PKT_GAP 0xFF
  469. /* ********** CMT2300_CUS_PKT29 registers ********** */
  470. #define CMT2300_MASK_FIFO_AUTO_RES_EN 0x80
  471. #define CMT2300_MASK_FIFO_TH 0x7F
  472. /* ********** CMT2300_CUS_MODE_CTL registers ********** */
  473. #define CMT2300_MASK_CHIP_MODE_SWT 0xFF
  474. /* CMT2300_MASK_CHIP_MODE_SWT options */
  475. #define CMT2300_GO_EEPROM 0x01
  476. #define CMT2300_GO_STBY 0x02
  477. #define CMT2300_GO_RFS 0x04
  478. #define CMT2300_GO_RX 0x08
  479. #define CMT2300_GO_SLEEP 0x10
  480. #define CMT2300_GO_TFS 0x20
  481. #define CMT2300_GO_TX 0x40
  482. #define CMT2300_GO_SWITCH 0x80
  483. /* ********** CMT2300_CUS_MODE_STA registers ********** */
  484. #define CMT2300_MASK_RSTN_IN_EN 0x20
  485. #define CMT2300_MASK_CFG_RETAIN 0x10
  486. #define CMT2300_MASK_CHIP_MODE_STA 0x0F
  487. /* CMT2300_MASK_CHIP_MODE_STA options */
  488. #define CMT2300_STA_IDLE 0x00
  489. #define CMT2300_STA_SLEEP 0x01
  490. #define CMT2300_STA_STBY 0x02
  491. #define CMT2300_STA_RFS 0x03
  492. #define CMT2300_STA_TFS 0x04
  493. #define CMT2300_STA_RX 0x05
  494. #define CMT2300_STA_TX 0x06
  495. #define CMT2300_STA_EEPROM 0x07
  496. #define CMT2300_STA_UNLOCKED 0x08
  497. #define CMT2300_STA_LOW_VDD 0x08
  498. #define CMT2300_STA_CAL 0x09
  499. /* ********** CMT2300_CUS_EN_CTL registers ********** */
  500. #define CMT2300_MASK_UNLOCK_STOP_EN 0x20
  501. #define CMT2300_MASK_LBD_STOP_EN 0x10
  502. /* ********** CMT2300_CUS_FREQ_CHNL registers ********** */
  503. #define CMT2300_MASK_FH_CHANNEL 0xFF
  504. /* ********** CMT2300_CUS_FREQ_OFS registers ********** */
  505. #define CMT2300_MASK_FH_OFFSET 0xFF
  506. /* ********** CMT2300_CUS_IO_SEL registers ********** */
  507. #define CMT2300_MASK_GPIO4_SEL 0xC0
  508. #define CMT2300_MASK_GPIO3_SEL 0x30
  509. #define CMT2300_MASK_GPIO2_SEL 0x0C
  510. #define CMT2300_MASK_GPIO1_SEL 0x03
  511. /* CMT2300_MASK_GPIO4_SEL options */
  512. #define CMT2300_GPIO4_SEL_RSTIN 0x00
  513. #define CMT2300_GPIO4_SEL_INT1 0x40
  514. #define CMT2300_GPIO4_SEL_DOUT 0x80
  515. #define CMT2300_GPIO4_SEL_DCLK 0xC0
  516. /* CMT2300_MASK_GPIO3_SEL options */
  517. #define CMT2300_GPIO3_SEL_CLKO 0x00
  518. #define CMT2300_GPIO3_SEL_DOUT 0x10
  519. #define CMT2300_GPIO3_SEL_DIN 0x10
  520. #define CMT2300_GPIO3_SEL_INT2 0x20
  521. #define CMT2300_GPIO3_SEL_DCLK 0x30
  522. /* CMT2300_MASK_GPIO2_SEL options */
  523. #define CMT2300_GPIO2_SEL_INT1 0x00
  524. #define CMT2300_GPIO2_SEL_INT2 0x04
  525. #define CMT2300_GPIO2_SEL_DOUT 0x08
  526. #define CMT2300_GPIO2_SEL_DIN 0x08
  527. #define CMT2300_GPIO2_SEL_DCLK 0x0C
  528. /* CMT2300_MASK_GPIO1_SEL options */
  529. #define CMT2300_GPIO1_SEL_DOUT 0x00
  530. #define CMT2300_GPIO1_SEL_DIN 0x00
  531. #define CMT2300_GPIO1_SEL_INT1 0x01
  532. #define CMT2300_GPIO1_SEL_INT2 0x02
  533. #define CMT2300_GPIO1_SEL_DCLK 0x03
  534. /* ********** CMT2300_CUS_INT1_CTL registers ********** */
  535. #define CMT2300_MASK_RF_SWT1_EN 0x80
  536. #define CMT2300_MASK_RF_SWT2_EN 0x40
  537. #define CMT2300_MASK_INT_POLAR 0x20
  538. #define CMT2300_MASK_INT1_SEL 0x1F
  539. /* CMT2300_MASK_INT_POLAR options */
  540. #define CMT2300_INT_POLAR_SEL_0 0x00
  541. #define CMT2300_INT_POLAR_SEL_1 0x20
  542. /* CMT2300_MASK_INT1_SEL options */
  543. #define CMT2300_INT_SEL_RX_ACTIVE 0x00
  544. #define CMT2300_INT_SEL_TX_ACTIVE 0x01
  545. #define CMT2300_INT_SEL_RSSI_VLD 0x02
  546. #define CMT2300_INT_SEL_PREAM_OK 0x03
  547. #define CMT2300_INT_SEL_SYNC_OK 0x04
  548. #define CMT2300_INT_SEL_NODE_OK 0x05
  549. #define CMT2300_INT_SEL_CRC_OK 0x06
  550. #define CMT2300_INT_SEL_PKT_OK 0x07
  551. #define CMT2300_INT_SEL_SL_TMO 0x08
  552. #define CMT2300_INT_SEL_RX_TMO 0x09
  553. #define CMT2300_INT_SEL_TX_DONE 0x0A
  554. #define CMT2300_INT_SEL_RX_FIFO_NMTY 0x0B
  555. #define CMT2300_INT_SEL_RX_FIFO_TH 0x0C
  556. #define CMT2300_INT_SEL_RX_FIFO_FULL 0x0D
  557. #define CMT2300_INT_SEL_RX_FIFO_WBYTE 0x0E
  558. #define CMT2300_INT_SEL_RX_FIFO_OVF 0x0F
  559. #define CMT2300_INT_SEL_TX_FIFO_NMTY 0x10
  560. #define CMT2300_INT_SEL_TX_FIFO_TH 0x11
  561. #define CMT2300_INT_SEL_TX_FIFO_FULL 0x12
  562. #define CMT2300_INT_SEL_STATE_IS_STBY 0x13
  563. #define CMT2300_INT_SEL_STATE_IS_FS 0x14
  564. #define CMT2300_INT_SEL_STATE_IS_RX 0x15
  565. #define CMT2300_INT_SEL_STATE_IS_TX 0x16
  566. #define CMT2300_INT_SEL_LED 0x17
  567. #define CMT2300_INT_SEL_TRX_ACTIVE 0x18
  568. #define CMT2300_INT_SEL_PKT_DONE 0x19
  569. /* ********** CMT2300_CUS_INT2_CTL registers ********** */
  570. #define CMT2300_MASK_LFOSC_OUT_EN 0x40
  571. #define CMT2300_MASK_TX_DIN_INV 0x20
  572. #define CMT2300_MASK_INT2_SEL 0x1F
  573. /* ********** CMT2300_CUS_INT_EN registers ********** */
  574. #define CMT2300_MASK_SL_TMO_EN 0x80
  575. #define CMT2300_MASK_RX_TMO_EN 0x40
  576. #define CMT2300_MASK_TX_DONE_EN 0x20
  577. #define CMT2300_MASK_PREAM_OK_EN 0x10
  578. #define CMT2300_MASK_SYNC_OK_EN 0x08
  579. #define CMT2300_MASK_NODE_OK_EN 0x04
  580. #define CMT2300_MASK_CRC_OK_EN 0x02
  581. #define CMT2300_MASK_PKT_DONE_EN 0x01
  582. typedef union
  583. {
  584. uint8_t value;
  585. struct
  586. {
  587. uint8_t pkt_done : 1;
  588. uint8_t crc_ok : 1;
  589. uint8_t node_ok : 1;
  590. uint8_t sync_ok : 1;
  591. uint8_t prem_ok : 1;
  592. uint8_t tx_done : 1;
  593. uint8_t rx_tmo : 1;
  594. uint8_t sl_tmo : 1;
  595. }bits;
  596. }cmtInt_tu;
  597. /* ********** CMT2300_CUS_FIFO_CTL registers ********** */
  598. #define CMT2300_MASK_TX_DIN_EN 0x80
  599. #define CMT2300_MASK_TX_DIN_SEL 0x60
  600. #define CMT2300_MASK_FIFO_AUTO_CLR_DIS 0x10
  601. #define CMT2300_MASK_FIFO_TX_RD_EN 0x08
  602. #define CMT2300_MASK_FIFO_RX_TX_SEL 0x04
  603. #define CMT2300_MASK_FIFO_MERGE_EN 0x02
  604. #define CMT2300_MASK_SPI_FIFO_RD_WR_SEL 0x01
  605. /* CMT2300_MASK_TX_DIN_SEL options */
  606. #define CMT2300_TX_DIN_SEL_GPIO1 0x00
  607. #define CMT2300_TX_DIN_SEL_GPIO2 0x20
  608. #define CMT2300_TX_DIN_SEL_GPIO3 0x40
  609. /* ********** CMT2300_CUS_INT_CLR1 registers ********** */
  610. #define CMT2300_MASK_SL_TMO_FLG 0x20
  611. #define CMT2300_MASK_RX_TMO_FLG 0x10
  612. #define CMT2300_MASK_TX_DONE_FLG 0x08
  613. #define CMT2300_MASK_TX_DONE_CLR 0x04
  614. #define CMT2300_MASK_SL_TMO_CLR 0x02
  615. #define CMT2300_MASK_RX_TMO_CLR 0x01
  616. /* ********** CMT2300_CUS_INT_CLR2 registers ********** */
  617. #define CMT2300_MASK_LBD_CLR 0x20
  618. #define CMT2300_MASK_PREAM_OK_CLR 0x10
  619. #define CMT2300_MASK_SYNC_OK_CLR 0x08
  620. #define CMT2300_MASK_NODE_OK_CLR 0x04
  621. #define CMT2300_MASK_CRC_OK_CLR 0x02
  622. #define CMT2300_MASK_PKT_DONE_CLR 0x01
  623. /* ********** CMT2300_CUS_FIFO_CLR registers ********** */
  624. #define CMT2300_MASK_FIFO_RESTORE 0x04
  625. #define CMT2300_MASK_FIFO_CLR_RX 0x02
  626. #define CMT2300_MASK_FIFO_CLR_TX 0x01
  627. /* ********** CMT2300_CUS_INT_FLAG registers ********** */
  628. #define CMT2300_MASK_LBD_FLG 0x80
  629. #define CMT2300_MASK_COL_ERR_FLG 0x40
  630. #define CMT2300_MASK_PKT_ERR_FLG 0x20
  631. #define CMT2300_MASK_PREAM_OK_FLG 0x10
  632. #define CMT2300_MASK_SYNC_OK_FLG 0x08
  633. #define CMT2300_MASK_NODE_OK_FLG 0x04
  634. #define CMT2300_MASK_CRC_OK_FLG 0x02
  635. #define CMT2300_MASK_PKT_OK_FLG 0x01
  636. /* ********** CMT2300_CUS_FIFO_FLAG registers ********** */
  637. #define CMT2300_MASK_RX_FIFO_FULL_FLG 0x40
  638. #define CMT2300_MASK_RX_FIFO_NMTY_FLG 0x20
  639. #define CMT2300_MASK_RX_FIFO_TH_FLG 0x10
  640. #define CMT2300_MASK_RX_FIFO_OVF_FLG 0x08
  641. #define CMT2300_MASK_TX_FIFO_FULL_FLG 0x04
  642. #define CMT2300_MASK_TX_FIFO_NMTY_FLG 0x02
  643. #define CMT2300_MASK_TX_FIFO_TH_FLG 0x01
  644. /* ********** CMT2300_CUS_RSSI_CODE registers ********** */
  645. #define CMT2300_MASK_RSSI_CODE 0xFF
  646. /* ********** CMT2300_CUS_RSSI_DBM registers ********** */
  647. #define CMT2300_MASK_RSSI_DBM 0xFF
  648. /* ********** CMT2300_CUS_LBD_RESULT registers ********** */
  649. #define CMT2300_MASK_LBD_RESULT 0xFF
  650. #endif