42 #include "ezradio_cmd.h"
43 #include "ezradio_prop.h"
46 #include "ezradio_api_lib_add.h"
52 static const uint8_t Radio_Configuration_Data_Array[] = \
53 RADIO_CONFIGURATION_DATA_ARRAY;
56 static bool ezradioIrqReceived =
false;
58 #if ( defined EZRADIO_PLUGIN_TRANSMIT )
62 #if ( defined EZRADIO_PLUGIN_RECEIVE )
66 #if ( defined EZRADIO_PLUGIN_CRC_ERROR )
70 static void ezradioPowerUp(
void);
72 static void GPIO_EZRadio_INT_IRQHandler( uint8_t pin );
88 #if ( defined EZRADIO_PLUGIN_PTI )
105 printf(
"ERROR: Radio configuration failed!\n");
107 for (wDelay = 0x7FFF; wDelay--; ) ;
128 ezradio_cmd_reply_t radioReplyData;
131 if ( radioHandle == NULL )
137 if (ezradioIrqReceived)
140 ezradioIrqReceived =
false;
145 #if ( defined EZRADIO_PLUGIN_TRANSMIT )
146 ezradioHandleTransmitPlugin( radioHandle, radioReplyHandle );
149 #if ( defined EZRADIO_PLUGIN_RECEIVE )
150 ezradioHandleReceivePlugin( radioHandle, radioReplyHandle );
153 #if ( defined EZRADIO_PLUGIN_CRC_ERROR )
154 ezradioHandleCrcErrorPlugin( radioHandle, radioReplyHandle );
167 #if ( defined EZRADIO_PLUGIN_RECEIVE )
169 #endif //#if ( defined EZRADIO_PLUGIN_RECEIVE )
171 #if ( defined EZRADIO_PLUGIN_TRANSMIT )
173 #endif //#if ( defined EZRADIO_PLUGIN_TRANSMIT )
181 static void ezradioPowerUp(
void)
189 USTIMER_Delay( RADIO_CONFIG_DATA_RADIO_DELAY_AFTER_RESET_US );
197 static void GPIO_EZRadio_INT_IRQHandler( uint8_t pin )
202 ezradioIrqReceived =
true;
void ezradioResetTRxFifo(void)
Resets both the TX and RX FIFOs.
void ezradioInit(EZRADIODRV_Handle_t handle)
Radio Initialization.
#define ECODE_EMDRV_EZRADIODRV_OK
Success return value.
void ezradio_hal_SpiInit(void)
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)
This file contains the plug-in manager for the EZRadio and EZRadioPRO chip families.
void ezradio_hal_GpioInit(GPIOINT_IrqCallbackPtr_t ezradioIrqCallback, bool enablePTI)
Ecode_t USTIMER_Init(void)
Activate and initialize the hardware timer used to pace the 1 microsecond delay functions.
This file contains EZRadio HAL.
void ezradio_fifo_info(uint8_t fifo, ezradio_cmd_reply_t *ezradioReply)
General Purpose IO (GPIO) peripheral API.
EZRADIO_ConfigRet_t ezradio_configuration_init(const uint8_t *pSetPropCmd)
Ecode_t USTIMER_DeInit(void)
Deinitialize USTIMER driver.
#define ECODE_EMDRV_EZRADIODRV_ILLEGAL_HANDLE
Illegal SPI handle.
uint32_t Ecode_t
Typedef for API function errorcode return values.
Microsecond delay function API definition.
ezradio_cmd_reply_t * EZRADIODRV_ReplyHandle_t
EZradio reply union handle.
Ecode_t USTIMER_Delay(uint32_t usec)
Delay a given number of microseconds.
Ecode_t ezradioPluginManager(EZRADIODRV_Handle_t radioHandle)
EzRadio plugin manager state machine handler. This function should be called in the application in an...