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++;
76 if ( EZRADIO_CMD_ID_EZCONFIG_ARRAY_WRITE == *pSetPropCmd )
78 if (numOfBytes > 128u)
89 pSetPropCmd += numOfBytes - 1;
102 for (col = 0u; col < numOfBytes; col++)
104 ezradioCmd[col] = *pSetPropCmd;
115 if ( EZRADIO_CMD_ID_EZCONFIG_CHECK == ezradioCmd[0] )
117 if (EZRADIO_CMD_EZCONFIG_CHECK_REP_RESULT_RESULT_ENUM_BAD_CHECKSUM == ezradioReply.EZCONFIG_CHECK.RESULT)
121 else if (EZRADIO_CMD_EZCONFIG_CHECK_REP_RESULT_RESULT_ENUM_INVALID_STATE == ezradioReply.EZCONFIG_CHECK.RESULT)
131 if (ezradioReply.GET_INT_STATUS.CHIP_PEND & EZRADIO_CMD_GET_CHIP_STATUS_REP_CHIP_PEND_CMD_ERROR_PEND_MASK)
162 uint8_t ezradioCmd[3u];
164 ezradioCmd[0] = EZRADIO_CMD_ID_EZCONFIG_CHECK;
165 ezradioCmd[1] = (uint8_t) (checksum >> 8u);
166 ezradioCmd[2] = (uint8_t) (checksum & 0x00FF);
173 EZRADIO_CMD_REPLY_COUNT_EZCONFIG_CHECK,
176 if (ezradioReply != NULL)
178 ezradioReply->EZCONFIG_CHECK.RESULT = ezradioCmd[0];
182 #ifdef EZRADIO_DRIVER_EXTENDED_SUPPORT
185 #ifdef EZRADIO_DRIVER_FULL_SUPPORT
198 uint8_t ezradioCmd[EZRADIO_CMD_REPLY_COUNT_GET_ADC_READING];
200 ezradioCmd[0] = EZRADIO_CMD_ID_GET_ADC_READING;
201 ezradioCmd[1] = adc_en;
202 ezradioCmd[2] = adc_cfg;
206 EZRADIO_CMD_REPLY_COUNT_GET_ADC_READING,
209 if (ezradioReply != NULL)
211 ezradioReply->GET_ADC_READING.GPIO_ADC = ((uint16_t)ezradioCmd[0] << 8) & 0xFF00;
212 ezradioReply->GET_ADC_READING.GPIO_ADC |= (uint16_t)ezradioCmd[1] & 0x00FF;
213 ezradioReply->GET_ADC_READING.BATTERY_ADC = ((uint16_t)ezradioCmd[2] << 8) & 0xFF00;
214 ezradioReply->GET_ADC_READING.BATTERY_ADC |= (uint16_t)ezradioCmd[3] & 0x00FF;
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_write_ezconfig_array(uint8_t numBytes, uint8_t *pEzConfigArray)
This file contains EZRadio HAL.
void ezradio_ezconfig_check(uint16_t checksum, ezradio_cmd_reply_t *ezradioReply)
General Purpose IO (GPIO) peripheral API.
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_comm_WriteData(uint8_t cmd, uint8_t pollCts, uint8_t byteCount, uint8_t *pData)
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.
uint8_t ezradio_comm_CtsWentHigh