123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- /********************************************************************
- * A7169REG.h
- * RF Chip-A7169 Hardware Definitions
- *
- * This file provides the constants associated with the
- * AMICCOM A7169 device.
- *
- ********************************************************************/
- #ifndef _A7169REG_h_
- #define _A7169REG_h_
- #include <stdint.h>
- /**
- * 以下寄存器通过这个来操作:
- * 1、A7169_WriteReg
- */
- #define SYSTEMCLOCK_REG 0x00
- #define PLL1_REG 0x01
- #define PLL2_REG 0x02
- #define PLL3_REG 0x03
- #define PLL4_REG 0x04
- #define PLL5_REG 0x05
- #define PLL6_REG 0x06
- #define CRYSTAL_REG 0x07
- #define PAGEA_REG 0x08
- #define PAGEB_REG 0x09
- #define RX1_REG 0x0A
- #define RX2_REG 0x0B
- #define ADC_REG 0x0C
- #define PIN_REG 0x0D
- #define CALIBRATION_REG 0x0E
- #define MODE_REG 0x0F
- /**
- * 以下寄存器通过这两个api来操作:
- * 1、写操作:A7169_WritePageA
- * 2、读操作:A7169_ReadPageA
- */
- #define TX1_PAGEA 0x00
- #define WOR1_PAGEA 0x01
- #define WOR2_PAGEA 0x02
- #define RFI_PAGEA 0x03
- #define PM_PAGEA 0x04
- #define RTH_PAGEA 0x05
- #define AGC1_PAGEA 0x06
- #define AGC2_PAGEA 0x07
- #define GIO_PAGEA 0x08
- #define CKO_PAGEA 0x09
- #define VCB_PAGEA 0x0A
- #define CHG1_PAGEA 0x0B
- #define CHG2_PAGEA 0x0C
- #define FIFO_PAGEA 0x0D
- #define CODE_PAGEA 0x0E
- #define WCAL_PAGEA 0x0F
- /**
- * 以下寄存器通过这两个api来操作:
- * 1、写操作:A7169_WritePageB
- * 2、读操作:A7169_ReadPageB
- */
- #define TX2_PAGEB 0x00
- #define IF1_PAGEB 0x01
- #define IF2_PAGEB 0x02
- #define ACK_PAGEB 0x03
- #define ART_PAGEB 0x04
- #define SYN_PAGEB 0x05
- #define RCCAL_PAGEB 0x06
- #define ACKFIFO_PAGEB 0x07
- #define PNCFG1_PAGEB 0x08
- #define PNCFG2_PAGEB 0x09
- #define PNCFG3_PAGEB 0x0A
- #define PNCFG4_PAGEB 0x0B
- #define PNCFG5_PAGEB 0x0C
- #define TCODE_PAGEB 0x0D
- #define PN_DC_PAGEB 0x0E
- #define PNCFG6_PAGEB 0x0F
- #define PNCFG7_PAGEB 0x10
- #define PNCFG8_PAGEB 0x11
- #define PNCFG9_PAGEB 0x12
- #define PNCFG10_PAGEB 0x13
- #define Misc_CFG1_PAGEB 0x14
- #define Misc_CFG2_PAGEB 0x15
- #define Misc_CFG3_PAGEB 0x16
- #define PLL7_PAGEB 0x17
- #define PLL8_PAGEB 0x18
- #define PSMODE1_PAGEB 0x19
- #define PSMODE2_PAGEB 0x1A
- #define PSMODE3_PAGEB 0x1B
- #define TX3_PAGEB 0x1C
- #define Misc_CFG4_PAGEB 0x1D
- #define PNCFG11_PAGEB 0x1E
- #define PNCFG12_PAGEB 0x1F
- #define PNCFG13_PAGEB 0x20
- #define PNCFG14_PAGEB 0x21
- #define PNCFG15_PAGEB 0x22
- #define PNCFG16_PAGEB 0x23
- #define PNCFG17_PAGEB 0x24
- #define PNCFG18_PAGEB 0x25
- #define CSMA1_PAGEB 0x26
- #define CSMA2_PAGEB 0x27
- #define TXPA_PAGEB 0x28
- #define DCMON1_PAGEB 0x29
- #define DCMON2_PAGEB 0x2A
- #define DCMON3_PAGEB 0x2B
- #define MBUS1_PAGEB 0x2C
- #define MBUS2_PAGEB 0x2D
- #define MBUS3_PAGEB 0x2E
- #define MBUS4_PAGEB 0x2F
- #define MBUS5_PAGEB 0x30
- #define PN_DC2_PAGEB 0x31
- #define VCB2_PAGEB 0x32
- #define PS_MODE4_PAGEB 0x33
- #define WOR3_PAGEB 0x34
- /**
- * 以下寄存器通过这个来操作:
- * 1、StrobeCMD
- */
- #define CMD_Reg_W 0x00 //000x,xxxx control register write
- #define CMD_Reg_R 0x80 //100x,xxxx control register read
- #define CMD_ID_W 0x20 //001x,xxxx ID write
- #define CMD_ID_R 0xA0 //101x,xxxx ID Read
- #define CMD_FIFO_W 0x40 //010x,xxxx TX FIFO Write
- #define CMD_FIFO_R 0xC0 //110x,xxxx RX FIFO Read
- #define CMD_RF_RST 0xFF //x111,xxxx RF reset
- #define CMD_TFR 0x60 //0110,xxxx TX FIFO address pointrt reset
- #define CMD_RFR 0xE0 //1110,xxxx RX FIFO address pointer reset
- #define CMD_SLEEP 0x10 //0001,0000 SLEEP mode
- #define CMD_IDLE 0x12 //0001,0010 IDLE mode
- #define CMD_STBY 0x14 //0001,0100 Standby mode
- #define CMD_PLL 0x16 //0001,0110 PLL mode
- #define CMD_RX 0x18 //0001,1000 RX mode
- #define CMD_TX 0x1A //0001,1010 TX mode
- //#define CMD_DEEP_SLEEP 0x1C //0001,1100 Deep Sleep mode(tri-state)
- #define CMD_DEEP_SLEEP 0x1F //0001,1111 Deep Sleep mode(pull-high)
- //@PLL1_REG
- typedef union
- {
- uint16_t value;
- struct
- {
- uint16_t ip : 9; //LO frequency Integer Part setting.
- uint16_t chi : 2; //Reserved. CHI shall be [00].
- uint16_t chf : 2; // Charge-pump current setting for fractional-N synthesizer. Recommend CHF = [01].
- // [00]: 48uA
- // [01]: 96uA
- // [10]: 192uA
- // [11]: 384uA
- uint16_t chi2i : 1; //Reserved. CHI2I shall be [0].
- uint16_t chf2i : 1; //Reserved. CHI2F shall be [0].
- uint16_t crcinv : 1; // CRC Inverted Select.
- // [0]: Disable.
- // [1]: Enable
- }bits_w;
- }pll1_tu;
- //@PLL4_REG
- typedef union
- {
- uint16_t value;
- struct
- {
- uint16_t EDI : 1; // Dither Noise setting. Recommend EDI = [0].
- // [0]: Disable.
- // [1]: Enable.
- uint16_t NSDO : 1; // Mash sigma delta order setting. Recommend NSDO = [0].
- // [0]: Order 2.
- // [1]: Order 3.
- uint16_t SDPW : 2; // Pulse Width of sigma-delta modulator. SDPW shall be [00].
- uint16_t ISDIV : 1; // Divider current test bit. Recommend ISDIV = [0].
- // [0]: Low current.
- // [1]: High current.
- uint16_t CPS : 1; // Charge Pump tri-state setting. Recommend CPS = [1].
- // [0]: Tri-state.
- // [1]: Normal operation.
- uint16_t VCI : 1; // VCO current calibration test bit. Reserved. VCl shall be [0].
- uint16_t ADCR : 1; // Reserved. ADCR should be= [0].
- uint16_t MD0 : 1; // LO Buffer current select.
- // [0]: Low current .
- // [1]: High current.
- uint16_t PDL : 3; // PLL Settling Delay Time setting.
- // PDL [2:0] PLL Delay Timer Note
- // 000 20 us
- // 001 40 us
- // 010 60 us
- // 011 80 us Recommend
- // 100 100 us
- // 101 120 us
- // 110 140 us
- // 111 160 us
- uint16_t MD1 : 1; // RF Band select.
- // [0]: Low band (310MHz ~ 510MHz)
- // [1]: High band (860MHz ~ 930MHz)
- uint16_t CKX2 : 1; // Reserved. CKX2 shall be [0].
- uint16_t EDIVS : 1; // Synthesizer Selection. EDIVS shall be [0].
- // [0]: Fractional-N PLL.
- // [1]: Reserved.
- uint16_t TXDBG : 1; // TX Debug mode. TXDBG shall be [0].
- // [0]: Disable.
- // [1]: Enable.
- }bits_w;
- }pll4_tu;
- //@TX2_PAGEB
- typedef union
- {
- uint16_t value;
- struct
- {
- uint16_t tbg0_2 : 3; //TX Buffer Gain setting.
- // TBG [5:3] is located in 0x09h, page 21.
- // Please refer to Chapter 8 and A7169 App. Note for programmable TX output power.
- uint16_t tdc : 2; //TX Driver current setting.
- // Please refer to Chapter 8 and A7169 App. Note for programmable TX output power.
- uint16_t pac : 2; //PA current setting.
- // Please refer to Chapter 8 and A7169 App. Note for programmable TX output power
- uint16_t txdi : 1; //TX data inverted. Recommend TXDI = [0].
- // [0]: Normal.
- // [1]: Invert
- uint16_t tdl : 2; //TX Settling Delay select.
- uint16_t bt : 2; //Moving average for Gaussian filter select.
- // If GS = [0],
- // Gaussian filter is disabled,
- // BT = [00]: not average.
- // [01]: 2 bit average.
- // [10]: 4 bit average.
- // [11]: 8 bit average
- // That means BT is used to smooth TX data transition.
- // If GS = [1],
- // Gaussian filter is enabled, and crystal frequency is 12.8MHz, DMOS=1
- // BT = [00]: 2.0.
- // [01]: 1.0.
- // [10]: 0.5.
- // [11]: 0.5
- // If crystal frequency is 16MHz, DMOS=1
- // BT = [00]: 1.0.
- // [01]: 0.5.
- // That means BT is used to configure shape of Gaussian filter.
- uint16_t dpr : 3; //Scaling of PDL and TDL. Recommend DPR = [00000].
- // DPR[4:3] is located in 0x09h, page 40.
- uint16_t mcntr : 1; //Divided by 2 select
- }bits_w;
- uint16_t did; //Device ID data. (Read Only).
- }pageB_tx2_tu;
- //@Misc_CFG2_PAGEB
- typedef union
- {
- uint16_t value;
- struct
- {
- uint16_t dc_diff : 5; //
- uint16_t dc_dth : 1; //
- uint16_t man_sel : 1; //
- uint16_t man_start : 1; //
- uint16_t tbg3_5 : 3; //
- uint16_t exdis : 1; //
- uint16_t pn_start : 1; //
- uint16_t raw_sel : 1; //
- uint16_t rev : 2; //
- }bits_w;
- }pageB_misc_cfg2_tu;
- typedef enum
- {
- GIOMD_WTR,
- GIOMD_EOAC_FSYNC,
- GIOMD_TMEO_CD,
- GIOMD_PDN_PA,
- GIOMD_TWOR,
- GIOMD_SDO,
- GIOMD_TRXD,
- GIOMD_RXD,
- GIOMD_NC1,
- GIOMD_PDNRX,
- GIOMD_NC2,
- GIOMD_VPOAK,
- GIOMD_WATCH,
- GIOMD_PDNTX,
- GIOMD_FMTDO,
- }gioModeSlt_e;
- //@GIO_PAGEA
- typedef union
- {
- uint16_t value;
- struct
- {
- uint16_t g1oe : 1; //GIO1pin output enable.
- // [0]: High Z.
- // [1]: Enable.
- uint16_t g1i : 1; //GIO1 pin output signal invert.
- // [0]: Non-inverted output.
- // [1]: Inverted output.
- uint16_t gio1s : 4; //@gioModeSlt_e, GIO1 pin function select.
- uint16_t g2oe : 1; //: GIO2 pin output enable.
- // [0]: High Z.
- // [1]: Enable.
- uint16_t g2i : 1; //GIO2 pin output signal invert.
- // [0]: Non-inverted output.
- // [1]: Inverted output.
- uint16_t gio2s : 4; //@gioModeSlt_e, GIO2 pin function select
- uint16_t ddpc : 1; //C(Direct mode data pin control): Direct mode modem data can be accessed via SDIO pin.
- // [0]: Disable.
- // [1]: Enable.
- uint16_t mcnt : 2; //Main Clock Divider.
- // [00]: fCMNT=fMSCK
- // [01]: fCMNT=fMSCK/ 2
- // [10]: fCMNT=fMSCK/ 3
- // [11]: fCMNT=fMSCK/ 4
- // Please refer to Chapter 12 for details.
- uint16_t wrcks : 1; //WOR Reference clock select.
- // [0]: WOR Ref clock when PF8M is equal or close to 6.4MHz.
- // [1]: WOR Ref clock when PF8M is equal or close to 8MHz
- }bits_w;
- }pageA_gio_tu;
- //@MODE_REG
- typedef union
- {
- uint16_t value;
- struct
- {
- uint16_t adcm : 1; //ADC measurement (Auto clear when done).
- // [0]: Disable
- // [1]: Enable.
- uint16_t fbc : 1; //IF Filter Bank calibration enable (Auto clear when done).
- // [0]: Disable .
- // [1]: Enable.
- uint16_t vbc : 1; //VCO Bank calibration enable (Auto clear when done).
- // [0]: Disable.
- // [1]: Enable.
- uint16_t trer : 1; //TRX mode enable by register. Shall be set to [1].
- // [0]: Reserved.
- // [1]: By register control (CER and TRSR). In FIFO mode, this bit will be cleared after end of packet encountered.
- uint16_t trsr : 1; //TRX Mode select by register.
- // [0]: RX mode.
- // [1]: TX mode.
- // When bit TRER=1, the chip will enter TX or RX mode by TRSR register
- uint16_t plle : 1; //PLL enable by register.
- // [0]: PLL off.
- // [1]: PLL on
- uint16_t cer : 1; //Crystal enable by register.
- // [0]: crystal turn-off.
- // [1]: crystal turn-on.
- uint16_t fms : 1; //Direct/FIFO mode select.
- // [0]: Direct mode.
- // [1]: FIFO mode.
- uint16_t fmt : 1; //Reserved for internal usage only. Shall be set to [0].
- uint16_t wwse : 1; //WOT/WOR function enable.
- // [0]: Disable.
- // [1]: Enable
- uint16_t cce : 1; //: Chip enable by register.
- // [0]: chip turn-off.
- // [1]: chip turn-on.
- uint16_t vcc : 1; //VCO current calibration.
- // [0]: Disable
- // [1]: Enable
- uint16_t rssc : 1; //RSSI Calibration.
- // [0]: Disable.
- // [1]: Enable.
- uint16_t swt : 1; //VCO Current and ADC clock and System clock select. Recommend SWT = [0].
- // [0]: Original
- // [1]: Update
- uint16_t vbs : 1; //Reserved. Should set to [0].
- uint16_t dfcd : 1; //Packet Filtering by Carrier Detect.
- // The received packet is filtered if the input power level is below RTH (0Ah).
- // [0]: Disable.
- // [1]: Enable.
- }bits_w;
- }base_modeControl_tu;
- //@TX1_PAGEA
- typedef union
- {
- uint16_t value;
- struct
- {
- uint16_t fd : 8; //TX Frequency Deviation setting.
- // For both Gaussian filter is enabled (GS =1) or disabled(GS = 0)
- uint16_t fdp : 3; // Frequency Deviation Exponential Coefficient setting.
- uint16_t gs : 1; //Gaussian Filter Selection.
- // [0]: Disable.
- // [1]: Enable.
- uint16_t tme : 1; //TX Modulation Enable.
- // [0]: Disable.
- // [1]: Enable.
- uint16_t rc_dly : 3; //RSSI calibration RL Delay setting. Recommend RC_DLY= [000].
- // [000]: 100us.
- // [001]: 300us.
- // [010]: 500us.
- // [011]: 700us.
- // [100]: 900us.
- // [101]: 1.1ms.
- // [110]: 1.3ms.
- // [111]: 1.5ms.
- }bits_w;
- }pageA_tx1_tu;
- //@FIFO_PAGEA
- typedef union
- {
- uint16_t value;
- struct
- {
- uint16_t FEP : 8; //FIFO End Pointer for TX FIFO and Rx FIFO.
- // Where FEP[7:0] are located at here and FEP[13:8] are located at 08h page 10.
- // FIFO Length Setting = (FEP [13:0] +1).
- // For example, if FEP = 0x3F, it means FIFO length is 64 bytes.
- // For FIFO extension mode, FEP’s value shall be set larger than 0x3F.
- // Please refer to section 16.4.2 for details
- uint16_t PSA : 6; //Used for Segment FIFO.
- // Used in FIFO segment mode
- uint16_t FPM : 2; //FIFO Pointer Margin.
- // FPM is used in FIFO extension mode for an indicator.
- // FPM[1:0] Bytes in TX FIFO Bytes in RX FIFO
- // [00] 4 60
- // [01] 8 56
- // [10] 12 52
- // [11] 16 48
- }bits_w;
- }pageA_fifo_tu;
- #endif
|