40 #include "ezradio_cmd.h"
41 #include "ezradio_prop.h"
45 #include "ezradio_api_lib_add.h"
56 uint8_t ezradioCmd[16u];
57 ezradio_cmd_reply_t ezradioReply;
64 while (*pSetPropCmd != 0x00)
71 numOfBytes = *pSetPropCmd++;
79 for (col = 0u; col < numOfBytes; col++)
81 ezradioCmd[col] = *pSetPropCmd;
95 if (ezradioReply.GET_INT_STATUS.CHIP_PEND & EZRADIO_CMD_GET_CHIP_STATUS_REP_CHIP_PEND_CMD_ERROR_PEND_MASK)
105 #ifdef EZRADIO_DRIVER_EXTENDED_SUPPORT
108 #ifdef EZRADIO_DRIVER_FULL_SUPPORT
121 uint8_t ezradioCmd[EZRADIO_CMD_REPLY_COUNT_GET_ADC_READING];
123 ezradioCmd[0] = EZRADIO_CMD_ID_GET_ADC_READING;
124 ezradioCmd[1] = adc_en;
125 ezradioCmd[2] = adc_cfg;
129 EZRADIO_CMD_REPLY_COUNT_GET_ADC_READING,
132 if (ezradioReply != NULL)
134 ezradioReply->GET_ADC_READING.GPIO_ADC = ((uint16_t)ezradioCmd[0] << 8) & 0xFF00;
135 ezradioReply->GET_ADC_READING.GPIO_ADC |= (uint16_t)ezradioCmd[1] & 0x00FF;
136 ezradioReply->GET_ADC_READING.BATTERY_ADC = ((uint16_t)ezradioCmd[2] << 8) & 0xFF00;
137 ezradioReply->GET_ADC_READING.BATTERY_ADC |= (uint16_t)ezradioCmd[3] & 0x00FF;
138 ezradioReply->GET_ADC_READING.TEMP_ADC = ((uint16_t)ezradioCmd[4] << 8) & 0xFF00;
139 ezradioReply->GET_ADC_READING.TEMP_ADC |= (uint16_t)ezradioCmd[5] & 0x00FF;
151 void ezradio_ircal(uint8_t searching_step_size, uint8_t searching_rssi_avg, uint8_t rx_chain_setting1, uint8_t rx_chain_setting2)
154 uint8_t ezradioCmd[5u];
156 ezradioCmd[0] = EZRADIO_CMD_ID_IRCAL;
157 ezradioCmd[1] = searching_step_size;
158 ezradioCmd[2] = searching_rssi_avg;
159 ezradioCmd[3] = rx_chain_setting1;
160 ezradioCmd[4] = rx_chain_setting2;
175 uint8_t ezradioCmd[EZRADIO_CMD_ARG_COUNT_IRCAL_MANUAL];
177 ezradioCmd[0] = EZRADIO_CMD_ID_IRCAL_MANUAL;
178 ezradioCmd[1] = ircal_amp;
179 ezradioCmd[2] = ircal_ph;
183 EZRADIO_CMD_REPLY_COUNT_IRCAL_MANUAL,
186 if (ezradioReply != NULL)
188 ezradioReply->IRCAL_MANUAL.IRCAL_AMP_REPLY = ezradioCmd[0];
189 ezradioReply->IRCAL_MANUAL.IRCAL_PH_REPLY = ezradioCmd[1];
205 void ezradio_tx_hop(uint8_t inte, uint8_t frac2, uint8_t frac1, uint8_t frac0, uint8_t vco_cnt1, uint8_t vco_cnt0, uint8_t pll_settle_time1, uint8_t pll_settle_time0)
208 uint8_t ezradioCmd[9u];
210 ezradioCmd[0] = EZRADIO_CMD_ID_TX_HOP;
211 ezradioCmd[1] = inte;
212 ezradioCmd[2] = frac2;
213 ezradioCmd[3] = frac1;
214 ezradioCmd[4] = frac0;
215 ezradioCmd[5] = vco_cnt1;
216 ezradioCmd[6] = vco_cnt0;
217 ezradioCmd[7] = pll_settle_time1;
218 ezradioCmd[8] = pll_settle_time0;
233 void ezradio_rx_hop(uint8_t inte, uint8_t frac2, uint8_t frac1, uint8_t frac0, uint8_t vco_cnt1, uint8_t vco_cnt0)
236 uint8_t ezradioCmd[7u];
238 ezradioCmd[0] = EZRADIO_CMD_ID_RX_HOP;
239 ezradioCmd[1] = inte;
240 ezradioCmd[2] = frac2;
241 ezradioCmd[3] = frac1;
242 ezradioCmd[4] = frac0;
243 ezradioCmd[5] = vco_cnt1;
244 ezradioCmd[6] = vco_cnt0;
This file contains the common API library of the EZRadio and EZRadioPRO families. ...
void ezradio_get_int_status(uint8_t ph_clr_pend, uint8_t modem_clr_pend, uint8_t chip_clr_pend, ezradio_cmd_reply_t *ezradioReply)
void ezradio_ircal_manual(uint8_t ircal_amp, uint8_t ircal_ph, ezradio_cmd_reply_t *ezradioReply)
This file contains EZRadio HAL.
General Purpose IO (GPIO) peripheral API.
void ezradio_tx_hop(uint8_t inte, uint8_t frac2, uint8_t frac1, uint8_t frac0, uint8_t vco_cnt1, uint8_t vco_cnt0, uint8_t pll_settle_time1, uint8_t pll_settle_time0)
EZRADIO_ConfigRet_t ezradio_configuration_init(const uint8_t *pSetPropCmd)
uint8_t ezradio_comm_SendCmdGetResp(uint8_t cmdByteCount, uint8_t *pCmdData, uint8_t respByteCount, uint8_t *pRespData)
void ezradio_ircal(uint8_t searching_step_size, uint8_t searching_rssi_avg, uint8_t rx_chain_setting1, uint8_t rx_chain_setting2)
void ezradio_rx_hop(uint8_t inte, uint8_t frac2, uint8_t frac1, uint8_t frac0, uint8_t vco_cnt1, uint8_t vco_cnt0)
uint8_t ezradio_hal_NirqLevel(void)
void ezradio_get_adc_reading(uint8_t adc_en, uint8_t adc_cfg, ezradio_cmd_reply_t *ezradioReply)
This file contains the EZRadio communication layer.
void ezradio_comm_SendCmd(uint8_t byteCount, uint8_t *pData)