A7169reg.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. /********************************************************************
  2. * A7169REG.h
  3. * RF Chip-A7169 Hardware Definitions
  4. *
  5. * This file provides the constants associated with the
  6. * AMICCOM A7169 device.
  7. *
  8. ********************************************************************/
  9. #ifndef _A7169REG_h_
  10. #define _A7169REG_h_
  11. #include <stdint.h>
  12. /**
  13. * 以下寄存器通过这个来操作:
  14. * 1、A7169_WriteReg
  15. */
  16. #define SYSTEMCLOCK_REG 0x00
  17. #define PLL1_REG 0x01
  18. #define PLL2_REG 0x02
  19. #define PLL3_REG 0x03
  20. #define PLL4_REG 0x04
  21. #define PLL5_REG 0x05
  22. #define PLL6_REG 0x06
  23. #define CRYSTAL_REG 0x07
  24. #define PAGEA_REG 0x08
  25. #define PAGEB_REG 0x09
  26. #define RX1_REG 0x0A
  27. #define RX2_REG 0x0B
  28. #define ADC_REG 0x0C
  29. #define PIN_REG 0x0D
  30. #define CALIBRATION_REG 0x0E
  31. #define MODE_REG 0x0F
  32. /**
  33. * 以下寄存器通过这两个api来操作:
  34. * 1、写操作:A7169_WritePageA
  35. * 2、读操作:A7169_ReadPageA
  36. */
  37. #define TX1_PAGEA 0x00
  38. #define WOR1_PAGEA 0x01
  39. #define WOR2_PAGEA 0x02
  40. #define RFI_PAGEA 0x03
  41. #define PM_PAGEA 0x04
  42. #define RTH_PAGEA 0x05
  43. #define AGC1_PAGEA 0x06
  44. #define AGC2_PAGEA 0x07
  45. #define GIO_PAGEA 0x08
  46. #define CKO_PAGEA 0x09
  47. #define VCB_PAGEA 0x0A
  48. #define CHG1_PAGEA 0x0B
  49. #define CHG2_PAGEA 0x0C
  50. #define FIFO_PAGEA 0x0D
  51. #define CODE_PAGEA 0x0E
  52. #define WCAL_PAGEA 0x0F
  53. /**
  54. * 以下寄存器通过这两个api来操作:
  55. * 1、写操作:A7169_WritePageB
  56. * 2、读操作:A7169_ReadPageB
  57. */
  58. #define TX2_PAGEB 0x00
  59. #define IF1_PAGEB 0x01
  60. #define IF2_PAGEB 0x02
  61. #define ACK_PAGEB 0x03
  62. #define ART_PAGEB 0x04
  63. #define SYN_PAGEB 0x05
  64. #define RCCAL_PAGEB 0x06
  65. #define ACKFIFO_PAGEB 0x07
  66. #define PNCFG1_PAGEB 0x08
  67. #define PNCFG2_PAGEB 0x09
  68. #define PNCFG3_PAGEB 0x0A
  69. #define PNCFG4_PAGEB 0x0B
  70. #define PNCFG5_PAGEB 0x0C
  71. #define TCODE_PAGEB 0x0D
  72. #define PN_DC_PAGEB 0x0E
  73. #define PNCFG6_PAGEB 0x0F
  74. #define PNCFG7_PAGEB 0x10
  75. #define PNCFG8_PAGEB 0x11
  76. #define PNCFG9_PAGEB 0x12
  77. #define PNCFG10_PAGEB 0x13
  78. #define Misc_CFG1_PAGEB 0x14
  79. #define Misc_CFG2_PAGEB 0x15
  80. #define Misc_CFG3_PAGEB 0x16
  81. #define PLL7_PAGEB 0x17
  82. #define PLL8_PAGEB 0x18
  83. #define PSMODE1_PAGEB 0x19
  84. #define PSMODE2_PAGEB 0x1A
  85. #define PSMODE3_PAGEB 0x1B
  86. #define TX3_PAGEB 0x1C
  87. #define Misc_CFG4_PAGEB 0x1D
  88. #define PNCFG11_PAGEB 0x1E
  89. #define PNCFG12_PAGEB 0x1F
  90. #define PNCFG13_PAGEB 0x20
  91. #define PNCFG14_PAGEB 0x21
  92. #define PNCFG15_PAGEB 0x22
  93. #define PNCFG16_PAGEB 0x23
  94. #define PNCFG17_PAGEB 0x24
  95. #define PNCFG18_PAGEB 0x25
  96. #define CSMA1_PAGEB 0x26
  97. #define CSMA2_PAGEB 0x27
  98. #define TXPA_PAGEB 0x28
  99. #define DCMON1_PAGEB 0x29
  100. #define DCMON2_PAGEB 0x2A
  101. #define DCMON3_PAGEB 0x2B
  102. #define MBUS1_PAGEB 0x2C
  103. #define MBUS2_PAGEB 0x2D
  104. #define MBUS3_PAGEB 0x2E
  105. #define MBUS4_PAGEB 0x2F
  106. #define MBUS5_PAGEB 0x30
  107. #define PN_DC2_PAGEB 0x31
  108. #define VCB2_PAGEB 0x32
  109. #define PS_MODE4_PAGEB 0x33
  110. #define WOR3_PAGEB 0x34
  111. /**
  112. * 以下寄存器通过这个来操作:
  113. * 1、StrobeCMD
  114. */
  115. #define CMD_Reg_W 0x00 //000x,xxxx control register write
  116. #define CMD_Reg_R 0x80 //100x,xxxx control register read
  117. #define CMD_ID_W 0x20 //001x,xxxx ID write
  118. #define CMD_ID_R 0xA0 //101x,xxxx ID Read
  119. #define CMD_FIFO_W 0x40 //010x,xxxx TX FIFO Write
  120. #define CMD_FIFO_R 0xC0 //110x,xxxx RX FIFO Read
  121. #define CMD_RF_RST 0xFF //x111,xxxx RF reset
  122. #define CMD_TFR 0x60 //0110,xxxx TX FIFO address pointrt reset
  123. #define CMD_RFR 0xE0 //1110,xxxx RX FIFO address pointer reset
  124. #define CMD_SLEEP 0x10 //0001,0000 SLEEP mode
  125. #define CMD_IDLE 0x12 //0001,0010 IDLE mode
  126. #define CMD_STBY 0x14 //0001,0100 Standby mode
  127. #define CMD_PLL 0x16 //0001,0110 PLL mode
  128. #define CMD_RX 0x18 //0001,1000 RX mode
  129. #define CMD_TX 0x1A //0001,1010 TX mode
  130. //#define CMD_DEEP_SLEEP 0x1C //0001,1100 Deep Sleep mode(tri-state)
  131. #define CMD_DEEP_SLEEP 0x1F //0001,1111 Deep Sleep mode(pull-high)
  132. //@PLL1_REG
  133. typedef union
  134. {
  135. uint16_t value;
  136. struct
  137. {
  138. uint16_t ip : 9; //LO frequency Integer Part setting.
  139. uint16_t chi : 2; //Reserved. CHI shall be [00].
  140. uint16_t chf : 2; // Charge-pump current setting for fractional-N synthesizer. Recommend CHF = [01].
  141. // [00]: 48uA
  142. // [01]: 96uA
  143. // [10]: 192uA
  144. // [11]: 384uA
  145. uint16_t chi2i : 1; //Reserved. CHI2I shall be [0].
  146. uint16_t chf2i : 1; //Reserved. CHI2F shall be [0].
  147. uint16_t crcinv : 1; // CRC Inverted Select.
  148. // [0]: Disable.
  149. // [1]: Enable
  150. }bits_w;
  151. }pll1_tu;
  152. //@PLL4_REG
  153. typedef union
  154. {
  155. uint16_t value;
  156. struct
  157. {
  158. uint16_t EDI : 1; // Dither Noise setting. Recommend EDI = [0].
  159. // [0]: Disable.
  160. // [1]: Enable.
  161. uint16_t NSDO : 1; // Mash sigma delta order setting. Recommend NSDO = [0].
  162. // [0]: Order 2.
  163. // [1]: Order 3.
  164. uint16_t SDPW : 2; // Pulse Width of sigma-delta modulator. SDPW shall be [00].
  165. uint16_t ISDIV : 1; // Divider current test bit. Recommend ISDIV = [0].
  166. // [0]: Low current.
  167. // [1]: High current.
  168. uint16_t CPS : 1; // Charge Pump tri-state setting. Recommend CPS = [1].
  169. // [0]: Tri-state.
  170. // [1]: Normal operation.
  171. uint16_t VCI : 1; // VCO current calibration test bit. Reserved. VCl shall be [0].
  172. uint16_t ADCR : 1; // Reserved. ADCR should be= [0].
  173. uint16_t MD0 : 1; // LO Buffer current select.
  174. // [0]: Low current .
  175. // [1]: High current.
  176. uint16_t PDL : 3; // PLL Settling Delay Time setting.
  177. // PDL [2:0] PLL Delay Timer Note
  178. // 000 20 us
  179. // 001 40 us
  180. // 010 60 us
  181. // 011 80 us Recommend
  182. // 100 100 us
  183. // 101 120 us
  184. // 110 140 us
  185. // 111 160 us
  186. uint16_t MD1 : 1; // RF Band select.
  187. // [0]: Low band (310MHz ~ 510MHz)
  188. // [1]: High band (860MHz ~ 930MHz)
  189. uint16_t CKX2 : 1; // Reserved. CKX2 shall be [0].
  190. uint16_t EDIVS : 1; // Synthesizer Selection. EDIVS shall be [0].
  191. // [0]: Fractional-N PLL.
  192. // [1]: Reserved.
  193. uint16_t TXDBG : 1; // TX Debug mode. TXDBG shall be [0].
  194. // [0]: Disable.
  195. // [1]: Enable.
  196. }bits_w;
  197. }pll4_tu;
  198. //@TX2_PAGEB
  199. typedef union
  200. {
  201. uint16_t value;
  202. struct
  203. {
  204. uint16_t tbg0_2 : 3; //TX Buffer Gain setting.
  205. // TBG [5:3] is located in 0x09h, page 21.
  206. // Please refer to Chapter 8 and A7169 App. Note for programmable TX output power.
  207. uint16_t tdc : 2; //TX Driver current setting.
  208. // Please refer to Chapter 8 and A7169 App. Note for programmable TX output power.
  209. uint16_t pac : 2; //PA current setting.
  210. // Please refer to Chapter 8 and A7169 App. Note for programmable TX output power
  211. uint16_t txdi : 1; //TX data inverted. Recommend TXDI = [0].
  212. // [0]: Normal.
  213. // [1]: Invert
  214. uint16_t tdl : 2; //TX Settling Delay select.
  215. uint16_t bt : 2; //Moving average for Gaussian filter select.
  216. // If GS = [0],
  217. // Gaussian filter is disabled,
  218. // BT = [00]: not average.
  219. // [01]: 2 bit average.
  220. // [10]: 4 bit average.
  221. // [11]: 8 bit average
  222. // That means BT is used to smooth TX data transition.
  223. // If GS = [1],
  224. // Gaussian filter is enabled, and crystal frequency is 12.8MHz, DMOS=1
  225. // BT = [00]: 2.0.
  226. // [01]: 1.0.
  227. // [10]: 0.5.
  228. // [11]: 0.5
  229. // If crystal frequency is 16MHz, DMOS=1
  230. // BT = [00]: 1.0.
  231. // [01]: 0.5.
  232. // That means BT is used to configure shape of Gaussian filter.
  233. uint16_t dpr : 3; //Scaling of PDL and TDL. Recommend DPR = [00000].
  234. // DPR[4:3] is located in 0x09h, page 40.
  235. uint16_t mcntr : 1; //Divided by 2 select
  236. }bits_w;
  237. uint16_t did; //Device ID data. (Read Only).
  238. }pageB_tx2_tu;
  239. //@Misc_CFG2_PAGEB
  240. typedef union
  241. {
  242. uint16_t value;
  243. struct
  244. {
  245. uint16_t dc_diff : 5; //
  246. uint16_t dc_dth : 1; //
  247. uint16_t man_sel : 1; //
  248. uint16_t man_start : 1; //
  249. uint16_t tbg3_5 : 3; //
  250. uint16_t exdis : 1; //
  251. uint16_t pn_start : 1; //
  252. uint16_t raw_sel : 1; //
  253. uint16_t rev : 2; //
  254. }bits_w;
  255. }pageB_misc_cfg2_tu;
  256. typedef enum
  257. {
  258. GIOMD_WTR,
  259. GIOMD_EOAC_FSYNC,
  260. GIOMD_TMEO_CD,
  261. GIOMD_PDN_PA,
  262. GIOMD_TWOR,
  263. GIOMD_SDO,
  264. GIOMD_TRXD,
  265. GIOMD_RXD,
  266. GIOMD_NC1,
  267. GIOMD_PDNRX,
  268. GIOMD_NC2,
  269. GIOMD_VPOAK,
  270. GIOMD_WATCH,
  271. GIOMD_PDNTX,
  272. GIOMD_FMTDO,
  273. }gioModeSlt_e;
  274. //@GIO_PAGEA
  275. typedef union
  276. {
  277. uint16_t value;
  278. struct
  279. {
  280. uint16_t g1oe : 1; //GIO1pin output enable.
  281. // [0]: High Z.
  282. // [1]: Enable.
  283. uint16_t g1i : 1; //GIO1 pin output signal invert.
  284. // [0]: Non-inverted output.
  285. // [1]: Inverted output.
  286. uint16_t gio1s : 4; //@gioModeSlt_e, GIO1 pin function select.
  287. uint16_t g2oe : 1; //: GIO2 pin output enable.
  288. // [0]: High Z.
  289. // [1]: Enable.
  290. uint16_t g2i : 1; //GIO2 pin output signal invert.
  291. // [0]: Non-inverted output.
  292. // [1]: Inverted output.
  293. uint16_t gio2s : 4; //@gioModeSlt_e, GIO2 pin function select
  294. uint16_t ddpc : 1; //C(Direct mode data pin control): Direct mode modem data can be accessed via SDIO pin.
  295. // [0]: Disable.
  296. // [1]: Enable.
  297. uint16_t mcnt : 2; //Main Clock Divider.
  298. // [00]: fCMNT=fMSCK
  299. // [01]: fCMNT=fMSCK/ 2
  300. // [10]: fCMNT=fMSCK/ 3
  301. // [11]: fCMNT=fMSCK/ 4
  302. // Please refer to Chapter 12 for details.
  303. uint16_t wrcks : 1; //WOR Reference clock select.
  304. // [0]: WOR Ref clock when PF8M is equal or close to 6.4MHz.
  305. // [1]: WOR Ref clock when PF8M is equal or close to 8MHz
  306. }bits_w;
  307. }pageA_gio_tu;
  308. //@MODE_REG
  309. typedef union
  310. {
  311. uint16_t value;
  312. struct
  313. {
  314. uint16_t adcm : 1; //ADC measurement (Auto clear when done).
  315. // [0]: Disable
  316. // [1]: Enable.
  317. uint16_t fbc : 1; //IF Filter Bank calibration enable (Auto clear when done).
  318. // [0]: Disable .
  319. // [1]: Enable.
  320. uint16_t vbc : 1; //VCO Bank calibration enable (Auto clear when done).
  321. // [0]: Disable.
  322. // [1]: Enable.
  323. uint16_t trer : 1; //TRX mode enable by register. Shall be set to [1].
  324. // [0]: Reserved.
  325. // [1]: By register control (CER and TRSR). In FIFO mode, this bit will be cleared after end of packet encountered.
  326. uint16_t trsr : 1; //TRX Mode select by register.
  327. // [0]: RX mode.
  328. // [1]: TX mode.
  329. // When bit TRER=1, the chip will enter TX or RX mode by TRSR register
  330. uint16_t plle : 1; //PLL enable by register.
  331. // [0]: PLL off.
  332. // [1]: PLL on
  333. uint16_t cer : 1; //Crystal enable by register.
  334. // [0]: crystal turn-off.
  335. // [1]: crystal turn-on.
  336. uint16_t fms : 1; //Direct/FIFO mode select.
  337. // [0]: Direct mode.
  338. // [1]: FIFO mode.
  339. uint16_t fmt : 1; //Reserved for internal usage only. Shall be set to [0].
  340. uint16_t wwse : 1; //WOT/WOR function enable.
  341. // [0]: Disable.
  342. // [1]: Enable
  343. uint16_t cce : 1; //: Chip enable by register.
  344. // [0]: chip turn-off.
  345. // [1]: chip turn-on.
  346. uint16_t vcc : 1; //VCO current calibration.
  347. // [0]: Disable
  348. // [1]: Enable
  349. uint16_t rssc : 1; //RSSI Calibration.
  350. // [0]: Disable.
  351. // [1]: Enable.
  352. uint16_t swt : 1; //VCO Current and ADC clock and System clock select. Recommend SWT = [0].
  353. // [0]: Original
  354. // [1]: Update
  355. uint16_t vbs : 1; //Reserved. Should set to [0].
  356. uint16_t dfcd : 1; //Packet Filtering by Carrier Detect.
  357. // The received packet is filtered if the input power level is below RTH (0Ah).
  358. // [0]: Disable.
  359. // [1]: Enable.
  360. }bits_w;
  361. }base_modeControl_tu;
  362. //@TX1_PAGEA
  363. typedef union
  364. {
  365. uint16_t value;
  366. struct
  367. {
  368. uint16_t fd : 8; //TX Frequency Deviation setting.
  369. // For both Gaussian filter is enabled (GS =1) or disabled(GS = 0)
  370. uint16_t fdp : 3; // Frequency Deviation Exponential Coefficient setting.
  371. uint16_t gs : 1; //Gaussian Filter Selection.
  372. // [0]: Disable.
  373. // [1]: Enable.
  374. uint16_t tme : 1; //TX Modulation Enable.
  375. // [0]: Disable.
  376. // [1]: Enable.
  377. uint16_t rc_dly : 3; //RSSI calibration RL Delay setting. Recommend RC_DLY= [000].
  378. // [000]: 100us.
  379. // [001]: 300us.
  380. // [010]: 500us.
  381. // [011]: 700us.
  382. // [100]: 900us.
  383. // [101]: 1.1ms.
  384. // [110]: 1.3ms.
  385. // [111]: 1.5ms.
  386. }bits_w;
  387. }pageA_tx1_tu;
  388. //@FIFO_PAGEA
  389. typedef union
  390. {
  391. uint16_t value;
  392. struct
  393. {
  394. uint16_t FEP : 8; //FIFO End Pointer for TX FIFO and Rx FIFO.
  395. // Where FEP[7:0] are located at here and FEP[13:8] are located at 08h page 10.
  396. // FIFO Length Setting = (FEP [13:0] +1).
  397. // For example, if FEP = 0x3F, it means FIFO length is 64 bytes.
  398. // For FIFO extension mode, FEP’s value shall be set larger than 0x3F.
  399. // Please refer to section 16.4.2 for details
  400. uint16_t PSA : 6; //Used for Segment FIFO.
  401. // Used in FIFO segment mode
  402. uint16_t FPM : 2; //FIFO Pointer Margin.
  403. // FPM is used in FIFO extension mode for an indicator.
  404. // FPM[1:0] Bytes in TX FIFO Bytes in RX FIFO
  405. // [00] 4 60
  406. // [01] 8 56
  407. // [10] 12 52
  408. // [11] 16 48
  409. }bits_w;
  410. }pageA_fifo_tu;
  411. #endif