ADF7030-1 Device Drivers API Reference Manual  Alpha 0.0.1
Device Drivers for ADF7030-1 Transceiver
adf7030-1__state.h
1 #ifndef _ADF7030_1__STATE_H_
2 #define _ADF7030_1__STATE_H_
3 
4 #include <drivers/spi/adi_spi.h>
5 #include <devices/rf/adf703x/adi_adf7030-1_reg.h>
6 
16 typedef enum {
17  PHY_SLEEP = 0x00,
18  PHY_OFF = 0x01,
19  PHY_ON = 0x02,
20  PHY_RX = 0x03,
21  PHY_TX = 0x04,
22  DO_CFG_DEV = 0x05,
23  PHY_CCA = 0x06,
24  PHY_PATCH = 0x07,
25  DO_IRCAL = 0x08,
26  DO_CAL = 0x09,
27  DO_TEMP_MEAS = 0x0A,
28  DO_XTAL_TCAL = 0x0B,
29  DO_LFRC_CAL = 0x0C,
30 
32 //Debug states
33  DO_ROMCRC_CONTINUOUS = 0x0D,
34  DO_RAMCRC_CONTINUOUS = 0x0E,
35  DO_MCRCRC_CONTINUOUS = 0x0F,
36  DO_NOP_FOREVER = 0x10,
37  DO_SNOOP_TESTMODES_LOOPBACK = 0x11,
38  D0_ROMCRC_SOFT_CONTINUOUS = 0x12,
39  D0_RAMCRC_SOFT_CONTINUOUS = 0x13,
40  D0_MCRCRC_SOFT_CONTINUOUS = 0x14,
41  D0_CAPTURE_RX_CONTINUOUS = 0x15,
42  DO_ANC_PLL_CAL = 0x16,
43  DO_ADC_NOTCH_CAL = 0x17,
44  DO_OCL_CAL = 0x18,
45  DO_FILT_CAL = 0x19,
46  DO_VCO_KV_CAL = 0x1A,
47  DO_HFRC_OFF = 0x1D,
48  DO_ANC_PLL_ON = 0x1E,
49  DO_PHY_ERROR_HANDLER = 0x1F
52 
54 typedef enum {
55  RADIO_CMD = (0x1 << 7),
56  SPECIAL_CMD = (0x1 << 6),
58 
59 
60 #define TRANSITION_STATUS_TRANSITION 0
61 #define TRANSITION_STATUS_EXECUTING 1
62 #define TRANSITION_STATUS_IDLE 2
63 
64 
66 /* state machine radio commands */
67 #define CMD_PHY_SLEEP RADIO_COMMAND | FW_STATE_PHY_SLEEP //Performs a transition of the device into the PHY_SLEEP state
68 #define CMD_PHY_OFF RADIO_COMMAND | FW_STATE_PHY_OFF //Performs a transition of the device into the PHY_OFF state
69 #define CMD_PHY_ON RADIO_COMMAND | FW_STATE_PHY_ON //Performs a transition of the device into the PHY_ON state
70 #define CMD_PHY_RX RADIO_COMMAND | FW_STATE_PHY_RX //Performs a transition of the device into the PHY_RX state
71 #define CMD_PHY_TX RADIO_COMMAND | FW_STATE_PHY_TX //Performs a transition of the device into the PHY_TX state
72 #define CMD_CONFIG_DEV RADIO_COMMAND | FW_STATE_CONFIG_DEV //Configures the ADF703x based on the Radio Profile
73 #define CMD_GET_RSSI RADIO_COMMAND | FW_STATE_GET_RSSI //Performs an RSSI measurement
74 #define CMD_PHY_PATCH RADIO_COMMAND | FW_STATE_PHY_PATCH //Prepares the program RAM for a firmware module download
75 #define CMD_DO_CAL RADIO_COMMAND | FW_STATE_DO_CAL //Executes selected calibration routines
76 #define CMD_NOP 0xFF
77 #define CMD_RESET 0xC7
78 
79 /* special radio commands */
80 #define CMD_RAM_LOAD_DONE RADIO_COMMAND | SPCNTRN | 0x08 //Configures the ADF703x to use a downloaded patch by restarting the ADF703x
81 #define CMD_IRQ1_DIS_IRQ0_DIS RADIO_COMMAND | SPCNTRN | 0x0C //Disable IRQ_IN0 and IRQ_IN1 in triggering preloaded radio commands
82 #define CMD_IRQ1_DIS_IRQ0_EN RADIO_COMMAND | SPCNTRN | 0x0D //Disable IRQ_IN1 and enable IRQ_IN0 in triggering preloaded radio commands
83 #define CMD_IRQ1_EN_IRQ0_DIS RADIO_COMMAND | SPCNTRN | 0x0E //Enable IRQ_IN1 and disable IRQ_IN0 in triggering preloaded radio commands
84 #define CMD_IRQ1_EN_IRQ0_EN RADIO_COMMAND | SPCNTRN | 0x0F //Enable IRQ_IN1 and IRQ_IN0 in triggering preloaded radio commands
85 
86 /*status */
87 #define STATUS_SPI_READY(x) (x & (0x1 << 7))
88 #define STATUS_IRQ_STATUS(x) (x & (0x1 << 6))
89 #define STATUS_CMD_READY(x) (x & (0x1 << 5))
90 #define STATUS_ERR(x) (x & (0x1 << 3))
91 #define STATUS_TRANSITION_STATUS(x) ((x & 0x6) >> 1)
92 
93 
94 
97 /* Transfers Radio PHY Command */
98 uint32_t adf7030_1__XferCmd(
99  ADI_SPI_HANDLE hSPIDevice,
101 );
102 
103 
104  /* End of group adf7030-1__state PHY State Machine Interface */ /* End of group adf7030-1 adf7030-1 Driver */
107 
108 #endif /* _ADF7030_1__PATCH_H_ */
uint32_t adf7030_1__XferCmd(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_STATE PHY_CMD)
Generic Radio PHY Command Transfers.
ADI_ADF7030_1_RADIO_STATE
ADI_ADF7030_1_RADIO_CMD_TYPE