34 #ifndef EZRADIO_PLUGIN_MANAGER_H_
35 #define EZRADIO_PLUGIN_MANAGER_H_
40 #include "app-config.h"
48 #define RADIO_CHIP_FAMILY_EZRADIO 1u
49 #define RADIO_CHIP_FAMILY_EZRADIOPRO 2u
72 #if defined(RADIO_USE_GENERATED_CONFIGURATION) && (RADIO_USE_GENERATED_CONFIGURATION == 1)
74 #include "radio-config-wds-gen.h"
77 #if defined(SL_WSTK6200A) || defined(SL_WSTK6220A)
78 #include "radio-config-wds-gen_R60-868MHz-13dBm.h"
79 #elif defined(SL_WSTK6240A)
80 #include "radio-config-wds-gen_R68-868MHz-16dBm.h"
81 #elif defined(SL_WSTK6201A) || defined(SL_WSTK6221A) || defined(SL_WSTK6241A)
82 #include "radio-config-wds-gen_R55-434MHz-10dBm.h"
83 #elif defined(SL_WSTK6202A) || defined(SL_WSTK6222A)
84 #include "radio-config-wds-gen_R63-915MHz-20dBm.h"
85 #elif defined(SL_WSTK6242A)
86 #include "radio-config-wds-gen_R68-915MHz-20dBm.h"
87 #elif defined(SL_WSTK6223A) || defined(SL_WSTK6243A)
88 #include "radio-config-wds-gen_R63-490MHz-20dBm.h"
89 #elif defined(SL_WSTK6224A) || defined(SL_WSTK6244A)
90 #include "radio-config-wds-gen_R63-169MHz-20dBm.h"
92 #error No radio configuration is defined! Create your own radio configuration or define your kit properly!
121 #define ECODE_EMDRV_EZRADIODRV_OK ( ECODE_OK )
122 #define ECODE_EMDRV_EZRADIODRV_ILLEGAL_HANDLE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000001 )
124 #define ECODE_EMDRV_EZRADIODRV_TRANSMIT_PLUGIN_BASE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000100 )
125 #define ECODE_EMDRV_EZRADIODRV_RECEIVE_PLUGIN_BASE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000200 )
126 #define ECODE_EMDRV_EZRADIODRV_CRC_ERROR_PLUGIN_BASE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000300 )
127 #define ECODE_EMDRV_EZRADIODRV_AUTO_ACK_PLUGIN_BASE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000400 )
128 #define ECODE_EMDRV_EZRADIODRV_UNMOD_CARRIER_PLUGIN_BASE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000500 )
129 #define ECODE_EMDRV_EZRADIODRV_PN9_PLUGIN_BASE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000600 )
130 #define ECODE_EMDRV_EZRADIODRV_DIRECT_TRANSMIT_PLUGIN_BASE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000700 )
131 #define ECODE_EMDRV_EZRADIODRV_DIRECT_RECEIVE_PLUGIN_BASE ( ECODE_EMDRV_EZRADIODRV_BASE | 0x00000800 )
134 #if !defined(RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY)
135 #error RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY is not defined!
136 #elif ( !(RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIO) && !(RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO) )
137 #error RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY is not defined properly!
141 #if defined(EZRADIO_PLUGIN_TRANSMIT) || defined(EZRADIO_PLUGIN_RECEIVE)
143 #if (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIO)
144 #define RADIO_CONFIG_DATA_FIELD_LENGTH \
146 RADIO_CONFIG_DATA_FIELD1_LENGTH, \
152 #elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
153 #define RADIO_CONFIG_DATA_FIELD_LENGTH \
155 RADIO_CONFIG_DATA_FIELD1_LENGTH, \
156 RADIO_CONFIG_DATA_FIELD2_LENGTH, \
157 RADIO_CONFIG_DATA_FIELD3_LENGTH, \
158 RADIO_CONFIG_DATA_FIELD4_LENGTH, \
159 RADIO_CONFIG_DATA_FIELD5_LENGTH \
164 #if (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIO)
165 #define RADIO_CONFIG_DATA_MAX_PACKET_LENGTH RADIO_CONFIG_DATA_FIELD1_LENGTH
166 #elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
167 #define RADIO_CONFIG_DATA_MAX_PACKET_LENGTH \
168 RADIO_CONFIG_DATA_FIELD1_LENGTH + \
169 RADIO_CONFIG_DATA_FIELD2_LENGTH + \
170 RADIO_CONFIG_DATA_FIELD3_LENGTH + \
171 RADIO_CONFIG_DATA_FIELD4_LENGTH + \
172 RADIO_CONFIG_DATA_FIELD5_LENGTH
174 #endif //#if ( defined( EZRADIO_PLUGIN_TRANSMIT ) || defined( EZRADIO_PLUGIN_RECEIVE ) )
177 #if ( defined(RADIO_CONFIGURATION_DATA_PKT_VARIABLE_PACKET_LENGTH_ENABLE ) && (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_PACKET_LENGTH_ENABLE > 0) )
179 #if (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIO)
180 #if ( !defined(RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD ) || !(RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD == 1))
181 #error RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD is not defined properly!
183 #elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
184 #if ( !defined(RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD ) || (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD < 2) || (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD > 5) )
185 #error RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD is not defined properly!
189 #if !defined(RADIO_CONFIGURATION_DATA_PH_FIELD_SPLIT) || (RADIO_CONFIGURATION_DATA_PH_FIELD_SPLIT == FALSE)
190 #error EzRadio plugin manager can only support variable packet configuration for split packets curently!
193 #if defined(RADIO_CONFIGURATION_DATA_PKT_LEN_ADD_TO_RX_FIFO) && (RADIO_CONFIGURATION_DATA_PKT_LEN_ADD_TO_RX_FIFO > 0)
195 #if (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIO)
196 #if !defined(RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH ) || !(RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH == 1)
197 #error RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH is not defined properly!
199 #elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
200 #if !defined(RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH ) || (RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH < 1) || (RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH > 4)
201 #error RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH is not defined properly!
205 #if (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIO)
206 #if !defined(RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE ) || !(RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE == 1)
207 #error RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE is not defined properly!
209 #elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
210 #if !defined(RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE ) || (RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE < 1) || (RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE > 2)
211 #error RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE is not defined properly!
215 #if (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIO)
216 #define EZRADIO_LENGTH_WORD_START 0u
218 #elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
219 #if (RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH == 1)
220 #define EZRADIO_LENGTH_WORD_START 0u
222 #elif (RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH == 2)
223 #define EZRADIO_LENGTH_WORD_START RADIO_CONFIG_DATA_FIELD1_LENGTH
225 #elif (RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH == 3)
226 #define EZRADIO_LENGTH_WORD_START (RADIO_CONFIG_DATA_FIELD1_LENGTH + RADIO_CONFIG_DATA_FIELD2_LENGTH)
228 #elif (RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH == 4)
229 #define EZRADIO_LENGTH_WORD_START (RADIO_CONFIG_DATA_FIELD1_LENGTH + RADIO_CONFIG_DATA_FIELD2_LENGTH + RADIO_CONFIG_DATA_FIELD3_LENGTH)
231 #endif // RADIO_CONFIGURATION_DATA_PKT_FIELD_CONTAINING_LENGTH
232 #endif //#elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
234 #else //#if defined(RADIO_CONFIGURATION_DATA_PKT_LEN_ADD_TO_RX_FIFO) && (RADIO_CONFIGURATION_DATA_PKT_LEN_ADD_TO_RX_FIFO > 0)
235 #undef RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE
236 #define RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE 0u
237 #endif //#if defined(RADIO_CONFIGURATION_DATA_PKT_LEN_ADD_TO_RX_FIFO) && (RADIO_CONFIGURATION_DATA_PKT_LEN_ADD_TO_RX_FIFO > 0)
239 #if (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIO)
240 #define EZRADIO_VARIABLE_DATA_START RADIO_CONFIGURATION_DATA_PKT_LENGTH_SIZE
242 #elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
243 #if (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD == 2)
244 #define EZRADIO_VARIABLE_DATA_START RADIO_CONFIG_DATA_FIELD1_LENGTH
246 #elif (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD == 3)
247 #define EZRADIO_VARIABLE_DATA_START (RADIO_CONFIG_DATA_FIELD1_LENGTH + RADIO_CONFIG_DATA_FIELD2_LENGTH)
249 #elif (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD == 4)
250 #define EZRADIO_VARIABLE_DATA_START (RADIO_CONFIG_DATA_FIELD1_LENGTH + RADIO_CONFIG_DATA_FIELD2_LENGTH + RADIO_CONFIG_DATA_FIELD3_LENGTH)
252 #elif (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD == 5)
253 #define EZRADIO_VARIABLE_DATA_START (RADIO_CONFIG_DATA_FIELD1_LENGTH + RADIO_CONFIG_DATA_FIELD2_LENGTH + RADIO_CONFIG_DATA_FIELD3_LENGTH + RADIO_CONFIG_DATA_FIELD4_LENGTH)
255 #endif // RADIO_CONFIGURATION_DATA_PKT_VARIABLE_LENGTH_FIELD
256 #endif //#elif (RADIO_CONFIGURATION_DATA_RADIO_CHIP_FAMILY == RADIO_CHIP_FAMILY_EZRADIOPRO)
258 #else //#if defined(RADIO_CONFIGURATION_DATA_PKT_VARIABLE_PACKET_LENGTH_ENABLE ) && (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_PACKET_LENGTH_ENABLE > 0)
261 #endif //#if defined(RADIO_CONFIGURATION_DATA_PKT_VARIABLE_PACKET_LENGTH_ENABLE ) && (RADIO_CONFIGURATION_DATA_PKT_VARIABLE_PACKET_LENGTH_ENABLE > 0)
308 #if defined(EZRADIO_PLUGIN_TRANSMIT)
312 #if defined(EZRADIO_PLUGIN_RECEIVE)
316 #if defined(EZRADIO_PLUGIN_CRC_ERROR)
320 #if defined(EZRADIO_PLUGIN_AUTO_ACK) && defined(EZRADIO_PLUGIN_TRANSMIT) && defined(EZRADIO_PLUGIN_RECEIVE)
324 #if defined(EZRADIO_PLUGIN_UNMOD_CARRIER)
328 #if defined(EZRADIO_PLUGIN_PN9)
332 #if defined(EZRADIO_PLUGIN_DIRECT_TRANSMIT)
336 #if defined(EZRADIO_PLUGIN_DIRECT_RECEIVE)
344 #define EZRADIODRV_INIT_DEFAULT \
346 EZRADIODRV_TRANSMIT_PLUGIN_INIT_DEFAULT \
347 EZRADIODRV_RECEIVE_PLUGIN_INIT_DEFAULT \
348 EZRADIODRV_CRC_ERROR_PLUGIN_INIT_DEFAULT \
349 EZRADIODRV_AUTO_ACK_PLUGIN_INIT_DEFAULT \
350 EZRADIODRV_UNMOD_CARRIER_PLUGIN_INIT_DEFAULT \
351 EZRADIODRV_PN9_PLUGIN_INIT_DEFAULT \
352 EZRADIODRV_DIRECT_TRANSMIT_PLUGIN_INIT_DEFAULT \
353 EZRADIODRV_DIRECT_RECEIVE_PLUGIN_INIT_DEFAULT \
void ezradioResetTRxFifo(void)
Resets both the TX and RX FIFOs.
void ezradioInit(EZRADIODRV_Handle_t handle)
Radio Initialization.
EZRADIODRV_PacketTxHandle_t packetTx
Packet transmission plug-in handler.
EzRadio transmit plug-in managed by the plug-in manager if enabled.
EzRadio auto acknowledge plug-in managed by the plug-in manager if enabled.
EZRADIODRV_PacketCrcErrorHandle_t packetCrcError
Packet reception with CRC error plug-in handler.
EZRADIODRV_UnmodCarrierHandle_t unmodCarrier
Unmodulated carrier plug-in handler.
Energy Aware drivers error code definitions.
EzRadio direct transmission plug-in managed by the plug-in manager if enabled.
EzRadio transmit plug-in managed by the plug-in manager if enabled.
EzRadio PN9 plug-in instance initialization and handler structure.
EZRADIODRV_AutoAckHandle_t autoAck
Auto-acknowledge plug-in handler.
EZRADIODRV_DirectRxHandle_t directRx
Direct reception plug-in handler.
EZRADIODRV_Pn9Handle_t pn9
PN9 plug-in handler.
EZRADIODRV_HandleData_t * EZRADIODRV_Handle_t
EZRadio driver instance handle.
EzRadio PN9 plug-in managed by the plug-in manager if enabled.
uint32_t Ecode_t
Typedef for API function error code return values.
EzRadio transmit plug-in instance initialization and handler structure.
EzRadio CRC error packet receive plug-in instance initialization and handler structure.
void(* EZRADIODRV_Callback_t)(EZRADIODRV_Handle_t handle, Ecode_t status)
EZRADIODRV feature callback function interface.
EZRADIODRV_DirectTxHandle_t directTx
Direct transmission plug-in handler.
EZRADIODRV_PacketRxHandle_t packetRx
Packet reception plug-in handler.
EzRadio auto acknowledge plug-in instance initialization and handler structure.
EzRadio receive plug-in instance initialization and handler structure.
EzRadio direct rx plug-in instance initialization and handler structure.
EzRadio unmodulated carrier plug-in instance initialization and handler structure.
EzRadio direct reception plug-in managed by the plug-in manager if enabled.
EzRadio direct tx plug-in instance initialization and handler structure.
ezradio_cmd_reply_t * EZRADIODRV_ReplyHandle_t
EZradio reply union handle.
EzRadio unmodulated carrier plug-in managed by the plug-in manager if enabled.
EzRadio CRC error plug-in managed by the plug-in manager if enabled.
Ecode_t ezradioPluginManager(EZRADIODRV_Handle_t handle)
EzRadio plugin manager state machine handler. This function should be called in the application in an...