EFM32 Jade Gecko 12 Software Documentation  efm32jg12-doc-5.1.2
ezradio_crcerror_plugin.c
Go to the documentation of this file.
1 /***************************************************************************/
34 #include <stddef.h>
35 #include "em_device.h"
36 
37 #include "ezradio_cmd.h"
38 #include "ezradio_prop.h"
39 #include "ezradio_api_lib.h"
40 #include "ezradio_api_lib_add.h"
41 #include "ezradio_plugin_manager.h"
42 #include "ezradio_receive_plugin.h"
43 
44 #if defined( EZRADIO_PLUGIN_CRC_ERROR )
45 
47 // Note: These are internal routines used by ezradio plugin manager.
48 
49 /**************************************************************************/
59 Ecode_t ezradioHandleCrcErrorPlugin( EZRADIODRV_Handle_t radioHandle, EZRADIODRV_ReplyHandle_t radioReplyHandle )
60 {
61  if ( radioHandle == NULL )
62  {
64  }
65 
66  /* Check if CRC IT is received */
67  if ( radioReplyHandle->GET_INT_STATUS.PH_PEND & EZRADIO_CMD_GET_INT_STATUS_REP_PH_PEND_CRC_ERROR_PEND_BIT)
68  {
69  /* Reset FIFO */
70  ezradio_change_state(EZRADIO_CMD_CHANGE_STATE_ARG_NEXT_STATE1_NEW_STATE_ENUM_READY);
71  ezradio_fifo_info(EZRADIO_CMD_FIFO_INFO_ARG_FIFO_RX_BIT, NULL);
72 
73  if ( radioHandle->packetCrcError.userCallback != NULL )
74  {
75  radioHandle->packetCrcError.userCallback( radioHandle, ECODE_EMDRV_EZRADIODRV_OK );
76  }
77  }
78 
80 }
81 
83 
84 #endif //#if defined( EZRADIO_PLUGIN_CRC_ERROR )
EzRadio transmit plug-in managed by the plug-in manager if enabled.
EZRADIODRV_PacketCrcErrorHandle_t packetCrcError
Packet reception with CRC error plug-in handler.
#define ECODE_EMDRV_EZRADIODRV_OK
Success return value.
void ezradio_change_state(uint8_t next_state1)
EZRADIODRV_Callback_t userCallback
User callback.
This file contains the common API library of the EZRadio and EZRadioPRO families. ...
This file contains the plug-in manager for the EZRadio and EZRadioPRO chip families.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
void ezradio_fifo_info(uint8_t fifo, ezradio_cmd_reply_t *ezradioReply)
uint32_t Ecode_t
Typedef for API function error code return values.
Definition: ecode.h:51
#define ECODE_EMDRV_EZRADIODRV_ILLEGAL_HANDLE
Illegal SPI handle.
ezradio_cmd_reply_t * EZRADIODRV_ReplyHandle_t
EZradio reply union handle.