A5133reg.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. /********************************************************************
  2. * A5133REG.h
  3. * RF Chip-A5133 Hardware Definitions
  4. *
  5. * This file provides the constants associated with the
  6. * AMICCOM A5133 device.
  7. *
  8. ********************************************************************/
  9. #ifndef _A5133REG_h_
  10. #define _A5133REG_h_
  11. #include <stdint.h>
  12. #define MODE_REG 0x00
  13. #define MODECTRL_REG 0x01
  14. #define CALIBRATION_REG 0x02
  15. #define FIFO1_REG 0x03
  16. #define FIFO2_REG 0x04
  17. #define FIFO_REG 0x05
  18. #define IDCODE_REG 0x06
  19. #define RCOSC1_REG 0x07
  20. #define RCOSC2_REG 0x08
  21. #define RCOSC3_REG 0x09
  22. #define CKO_REG 0x0A
  23. #define GIO1_REG 0x0B
  24. #define GIO2_REG 0x0C
  25. #define DATARATE_REG 0x0D
  26. #define PLL1_REG 0x0E
  27. #define PLL2_REG 0x0F
  28. #define PLL3_REG 0x10
  29. #define PLL4_REG 0x11
  30. #define PLL5_REG 0x12
  31. #define CHGROUP1_REG 0x13
  32. #define CHGROUP2_REG 0x14
  33. #define TX1_REG 0x15
  34. #define TX2_REG 0x16
  35. #define DELAY1_REG 0x17
  36. #define DELAY2_REG 0x18
  37. #define RX_REG 0x19
  38. #define RXGAIN1_REG 0x1A
  39. #define RXGAIN2_REG 0x1B
  40. #define RXGAIN3_REG 0x1C
  41. #define RXGAIN4_REG 0x1D
  42. #define RSSI_REG 0x1E
  43. #define ADC_REG 0x1F
  44. #define CODE1_REG 0x20
  45. #define CODE2_REG 0x21
  46. #define CODE3_REG 0x22
  47. #define IFCAL1_REG 0x23
  48. #define IFCAL2_REG 0x24
  49. #define VCOCCAL_REG 0x25
  50. #define VCOCAL1_REG 0x26
  51. #define VCOCAL2_REG 0x27
  52. #define VCODEVCAL1_REG 0x28
  53. #define VCODEVCAL2_REG 0x29
  54. #define DASP_REG 0x2A
  55. #define VCOMODDELAY_REG 0x2B
  56. #define BATTERY_REG 0x2C
  57. #define TXTEST_REG 0x2D
  58. #define RXDEM1_REG 0x2E
  59. #define RXDEM2_REG 0x2F
  60. #define CPC1_REG 0x30
  61. #define CPC2_REG 0x31
  62. #define CRYSTALTEST_REG 0x32
  63. #define PLLTEST_REG 0x33
  64. #define VCOTEST_REG 0x34
  65. #define RFANALOG_REG 0x35
  66. #define KEYDATA_REG 0x36
  67. #define CHSELECT_REG 0x37
  68. #define ROMP_REG 0x38
  69. #define DATARATECLOCK 0x39
  70. #define FCR_REG 0x3A
  71. #define ARD_REG 0x3B
  72. #define AFEP_REG 0x3C
  73. #define FCB_REG 0x3D
  74. #define KEYC_REG 0x3E
  75. #define USID_REG 0x3F
  76. //strobe command
  77. #define CMD_SLEEP 0x80 //1000,xxxx SLEEP mode
  78. #define CMD_IDLE 0x90 //1001,xxxx IDLE mode
  79. #define CMD_STBY 0xA0 //1010,xxxx Standby mode
  80. #define CMD_PLL 0xB0 //1011,xxxx PLL mode
  81. #define CMD_RX 0xC0 //1100,xxxx RX mode
  82. #define CMD_TX 0xD0 //1101,xxxx TX mode
  83. #define CMD_TFR 0xE0 //1110,xxxx TX FIFO reset
  84. #define CMD_RFR 0xF0 //1111,xxxx RX FIFO reset
  85. #define CMD_DPSLEEP_TRI 0x88 //1000,1000 deep sleep tri mode
  86. #define CMD_DPSLEEP_PULL 0x8B //1000,1011 deep sleep Pull high mode
  87. //@MODE_REG
  88. typedef union
  89. {
  90. uint8_t value;
  91. struct
  92. {
  93. uint8_t resetn : 8; //Write to this register by 0x00 to issue reset command, then it is auto clear
  94. }bits_w;
  95. struct
  96. {
  97. uint8_t trer : 1; //: TRX Enable Register.
  98. // [0]: Disable.
  99. // [1]: Enable. It will be clear after end of packet encountered in FIFO mode.
  100. uint8_t trsr : 1; //TRX Mode Select Register.
  101. // [0]: RX.
  102. // [1]: TX. When TRE set, the chip will enter TX or RX mode by TRS register.
  103. uint8_t pller : 1; //PLL enable Register.
  104. // [0]: PLL is disabled.
  105. // [1]: PLL is enabled.
  106. uint8_t xer : 1; //: Internal crystal oscillator enable Register.
  107. // [0]: Crystal oscillator is disabled.
  108. // [1]: Crystal oscillator is enabled
  109. uint8_t cer : 1; //RF chip enable Register.
  110. // [0]: RF chip is disabled.
  111. // [1]: RF chip is enabled.
  112. uint8_t crcf : 1; //CRC flag. (CRCF is read clear.)
  113. // [0]: CRC pass.
  114. // [1]: CRC error
  115. uint8_t fecf : 1; //FEC flag. (FECF is read clear.)
  116. // [0]: FEC pass.
  117. // [1]: FEC error
  118. uint8_t hecf : 1; //Head Control Flag. (Clear by any Strobe command.)
  119. // HEC is CRC-8 result from FCB + DFL.
  120. // [0]: HEC pass.
  121. // [1]: HEC error.
  122. }bits_r;
  123. }modeReg_tu;
  124. //@MODECTRL_REG
  125. typedef union
  126. {
  127. uint8_t value;
  128. struct
  129. {
  130. uint8_t adcm : 1; //ADC measurement enables (Auto clear when done).
  131. // [0]: Disable measurement or measurement finished.
  132. // [1]: Enable measurement.
  133. uint8_t fms : 1; //Direct/FIFO mode select.
  134. // [0]: Direct mode.
  135. // [1]: FIFO mode.
  136. uint8_t fmt : 1; //Reserved for internal usage only
  137. uint8_t wore : 1; //Wake On RX enable.
  138. // [0]: Disable.
  139. // [1]: Enable.
  140. uint8_t dfcd : 1; //: DFCD: Data Filter by CD.
  141. // [0]: Disable.
  142. // [1]: Enable. The data package would be filtered while the input power level is below the threshold level (RTH[7:0], 1Eh).
  143. // DFCD (Read only): Carrier detector signal.
  144. // [0]: Input power below threshold.
  145. // [1]: Input power above threshold.
  146. uint8_t aif : 1; //(Auto IF Offset): RF LO frequency will auto offset one IF frequency while entering RX mode.
  147. // [0]: Disable.
  148. // [1]: Enable.
  149. // If AIF =1, then,
  150. // FRXLO = FPLLS - FIF, for up side band (ULS = 0, 19h).
  151. // FRXLO = FPLLS + FIF, for low side band (ULS = 1, 19h)
  152. uint8_t arssi : 1; // Auto RSSI measurement while entering RX mode. Recommend ARSSI = [1].
  153. // [0]: Disable.
  154. // [1]: Enable.
  155. uint8_t ddpc : 1; //(Direct mode data pin control): Direct mode modem data can be accessed via SDIO pin when this register is enabled.
  156. // [0]: Disable.
  157. // [1]: Enable
  158. }bits_w;
  159. struct
  160. {
  161. uint8_t adcm : 1; //
  162. uint8_t fms : 1; //
  163. uint8_t fmt : 1; //
  164. uint8_t wore : 1; //
  165. uint8_t cd : 1; //
  166. uint8_t aif : 1; //
  167. uint8_t arssi : 1; //
  168. uint8_t ddpc : 1; //
  169. }bits_r;
  170. }modeCtrlReg_tu;
  171. //@FIFO2_REG
  172. typedef union
  173. {
  174. uint8_t value;
  175. struct
  176. {
  177. uint8_t psa : 6; //Used for Segment FIFO
  178. uint8_t fpm : 2; //FIFO Pointer Margin
  179. // [00]: 4 bytes.
  180. // [01]: 8 bytes.
  181. // [10]: 12 bytes.
  182. // [11]: 16 bytes.
  183. }bits_w;
  184. struct
  185. {
  186. uint8_t fifopt : 8; //FIFO pointer index (read only).
  187. // The FIFO access pointer = FIFOPT x 2.
  188. }bits_r;
  189. }fifo2Reg_tu;
  190. //@FIFO_REG
  191. typedef union
  192. {
  193. uint8_t value;
  194. struct
  195. {
  196. uint8_t fifo : 8; //FIFO data.
  197. // TX FIFO and RX FIFO share the same address (05h).
  198. // TX FIFO is max 64-byte write only.
  199. // RX FIFO is max 64-byte read only.
  200. }bits_w;
  201. struct
  202. {
  203. uint8_t fifo : 8; //FIFO data.
  204. // TX FIFO and RX FIFO share the same address (05h).
  205. // TX FIFO is max 64-byte write only.
  206. // RX FIFO is max 64-byte read only.
  207. }bits_r;
  208. }fifoReg_tu;
  209. //@IDCODE_REG
  210. typedef union
  211. {
  212. uint8_t value;
  213. struct
  214. {
  215. uint8_t id : 8; //: ID data (sync word, max 8 bytes).
  216. // When this address is accessed, ID Data is input or output sequential (ID Byte 0,1, 2, 3 …., 7) corresponding to Write or Read
  217. }bits_w;
  218. struct
  219. {
  220. uint8_t id : 8; //: ID data (sync word, max 8 bytes).
  221. // When this address is accessed, ID Data is input or output sequential (ID Byte 0,1, 2, 3 …., 7) corresponding to Write or Read
  222. }bits_r;
  223. }idDataReg_tu;
  224. //@RCOSC1_REG
  225. typedef union
  226. {
  227. uint8_t value;
  228. struct
  229. {
  230. uint8_t wor_sl0_7 : 8; //
  231. }bits_w;
  232. }rcOsc1Reg_tu;
  233. //@RCOSC2_REG
  234. typedef union
  235. {
  236. uint8_t value;
  237. struct
  238. {
  239. uint8_t wor_ac : 6; //: 6-bits WOR Active Timer for TWOR Function
  240. uint8_t wor_sl8_9 : 2; //10-bits WOR Sleep Timer for TWOR Function.
  241. // WOR_SL [9:0] are from address (07h) and (08h),
  242. // Device Active = (WOR_AC+1) x (1/4000), (250us ~ 16ms).
  243. // Device Sleep = (WOR_SL+1) x (1/4000) x 32, (8ms ~ 8.192s)
  244. }bits_w;
  245. }rcOsc2Reg_tu;
  246. //@RCOSC3_REG
  247. typedef union
  248. {
  249. uint8_t value;
  250. struct
  251. {
  252. uint8_t twor_e : 1; //Enable TWOR function.
  253. // [0]: Disable TWOR function.
  254. // [1]: Enable TWOR mode. Wake up MCU by a periodic TWOR output
  255. uint8_t tsel : 1; //Timer select for TWOR function.
  256. // [0]: Use WOR_AC.
  257. // [1]: Use WOR_SL.
  258. uint8_t rcosc_e : 1; //RC Oscillator Enable.
  259. // [0]: Disable.
  260. // [1]: Enable.
  261. uint8_t rcks : 2; //RO calibration clock select:
  262. // [00]: 32XDR
  263. // [01]: 16MHz
  264. // [1x]: 8XDR
  265. uint8_t mrc : 1; //Manual RC Bank value setting.
  266. // [0]: Auto.
  267. // [1]: Manual.
  268. uint8_t irchc : 1; //Ring oscillator high current mode select
  269. uint8_t resv : 1; //--
  270. }bits_w;
  271. }rcOsc3Reg_tu;
  272. //@CKO_REG
  273. typedef union
  274. {
  275. uint8_t value;
  276. struct
  277. {
  278. uint8_t scki : 1; //SPI clock input invert.
  279. // [0]: Non-inverted input.
  280. // [1]: Inverted input.
  281. uint8_t ckoe : 1; //CKO pin Output Enable.
  282. // [0]: High Z.
  283. // [1]: Enable
  284. uint8_t ckoi : 1; //CKO pin output signal invert.
  285. // [0]: Non-inverted output.
  286. // [1]: Inverted output.
  287. uint8_t ckos : 4; //: CKO pin output select.
  288. // [0000]: DCK (TX data clock).
  289. // [0001]: RCK (RX recovery clock).
  290. // [0010]: FPF (FIFO pointer flag).
  291. // [0011]: Logic OR gate by EOP, EOVBC, EOFBC, EOVCC, EOVDC, RSSC_OK and inverter signal of X’tal ready. (Internal
  292. // usage only).
  293. // [0100]: FSYCK / 2.
  294. // [0101]: FSYCK / 4.
  295. // [0110]: RXD.
  296. // [0111]: BOD.
  297. // [1000]: WCK.
  298. // [1001]: FSYNC.
  299. // [1010]: ROSC.
  300. // [1011]: MXDEC (MXT=0:inverter signal of OKADCN, MXT=1: DEC)
  301. // [1100]: BDF.
  302. // [1101]: FSYCK .
  303. // [1110]: VPOAK
  304. // [1111]: WRTC
  305. uint8_t eckoe : 1; //External Clock Output Enable for CKOS [3:0]= [0100] ~ [0111].
  306. // [0]: Disable.
  307. // [1]: Enable.
  308. }bits_w;
  309. }ckoPinCtrlReg_tu;
  310. //@GIO1_REG
  311. typedef union
  312. {
  313. uint8_t value;
  314. struct
  315. {
  316. uint8_t gio1oe : 1; //GIO1pin output enable.
  317. // [0]: High Z.
  318. // [1]: Enable
  319. uint8_t gio1i : 1; //GIO1 pin output signal invert.
  320. // [0]: Non-inverted output.
  321. // [1]: Inverted output.
  322. uint8_t gio1s : 4; // GIO1 pin function select.
  323. // GIO1S [3:0] TX state | RX state
  324. //------------------------------------------|------------------------------
  325. // [0000] WTR (Wait until TX or RX finished)
  326. // [0001] EOAC (end of access code) | FSYNC
  327. // [0010] TMEO or TMDEO(TX | CD(carrier detect)
  328. // modulation enable)
  329. // [0011] SID1 Detect Output(ID1DO)
  330. // [0100] RCOSC_E=1: MCU wakeup signal (TWOR);
  331. // RCOSC_E=0: CWTR
  332. // [0101] MTCRCINT / VTB0 /In phase demodulator input(DMII)
  333. // [0110] SDO ( 4 wires SPI data out)
  334. // [0111] TRXD In/Out ( Direct mode )
  335. // [1000] RXD ( Direct mode )
  336. // [1001] TXD ( Direct mode )
  337. // [1010] PDN_RX
  338. // [1011] External FSYNC input in RX direct mode *
  339. // [1100] MXINC(MXT=0:EOADC.MXT=1:INC.)
  340. // [1101] FPF
  341. // [1110] VPOAK (Auto Resend OK Output)
  342. // [1111] FMTDO (FIFO mode TX Data Output testing)
  343. uint8_t vpm : 1; //Valid Pulse width select.
  344. // [0]: 10us.
  345. // [1]: 30us.
  346. uint8_t vkm : 1; //Valid packet mode select.
  347. // [0]: by event.
  348. // [1]: by pulse.
  349. }bits_w;
  350. }gio1PinCtrlReg_tu;
  351. //@GIO2_REG
  352. typedef union
  353. {
  354. uint8_t value;
  355. struct
  356. {
  357. uint8_t gio2oe : 1; //GIO1pin output enable.
  358. // [0]: High Z.
  359. // [1]: Enable.
  360. uint8_t gio2i : 1; //GIO2 pin output signal invert.
  361. // [0]: Non-inverted output.
  362. // [1]: Inverted output.
  363. uint8_t gio2s : 4; //GIO2 pin function select.
  364. // GIO2S [3:0] TX state | RX state
  365. //------------------------------------------|------------------------------
  366. // [0000] WTR (Wait until TX or RX finished)
  367. // [0001] EOAC (end of access code) | FSYNC(frame sync)
  368. // [0010] TMEO(TX modulation enable) | CD(carrier detect)
  369. // [0011] SID1 Detect Output (ID1DO
  370. // [0100] RCOSC_E=1: MCU wakeup signal (TWOR);
  371. // RCOSC_E=0: CWTR
  372. // [0101] MTCRCINT/ VTB1 /Quadrature phase demodulator output (DMIQ).
  373. // [0110] SDO ( 4 wires SPI data out)
  374. // [0111] TRXD In/Out ( Direct mode )
  375. // [1000] RXD ( Direct mode )
  376. // [1001] TXD ( Direct mode )
  377. // [1010] PDN_TX
  378. // [1011]
  379. // [1100] BDF
  380. // [1101] FPF
  381. // [1110] VPOAK (Auto Resend OK Output)
  382. // [1111] FMTCK (FIFO mode TX Data clock Output testing)
  383. uint8_t bbcks : 2; //Clock s elect for digital block.
  384. // [00]: F SYCK
  385. // [01]: F SYCK / 2.
  386. // [10]: F SYCK / 4.
  387. // [11]: F SYCK / 8.
  388. // FSYCK is A5133’s System clock = 16MHz
  389. }bits_w;
  390. }gio2PinCtrlReg_tu;
  391. //@TX1_REG
  392. typedef union
  393. {
  394. uint8_t value;
  395. struct
  396. {
  397. uint8_t fdp : 3; //Frequency deviation power setting.
  398. uint8_t tme : 1; //TX modulation enable. Recommend TME = [1].
  399. // [0]: Disable.
  400. // [1]: Enable.
  401. uint8_t txdi : 1; //TX data invert. Recommend TXDI = [0].
  402. // [0]: Non-invert.
  403. // [1]: Invert.
  404. uint8_t tmde : 1; //TX Modulation Enable for VCO Modulation. Recommend TMDE = [1].
  405. // [0]: Disable.
  406. // [1]: Enable.
  407. uint8_t gf : 1; //Gaussian Filter Over-sampling Rate Select. Recommend GDR = [0].
  408. uint8_t gdr : 1; // GF: Gaussian Filter Select.
  409. // [0]: Disable.
  410. // [1]: Enable.
  411. }bits_w;
  412. }tx1Reg_tu;
  413. //@RSSI_REG
  414. typedef union
  415. {
  416. uint8_t value;
  417. struct
  418. {
  419. uint8_t rth : 8; //: Carrier detect threshold.
  420. // CD (Carrier Detect) =1 when RSSI ≧ RTH.
  421. // CD (Carrier Detect) =0 when RSSI < RTL
  422. }bits_w;
  423. struct
  424. {
  425. uint8_t adc : 8; //ADC output value of thermal sensor and RSSI (read only).
  426. // ADC input voltage= 0.6 * ADC [7:0] / 256 V
  427. }bits_r;
  428. }rssiThresHoldReg_tu;
  429. //@CODE1_REG
  430. typedef union
  431. {
  432. uint8_t value;
  433. struct
  434. {
  435. uint8_t epml : 2; //Extend Preamble Length Select. Recommend EPML= [00].
  436. // [00]: 0 byte.
  437. // [01]: 1 byte.
  438. // [10]: 2 bytes.
  439. // [11]: 4 bytes
  440. uint8_t idl : 2; //: ID Code Length Select. Recommend IDL= [11].
  441. // [00]: Reserved.
  442. // [01]: 4 bytes.
  443. // [10]: Reserved.
  444. // [11]: 8 bytes.
  445. // If user selects 4Bytes ID code, it is called SID1. If user selects 8Bytes ID code, the first 4Bytes ID code is called SID1 and the
  446. // second 4Bytes ID code is called SID2.
  447. uint8_t crcs : 1; //CRC Select.
  448. // [0]: Disable.
  449. // [1]: Enable. The CRC is set by CRCDNP (0x1A) for either CCITT-16 CRC or CRC-DNP
  450. uint8_t fecs : 1; //FEC Select.
  451. // [0]: Disable.
  452. // [1]: Enable (The FEC is (7, 4) Hamming code)
  453. uint8_t whts : 1; //Data Whitening (Data Encryption) Select.
  454. // [0]: Disable.
  455. // [1]: Enable (The data is whitening by multiplying PN7)
  456. uint8_t resv : 1; //--
  457. }bits_w;
  458. struct
  459. {
  460. uint8_t snf : 8; //Sub-package Flag (read only).
  461. }bits_r;
  462. }code1Reg_tu;
  463. //@CODE2_REG
  464. typedef union
  465. {
  466. uint8_t value;
  467. struct
  468. {
  469. uint8_t pth : 2; //Received SID1 Code Error Tolerance.
  470. // [00]: 0 bit,
  471. // [01]: 1 bit.
  472. // [10]: 2 bit.
  473. // [11]: 3 b
  474. uint8_t eth : 3; //Received SID2 Code Error Tolerance. SID2 is only valid if ID length is 8bytes.
  475. // [000]: 0 bit,
  476. // [001]: 1 bit.
  477. // [010]: 2 bit.
  478. // [011]: 3 bit.
  479. // [100]: 4 bit,
  480. // [101]: 5 bit.
  481. // [110]: 6 bit.
  482. // [111]: 7 bit
  483. uint8_t hecs : 1; //Head CRC Select
  484. // [0]: disable.
  485. // [1]: enable
  486. uint8_t edrl : 1; //Enable FIFO Dynamic Length
  487. // [0]: Disable.
  488. // [1]: Enable
  489. uint8_t mscrc : 1; //Mask CRC (CRC Data Filtering Enable).
  490. // [0]: Disable.
  491. // [1]: Enable.
  492. }bits_w;
  493. struct
  494. {
  495. uint8_t mtcrcf0_7 : 8; //Sub-package CRC Flag (read only).
  496. }bits_r;
  497. }code2Page0Reg_tu;
  498. //@CODE2_REG
  499. typedef union
  500. {
  501. uint8_t value;
  502. struct
  503. {
  504. uint8_t pfine : 3; //RC-OSC fine tuned value
  505. uint8_t resv1 : 1; //
  506. uint8_t tpa : 3; //PA current setting
  507. uint8_t resv2 : 1; //
  508. }bits_w;
  509. }code2Page8Reg_tu;
  510. typedef enum
  511. {
  512. PGV_1_2V,
  513. PGV_1_4V,
  514. PGV_1_6V,
  515. PGV_1_8V,
  516. PGV_2_0V,
  517. PGV_2_2V,
  518. PGV_2_4V,
  519. PGV_2_5V,
  520. }GPV_te;
  521. //@CODE2_REG
  522. typedef union
  523. {
  524. uint8_t value;
  525. struct
  526. {
  527. uint8_t pgv_pa : 3; //Power gain voltage for PA, @GPV_te
  528. uint8_t pm1sw : 2; //PM1 switch select
  529. uint8_t pm1swen : 1; //PM1 switch enable
  530. uint8_t pmpar : 1; //PM1 switch gating
  531. uint8_t porips : 1; //Reserved for internal usage
  532. }bits_w;
  533. }code2Page9Reg_tu;
  534. //@CODE3_REG
  535. typedef union
  536. {
  537. uint8_t value;
  538. struct
  539. {
  540. uint8_t ws : 7; //Data Whitening Seed (data encryption key).
  541. uint8_t crcinv : 1; //CRC Inverted Select.
  542. // [0]: Non-inverted.
  543. // [1]: inverted.
  544. }bits_w;
  545. struct
  546. {
  547. uint8_t mtcrcf8_15 : 8; //Sub-package CRC Flag (read only).
  548. }bits_r;
  549. }code3Page0Reg_tu;
  550. //@CODE3_REG
  551. typedef union
  552. {
  553. uint8_t value;
  554. struct
  555. {
  556. uint8_t xrcs : 1; //
  557. uint8_t psdpas : 3; //power saving signal delay select for PSNPA
  558. uint8_t txlpn : 1; //TX low power select
  559. uint8_t bias : 1; //
  560. uint8_t bgcs : 1; //
  561. uint8_t txhp : 1; //TX high power select
  562. }bits_w;
  563. }code3Page1Reg_tu;
  564. //@IFCAL1_REG
  565. typedef union
  566. {
  567. uint8_t value;
  568. struct
  569. {
  570. uint8_t mfb : 4; //
  571. uint8_t mfbs : 1; //
  572. uint8_t ckgs : 2; //
  573. uint8_t hfr : 1; //
  574. }bits_rw;
  575. }ifcal1Reg_tu;
  576. //@BATTERY_REG
  577. typedef union
  578. {
  579. uint8_t value;
  580. struct
  581. {
  582. uint8_t bd_e : 1; //Battery Detect Enable.
  583. // [0]: Disable.
  584. // [1]: Enable.
  585. uint8_t bvt : 3; //Battery Voltage Threshold Select.
  586. // [000]: 2.0V,
  587. // [001]: 2.1V.
  588. // [010]: 2.2V.
  589. // [011]: 2.3V.
  590. // [100]: 2.4V.
  591. // [101]: 2.5V.
  592. // [110]: 2.6V.
  593. // [111]: 2.7V.
  594. uint8_t qds : 1; //VDD_A Quick Discharge Select. Recommend QDS = [1].
  595. // [0]: Disable.
  596. // [1]: Enable.
  597. uint8_t bgs : 1; //Bangap (BG) select:
  598. // [0]: Low current BG.
  599. // [1]: High current BG.
  600. // Sleep mode should be set to [0]
  601. uint8_t pm1s : 1; //PM1 select.
  602. // [0]: Disable.
  603. // [1]: Enable
  604. uint8_t resv : 1; //--
  605. }bits_w;
  606. struct
  607. {
  608. uint8_t bd_e : 1; //Battery Detect Enable.
  609. // [0]: Disable.
  610. // [1]: Enable.
  611. uint8_t bvt : 3; //Battery Voltage Threshold Select.
  612. // [000]: 2.0V,
  613. // [001]: 2.1V.
  614. // [010]: 2.2V.
  615. // [011]: 2.3V.
  616. // [100]: 2.4V.
  617. // [101]: 2.5V.
  618. // [110]: 2.6V.
  619. // [111]: 2.7V.
  620. uint8_t bdf : 1; //: Low Battery Detection Flag (read only).
  621. // [0]: battery low.
  622. // [1]: battery high.
  623. uint8_t resv : 3; //--
  624. }bits_r;
  625. }batteryReg_tu;
  626. //@ROMP_REG
  627. typedef union
  628. {
  629. uint8_t value;
  630. struct
  631. {
  632. uint8_t pd_bod : 1; //BOD circuit power down.
  633. // [0]: Power on.
  634. // [1]: Power down
  635. uint8_t regcl : 1; //Reserved for internal usage
  636. uint8_t bdc : 6; //Battery detector current option select
  637. }bits_w;
  638. }romp0Reg_tu;
  639. //@FCR_REG
  640. typedef union
  641. {
  642. uint8_t value;
  643. struct
  644. {
  645. uint8_t ear : 1; //Enable auto-resend.
  646. // [0]: Disable.
  647. // [1]: Enable
  648. uint8_t eak : 1; //Enable auto-ack.
  649. // [0]: Disable.
  650. // [1]: Enable.
  651. uint8_t arc : 4; //Decremented ARC[3:0] (read only).
  652. uint8_t fcl : 2; //Frame Control Length.
  653. // [00]: No Frame Control
  654. // [01]: 1 byte Frame Control. (FCB0)
  655. // [10]: 2 byte Frame control. (FCB0+FCB1)
  656. // [11]: 4 byte Frame control. (FCB0+FCB1+FCB2+FCB3)
  657. }bits_w;
  658. struct
  659. {
  660. uint8_t ear : 1; //Enable auto-resend.
  661. // [0]: Disable.
  662. // [1]: Enable
  663. uint8_t eak : 1; //Enable auto-ack.
  664. // [0]: Disable.
  665. // [1]: Enable.
  666. uint8_t rcr : 4; //Auto Resend Cycle Setting.
  667. // [0000]: resend disable.
  668. // [0001]: 1
  669. // [0010]: 2
  670. // [0011]: 3
  671. // [0100]: 4
  672. // [0101]: 5
  673. // [0110]: 6
  674. // [0111]: 7
  675. // [1000]: 8
  676. // [1001]: 9
  677. // [1010]: 10
  678. // [1011]: 11
  679. // [1100]: 12
  680. // [1101]: 13
  681. // [1110]: 14
  682. // [1111]: 15
  683. uint8_t vpoak : 1; //Valid Packet or ACK OK Flag. (read only)
  684. // This bit is clear by any Strobe command.
  685. // [0]: Neither valid packet nor ACK OK.
  686. // [1]: Valid packet or ACK OK
  687. uint8_t artef : 1; //Auto re-transmission ending flag (read only).
  688. // [0]: Resend not end
  689. // [1]: Finish resend.
  690. }bits_r;
  691. }fcrReg_tu;
  692. //@AFEP_REG
  693. typedef union
  694. {
  695. uint8_t value;
  696. struct
  697. {
  698. uint8_t ackfep : 6; //: FIFO Length setting for auto-ack packet.
  699. // ACK FIFO Length = (ACKFEP [5:0] + 1)
  700. // max. 64 bytes
  701. uint8_t spss : 1; //Mode Back Select when auto-act and auto-resend are enabled.
  702. // [0]: Reserved.
  703. // [1]: PLL mode
  704. uint8_t eaf : 1; //Enable ACK FIFO.
  705. // [0]: Disable.
  706. // [1]: Enable.
  707. }bits_w;
  708. struct
  709. {
  710. uint8_t txsn : 3; //TX Serial Number.
  711. // acket and keep the same TXSN when retransmitting
  712. uint8_t earts : 3; //Enable Auto Resend Read.
  713. uint8_t resv : 3; //--
  714. }bits_r;
  715. }afepReg_tu;
  716. //@TXTEST_REG
  717. typedef union
  718. {
  719. uint8_t value;
  720. struct
  721. {
  722. uint8_t tbf : 3; //TX Buffer Setting.
  723. // Refer to A5133 App. Note for more settings
  724. uint8_t resv : 2; //--
  725. uint8_t txcs : 1; //TX current setting.
  726. uint8_t asmv : 2; //Ramp up/down clock select.
  727. // [00]: 1 MHz.
  728. // [01]: 1/2 MHz.
  729. // [10]: 1/4 MHz.
  730. // [11]: 1/8 MHz.
  731. }bits_w;
  732. }txTestReg_tu;
  733. #endif