EFR32 Mighty Gecko 1 Software Documentation  efr32mg1-doc-5.1.2
ezradio_pn9_plugin.c
Go to the documentation of this file.
1 /***************************************************************************/
33 #include <stddef.h>
34 #include "em_device.h"
35 
36 #include "ezradio_cmd.h"
37 #include "ezradio_prop.h"
38 #include "ezradio_api_lib.h"
39 #include "ezradio_api_lib_add.h"
40 #include "ezradio_plugin_manager.h"
42 
43 #if defined( EZRADIO_PLUGIN_PN9 )
44 
45 /**************************************************************************/
57 {
58  ezradio_cmd_reply_t ezradioReply;
59 
60  if ( radioHandle == NULL )
61  {
63  }
64 
65  /* Request and check radio device state */
66  ezradio_request_device_state(&ezradioReply);
67 
68  if (ezradioReply.REQUEST_DEVICE_STATE.CURR_STATE == EZRADIO_CMD_REQUEST_DEVICE_STATE_REP_CURR_STATE_MAIN_STATE_ENUM_TX) {
70  }
71 
72  /* Read ITs, clear pending ones */
73  ezradio_get_int_status(0u, 0u, 0u, NULL);
74 
75  /* Start sending packet, channel 0, START immediately, Packet n bytes long, go READY when done */
76  ezradio_start_tx(radioHandle->pn9.channel, 0u, 0u);
77 
79 }
80 
81 /**************************************************************************/
89 {
90  ezradio_change_state(EZRADIO_CMD_CHANGE_STATE_ARG_NEXT_STATE1_NEW_STATE_ENUM_READY);
91 
93 }
94 
95 #endif //#if defined( EZRADIO_PLUGIN_PN9 )
#define ECODE_EMDRV_EZRADIODRV_TRANSMIT_FAILED
Unable to start transmission.
#define ECODE_EMDRV_EZRADIODRV_OK
Success return value.
void ezradio_change_state(uint8_t next_state1)
This file contains the common API library of the EZRadio and EZRadioPRO families. ...
void ezradio_start_tx(uint8_t channel, uint8_t condition, uint16_t tx_len)
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.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
Ecode_t ezradioStopPn9(void)
Stops PN9 carrier transmission.
EzRadio transmit plug-in managed by the plug-in manager if enabled.
EZRADIODRV_Pn9Handle_t pn9
PN9 plug-in handler.
uint8_t channel
PN9 transmit channel.
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.
void ezradio_request_device_state(ezradio_cmd_reply_t *ezradioReply)
Ecode_t ezradioStartPn9(EZRADIODRV_Handle_t radioHandle)
Starts PN9 transmission with the radio configurations from the radioHandle parameter.