TI-OpenThread  1.05.00.20
Macros | Functions | Variables
CC1352P_2_LAUNCHXL/thread/cli_mtd/platform/radio.c File Reference
#include <openthread/config.h>
#include "radio.h"
#include <stddef.h>
#include <openthread/diag.h>
#include <openthread/platform/alarm-milli.h>
#include <openthread/platform/diag.h>
#include <openthread/platform/radio.h>
#include <openthread/platform/entropy.h>
#include <utils/code_utils.h>
#include <ti/devices/DeviceFamily.h>
#include <DeviceFamily_constructPath(driverlib/aon_rtc.h)>
#include <DeviceFamily_constructPath(driverlib/rf_data_entry.h)>
#include <DeviceFamily_constructPath(driverlib/rf_common_cmd.h)>
#include <DeviceFamily_constructPath(driverlib/rf_mailbox.h)>
#include <DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h)>
#include <DeviceFamily_constructPath(driverlib/rf_ieee_mailbox.h)>
#include <DeviceFamily_constructPath(inc/hw_ccfg.h)>
#include <DeviceFamily_constructPath(inc/hw_fcfg1.h)>
#include <ti/drivers/rf/RF.h>
#include <ti_radio_config.h>
#include "system.h"
#include "ti_drivers_config.h"
+ Include dependency graph for CC1352P_2_LAUNCHXL/thread/cli_mtd/platform/radio.c:

Macros

#define PLATFORM_RADIO_TX_TEST_MODULATED_WORD   0xAAAA
 
#define PLATFORM_RADIO_TX_TEST_SYNC_WORD   0x71764129
 
#define PLATFORM_RADIO_TX_TEST_UNMODULATED_WORD   0xFFFF
 
#define RF_NUM_RAT_TICKS_IN_1_US   4
 

Functions

static otRadioFrame * ackSearchRxQueue (struct rx_queue_info *rqi, unsigned int events, uint8_t ackDsn)
 
static void clearRxQueue (void)
 
static otRadioFrame * handleRxAckFinish (struct rx_queue_info *p, uint8_t ackDsn)
 
static void handleRxDataFinish (struct rx_queue_info *p)
 
static unsigned int handleTxAck (RF_Handle aRfHandle)
 handle end of tx when an ACK is requested More...
 
static void handleTxState (otInstance *aInstance, unsigned int events)
 
static void nextQueueEntry (struct rx_queue_info *p)
 
otError otPlatDiagRadioToneStart (otInstance *aInstance, bool aModulated)
 
otError otPlatDiagRadioToneStop (otInstance *aInstance)
 
otError otPlatRadioAddSrcMatchExtEntry (otInstance *aInstance, const otExtAddress *aExtAddress)
 
otError otPlatRadioAddSrcMatchShortEntry (otInstance *aInstance, const uint16_t aShortAddress)
 
void otPlatRadioClearSrcMatchExtEntries (otInstance *aInstance)
 
otError otPlatRadioClearSrcMatchExtEntry (otInstance *aInstance, const otExtAddress *aExtAddress)
 
void otPlatRadioClearSrcMatchShortEntries (otInstance *aInstance)
 
otError otPlatRadioClearSrcMatchShortEntry (otInstance *aInstance, const uint16_t aShortAddress)
 
otError otPlatRadioDisable (otInstance *aInstance)
 
otError otPlatRadioEnable (otInstance *aInstance)
 
void otPlatRadioEnableSrcMatch (otInstance *aInstance, bool aEnable)
 
otError otPlatRadioEnergyScan (otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
 
otRadioCaps otPlatRadioGetCaps (otInstance *aInstance)
 
void otPlatRadioGetIeeeEui64 (otInstance *aInstance, uint8_t *aIeeeEui64)
 
bool otPlatRadioGetPromiscuous (otInstance *aInstance)
 
int8_t otPlatRadioGetReceiveSensitivity (otInstance *aInstance)
 Get the receive command's sensitivity. More...
 
int8_t otPlatRadioGetRssi (otInstance *aInstance)
 
otRadioFrame * otPlatRadioGetTransmitBuffer (otInstance *aInstance)
 
otError otPlatRadioGetTransmitPower (otInstance *aInstance, int8_t *aPower)
 
bool otPlatRadioIsEnabled (otInstance *aInstance)
 
otError otPlatRadioReceive (otInstance *aInstance, uint8_t aChannel)
 
void otPlatRadioSetExtendedAddress (otInstance *aInstance, const otExtAddress *aAddress)
 
void otPlatRadioSetPanId (otInstance *aInstance, uint16_t aPanid)
 
void otPlatRadioSetPromiscuous (otInstance *aInstance, bool aEnable)
 
void otPlatRadioSetShortAddress (otInstance *aInstance, uint16_t aAddress)
 
otError otPlatRadioSetTransmitPower (otInstance *aInstance, int8_t aPower)
 
otError otPlatRadioSleep (otInstance *aInstance)
 
otError otPlatRadioTransmit (otInstance *aInstance, otRadioFrame *aFrame)
 
void platformRadioInit (void)
 
void platformRadioProcess (otInstance *aInstance, uintptr_t arg)
 
static void platformRadioProcessReceiveDone (otInstance *aInstance, otRadioFrame *aReceiveFrame, otError aReceiveError)
 
static void platformRadioProcessTransmitDone (otInstance *aInstance, otRadioFrame *aTransmitFrame, otRadioFrame *aAckFrame, otError aTransmitError)
 
static otError populateReceiveFrame (struct rx_queue_info *p)
 
static void processRxQueue (otInstance *aInstance, unsigned int events)
 
static void radioSignal (unsigned int evts)
 Post a Radio Signal. More...
 
static void releaseAndNext (struct rx_queue_info *p)
 
static void releaseQueueEntry (struct rx_queue_info *p)
 
static void rfCommonCallback (RF_Handle aRfHandle, RF_CmdHandle aRfCmdHandle, RF_EventMask aRfEventMask)
 
void rfCoreDiagChannelDisable (uint8_t aChannel)
 
void rfCoreDiagChannelEnable (uint8_t aChannel)
 
static void rfCoreEdScanCmdCallback (RF_Handle aRfHandle, RF_CmdHandle aRfCmdHandle, RF_EventMask aRfEventMask)
 Callback for the Energy Detect command. More...
 
static void rfCoreErrorCallback (RF_Handle aHandle, RF_CmdHandle aCmdHandle, RF_EventMask aEvents)
 
static RF_Stat rfCoreExecuteAbortCmd (RF_Handle aRfHandle, RF_CmdHandle aRfCmdHandle)
 sends the direct abort command to the radio core More...
 
static uint8_t rfCoreFindEmptyExtSrcMatchIdx (void)
 walks the ext address source match list to find an empty slot More...
 
static uint8_t rfCoreFindEmptyShortSrcMatchIdx (void)
 walks the short address source match list to find an empty slot More...
 
static uint8_t rfCoreFindExtSrcMatchIdx (const uint64_t *aAddress)
 walks the ext address source match list to find an address More...
 
static uint8_t rfCoreFindShortSrcMatchIdx (const uint16_t aAddress)
 walks the short address source match list to find an address More...
 
static void rfCoreInitBufs (void)
 initialize the RX/TX buffers More...
 
static void rfCoreInitReceiveParams (void)
 initialize the RX command structure More...
 
void rfCoreInitSetupCmd (void)
 initializes the setup command structure More...
 
static RF_Stat rfCoreModifyRxAutoPend (RF_Handle aRfHandle, bool aEnable)
 enable/disable autoPend More...
 
static RF_Stat rfCoreModifyRxFrameFilter (RF_Handle aRfHandle, bool aEnable)
 enable/disable filtering More...
 
static RF_Stat rfCoreModifySourceMatchEntry (RF_Handle aRfHandle, uint8_t aEntryNo, platformRadio_address aType, bool aEnable)
 sends the immediate modify source matching command to the radio core More...
 
static RF_CmdHandle rfCoreSendEdScanCmd (RF_Handle aRfHandle, uint8_t aChannel, uint16_t aDuration)
 sends the energy detect scan command to the radio core More...
 
static RF_CmdHandle rfCoreSendReceiveCmd (RF_Handle aRfHandle)
 sends the rx command to the radio core More...
 
static RF_CmdHandle rfCoreSendTransmitCmd (otInstance *aInstance, RF_Handle aRfHandle, uint8_t *aPsdu, uint8_t aLen)
 sends the tx command to the radio core More...
 
static RF_CmdHandle rfCoreSendTxTestCmd (RF_Handle aRfHandle, bool aModulated)
 
static otError rfCoreSetTransmitPower (int8_t aPower)
 Sets the transmit. More...
 
static void rfCoreTxTestCmdCallback (RF_Handle aRfHandle, RF_CmdHandle aRfCmdHandle, RF_EventMask aRfEventMask)
 Callback for the Transmit Test command. More...
 
static RF_CmdHandle startTransmit (RF_Handle aRfHandle)
 Start a transmission, or a start a retry. More...
 

Variables

static const struct tx_power_max cTxMaxPower []
 
static volatile rfc_CMD_IEEE_CSMA_t sCsmaBackoffCmd
 
static bool sDisableChannel = false
 
static volatile rfc_CMD_IEEE_ED_SCAN_t sEdScanCmd
 
static uint16_t seedRandom
 
static volatile rfc_CMD_IEEE_MOD_FILT_t sModifyReceiveFilterCmd
 
static volatile rfc_CMD_IEEE_MOD_SRC_MATCH_t sModifyReceiveSrcMatchCmd
 
static volatile rfc_CMD_RADIO_SETUP_PA_t sRadioSetupCmd
 
static volatile rfc_CMD_IEEE_RX_t sReceiveCmd
 
static RF_CmdHandle sReceiveCmdHandle
 
static int8_t sReqTxPower = 0
 
static RF_Handle sRfHandle
 
static RF_Object sRfObject
 
static volatile rfc_ieeeRxOutput_t sRfStats
 
static uint8_t sRxBuf0 [RX_BUF_SIZE]
 
static uint8_t sRxBuf1 [RX_BUF_SIZE]
 
static uint8_t sRxBuf2 [RX_BUF_SIZE]
 
static uint8_t sRxBuf3 [RX_BUF_SIZE]
 
static dataQueue_t sRxDataQueue = { 0 }
 
static volatile ext_src_match_data_t sSrcMatchExtData
 
static volatile short_src_match_data_t sSrcMatchShortData
 
static volatile platformRadio_phyState sState
 
static volatile rfc_CMD_IEEE_TX_t sTransmitCmd
 
static RF_CmdHandle sTransmitCmdHandle
 
static otError sTransmitError
 
static otRadioFrame sTransmitFrame
 
static uint8_t sTransmitPsdu [OT_RADIO_FRAME_MAX_SIZE]
 
static volatile unsigned int sTransmitRetryCount = 0
 
static volatile rfc_CMD_IEEE_RX_ACK_t sTransmitRxAckCmd
 
static volatile rfc_CMD_TX_TEST_t sTxTestCmd
 
static RF_CmdHandle sTxTestCmdHandle
 

Macro Definition Documentation

§ RF_NUM_RAT_TICKS_IN_1_US

#define RF_NUM_RAT_TICKS_IN_1_US   4

Referenced by populateReceiveFrame().

§ PLATFORM_RADIO_TX_TEST_SYNC_WORD

#define PLATFORM_RADIO_TX_TEST_SYNC_WORD   0x71764129

§ PLATFORM_RADIO_TX_TEST_MODULATED_WORD

#define PLATFORM_RADIO_TX_TEST_MODULATED_WORD   0xAAAA

Referenced by rfCoreSendTxTestCmd().

§ PLATFORM_RADIO_TX_TEST_UNMODULATED_WORD

#define PLATFORM_RADIO_TX_TEST_UNMODULATED_WORD   0xFFFF

Referenced by rfCoreSendTxTestCmd().

Function Documentation

§ startTransmit()

static RF_CmdHandle startTransmit ( RF_Handle  aRfHandle)
static

Start a transmission, or a start a retry.

Parameters
[in]aRfHandleThe rf handle
Returns
RF command handle for the transmission.

References rfCommonCallback(), and sCsmaBackoffCmd.

Referenced by handleTxAck(), and rfCoreSendTransmitCmd().

§ radioSignal()

static void radioSignal ( unsigned int  evts)
static

Post a Radio Signal.

Some Radio event has occurred, wake the process loops.

Parameters
[in]evtsEvents to post

References platformRadioSignal().

Referenced by otPlatRadioSleep(), rfCommonCallback(), and rfCoreEdScanCmdCallback().

§ rfCoreInitBufs()

static void rfCoreInitBufs ( void  )
static

initialize the RX/TX buffers

Zeros out the receive and transmit buffers and sets up the data structures of the receive queue.

References DATA_ENTRY_LENSZ_BYTE, sRxBuf0, sRxBuf1, sRxBuf2, sRxBuf3, sRxDataQueue, and sTransmitPsdu.

Referenced by platformRadioInit().

§ rfCoreInitSetupCmd()

void rfCoreInitSetupCmd ( void  )

initializes the setup command structure

The sRadioSetupCmd struct is used by the RF driver to bring the

References sRadioSetupCmd.

Referenced by platformRadioInit().

§ rfCoreInitReceiveParams()

static void rfCoreInitReceiveParams ( void  )
static

initialize the RX command structure

Sets the default values for the receive command structure.

References PLATFORM_RADIO_EXTADD_SRC_MATCH_NUM, PLATFORM_RADIO_SHORTADD_SRC_MATCH_NUM, sReceiveCmd, sRfStats, sRxDataQueue, sSrcMatchExtData, and sSrcMatchShortData.

Referenced by platformRadioInit().

§ otPlatRadioGetReceiveSensitivity()

int8_t otPlatRadioGetReceiveSensitivity ( otInstance *  aInstance)

Get the receive command's sensitivity.

References sReceiveCmd.

§ rfCoreExecuteAbortCmd()

static RF_Stat rfCoreExecuteAbortCmd ( RF_Handle  aRfHandle,
RF_CmdHandle  aRfCmdHandle 
)
static

sends the direct abort command to the radio core

Parameters
[in]aRfHandleThe handle for the RF core client
[in]aRfCmdHandleThe command handle to be aborted
Returns
the value from the command status register
Return values
RF_StatSuccessthe command completed correctly

References RF_DRIVER_ABORT.

Referenced by otPlatDiagRadioToneStart(), otPlatDiagRadioToneStop(), otPlatRadioEnergyScan(), otPlatRadioReceive(), otPlatRadioSetExtendedAddress(), otPlatRadioSetPanId(), otPlatRadioSetShortAddress(), otPlatRadioSleep(), and rfCoreSetTransmitPower().

§ rfCoreModifyRxFrameFilter()

static RF_Stat rfCoreModifyRxFrameFilter ( RF_Handle  aRfHandle,
bool  aEnable 
)
static

enable/disable filtering

Uses the radio core to alter the current running RX command filtering options. This ensures there is no access fault between the CM3 and CM0 for the RX command.

This function leaves the type of frames to be filtered the same as the receive command.

Note
An IEEE RX command must be running while this command executes.
Parameters
[in]aRfHandleThe handle for the RF core client
[in]aEnableTRUE: enable frame filtering FALSE: disable frame filtering
Returns
the value from the command status register
Return values
RF_StatCmdDoneSuccessthe command completed correctly

References sModifyReceiveFilterCmd, and sReceiveCmd.

Referenced by otPlatRadioSetPromiscuous().

§ rfCoreModifyRxAutoPend()

static RF_Stat rfCoreModifyRxAutoPend ( RF_Handle  aRfHandle,
bool  aEnable 
)
static

enable/disable autoPend

Uses the radio core to alter the current running RX command filtering options. This ensures there is no access fault between the CM3 and CM0 for the RX command.

This function leaves the type of frames to be filtered the same as the receive command.

Note
An IEEE RX command must be running while this command executes.
Parameters
[in]aRfHandleThe handle for the RF core client
[in]aEnableTRUE: enable autoPend, FALSE: disable autoPend
Returns
the value from the command status register
Return values
RF_StatCmdDoneSuccessthe command completed correctly

References sModifyReceiveFilterCmd, and sReceiveCmd.

Referenced by otPlatRadioEnableSrcMatch().

§ rfCoreModifySourceMatchEntry()

static RF_Stat rfCoreModifySourceMatchEntry ( RF_Handle  aRfHandle,
uint8_t  aEntryNo,
platformRadio_address  aType,
bool  aEnable 
)
static

sends the immediate modify source matching command to the radio core

Uses the radio core to alter the current source matching parameters used by the running RX command. This ensures there is no access fault between the CM3 and CM0, and ensures that the RX command has cohesive view of the data. The CM3 may make alterations to the source matching entries if the entry is marked as disabled.

Note
An IEEE RX command must be running while this command executes.
Parameters
[in]aRfHandleThe handle for the RF core client
[in]aEntryNoThe index of the entry to alter
[in]aTypeTRUE: the entry is a short address FALSE: the entry is an extended address
[in]aEnableWhether the given entry is to be enabled or disabled
Returns
the value from the command status register
Return values
RF_StatCmdDoneSuccessthe command completed correctly

References sModifyReceiveSrcMatchCmd.

Referenced by otPlatRadioAddSrcMatchExtEntry(), otPlatRadioAddSrcMatchShortEntry(), otPlatRadioClearSrcMatchExtEntries(), otPlatRadioClearSrcMatchExtEntry(), otPlatRadioClearSrcMatchShortEntries(), and otPlatRadioClearSrcMatchShortEntry().

§ rfCoreFindShortSrcMatchIdx()

static uint8_t rfCoreFindShortSrcMatchIdx ( const uint16_t  aAddress)
static

walks the short address source match list to find an address

Parameters
[in]aAddressthe short address to search for
Returns
the index where the address was found
Return values
PLATFORM_RADIO_SRC_MATCH_NONEthe address was not found

References PLATFORM_RADIO_SHORTADD_SRC_MATCH_NUM, PLATFORM_RADIO_SRC_MATCH_NONE, and sSrcMatchShortData.

Referenced by otPlatRadioAddSrcMatchShortEntry(), and otPlatRadioClearSrcMatchShortEntry().

§ rfCoreFindEmptyShortSrcMatchIdx()

static uint8_t rfCoreFindEmptyShortSrcMatchIdx ( void  )
static

walks the short address source match list to find an empty slot

Returns
the index of an unused address slot
Return values
PLATFORM_RADIO_SRC_MATCH_NONEno unused slots available

References PLATFORM_RADIO_SHORTADD_SRC_MATCH_NUM, PLATFORM_RADIO_SRC_MATCH_NONE, and sSrcMatchShortData.

Referenced by otPlatRadioAddSrcMatchShortEntry().

§ rfCoreFindExtSrcMatchIdx()

static uint8_t rfCoreFindExtSrcMatchIdx ( const uint64_t *  aAddress)
static

walks the ext address source match list to find an address

Parameters
[in]aAddressthe ext address to search for
Returns
the index where the address was found
Return values
PLATFORM_RADIO_SRC_MATCH_NONEthe address was not found

References PLATFORM_RADIO_EXTADD_SRC_MATCH_NUM, PLATFORM_RADIO_SRC_MATCH_NONE, and sSrcMatchExtData.

Referenced by otPlatRadioAddSrcMatchExtEntry(), and otPlatRadioClearSrcMatchExtEntry().

§ rfCoreFindEmptyExtSrcMatchIdx()

static uint8_t rfCoreFindEmptyExtSrcMatchIdx ( void  )
static

walks the ext address source match list to find an empty slot

Returns
the index of an unused address slot
Return values
PLATFORM_RADIO_SRC_MATCH_NONEno unused slots available

References PLATFORM_RADIO_EXTADD_SRC_MATCH_NUM, PLATFORM_RADIO_SRC_MATCH_NONE, and sSrcMatchExtData.

Referenced by otPlatRadioAddSrcMatchExtEntry().

§ handleTxAck()

static unsigned int handleTxAck ( RF_Handle  aRfHandle)
static

handle end of tx when an ACK is requested

Return values
eventmask to post if done, or 0 if nothing to do

References IEEE802154_MAC_MAX_FRAMES_RETRIES, RF_EVENT_TX_DONE, startTransmit(), sTransmitCmdHandle, sTransmitRetryCount, and sTransmitRxAckCmd.

Referenced by rfCommonCallback().

§ rfCommonCallback()

static void rfCommonCallback ( RF_Handle  aRfHandle,
RF_CmdHandle  aRfCmdHandle,
RF_EventMask  aRfEventMask 
)
static

Shared callback for Tx or Rx command chains, it is called when various events occur during tx and rx

Parameters
[in]aRfHandleHandle of the RF object
[in]aRfCmdHandleHandle of the command chain that finished
[in]aRfEventMaskEvents that happened to trigger this callback

References handleTxAck(), IEEE802154_ACK_REQUEST, radioSignal(), RF_EVENT_BUF_FULL, RF_EVENT_RX_ACK_DONE, RF_EVENT_RX_DONE, RF_EVENT_TX_DONE, sCsmaBackoffCmd, seedRandom, and sTransmitCmd.

Referenced by rfCoreSendReceiveCmd(), and startTransmit().

§ rfCoreSendTransmitCmd()

static RF_CmdHandle rfCoreSendTransmitCmd ( otInstance *  aInstance,
RF_Handle  aRfHandle,
uint8_t *  aPsdu,
uint8_t  aLen 
)
static

sends the tx command to the radio core

Sends the packet to the radio core to be sent asynchronously.

Parameters
[in]aRfHandleThe handle for the RF core client
[in]aPsduA pointer to the data to be sent
Note
this must be 4 byte aligned and not include the FCS, that is calculated in hardware.
Parameters
[in]aLenThe length in bytes of data pointed to by psdu.
Returns
handle of the running command returned by the command scheduler

References IEEE802154_ACK_REQUEST, IEEE802154_DSN_OFFSET, IEEE802154_MAC_ACK_WAIT_DURATION, IEEE802154_MAC_MAX_BE, IEEE802154_MAC_MAX_CSMA_BACKOFFS, IEEE802154_MAC_MIN_BE, IEEE802154_SYMBOLS_PER_SEC, otDiagIsEnabled(), PLATFORM_RADIO_RAT_TICKS_PER_SEC, sCsmaBackoffCmd, seedRandom, startTransmit(), sTransmitCmd, sTransmitRetryCount, and sTransmitRxAckCmd.

Referenced by otPlatRadioTransmit().

§ rfCoreSendReceiveCmd()

static RF_CmdHandle rfCoreSendReceiveCmd ( RF_Handle  aRfHandle)
static

sends the rx command to the radio core

Sends the pre-built receive command to the radio core. This sets up the radio to receive packets according to the settings in the global rx command.

Note
This function does not alter any of the parameters of the rx command. It is only concerned with sending the command to the radio core. See otPlatRadioSetPanId for an example of how the rx settings are set changed.
Parameters
[in]aRfHandleThe handle for the RF core client
Returns
handle of the running command returned by the command scheduler

References rfCommonCallback(), and sReceiveCmd.

Referenced by otPlatDiagRadioToneStop(), otPlatRadioReceive(), otPlatRadioSetExtendedAddress(), otPlatRadioSetPanId(), otPlatRadioSetShortAddress(), and rfCoreSetTransmitPower().

§ rfCoreSetTransmitPower()

static otError rfCoreSetTransmitPower ( int8_t  aPower)
static

Sets the transmit.

Sets the transmit power within the radio setup command or the override list.

References cTxMaxPower, platformRadio_phyState_Disabled, platformRadio_phyState_Sleep, rfCoreExecuteAbortCmd(), rfCoreSendReceiveCmd(), sReceiveCmd, sReceiveCmdHandle, sRfHandle, and sState.

Referenced by otPlatRadioReceive(), and otPlatRadioSetTransmitPower().

§ rfCoreEdScanCmdCallback()

static void rfCoreEdScanCmdCallback ( RF_Handle  aRfHandle,
RF_CmdHandle  aRfCmdHandle,
RF_EventMask  aRfEventMask 
)
static

Callback for the Energy Detect command.

Parameters
[in]aRfHandleHandle of the RF object
[in]aRfCmdHandleHandle of the command chain that finished
[in]aRfEventMaskEvents that happened to trigger this callback

References radioSignal(), and RF_EVENT_ED_SCAN_DONE.

Referenced by rfCoreSendEdScanCmd().

§ rfCoreSendEdScanCmd()

static RF_CmdHandle rfCoreSendEdScanCmd ( RF_Handle  aRfHandle,
uint8_t  aChannel,
uint16_t  aDuration 
)
static

sends the energy detect scan command to the radio core

Sends the Energy Detect scan command to the radio core. This scans the given channel for activity.

Parameters
[in]aRfHandleThe handle for the RF core client
[in]aChannelThe IEEE page 0 channel to scan
[in]aDurationTime in ms to scan
Returns
handle of the running command returned by the command scheduler

References PLATFORM_RADIO_RAT_TICKS_PER_SEC, rfCoreEdScanCmdCallback(), and sEdScanCmd.

Referenced by otPlatRadioEnergyScan().

§ rfCoreTxTestCmdCallback()

static void rfCoreTxTestCmdCallback ( RF_Handle  aRfHandle,
RF_CmdHandle  aRfCmdHandle,
RF_EventMask  aRfEventMask 
)
static

Callback for the Transmit Test command.

Parameters
[in]aRfHandleHandle of the RF object
[in]aRfCmdHandleHandle of the command chain that finished
[in]aRfEventMaskEvents that happened to trigger this callback

Referenced by rfCoreSendTxTestCmd().

§ rfCoreSendTxTestCmd()

static RF_CmdHandle rfCoreSendTxTestCmd ( RF_Handle  aRfHandle,
bool  aModulated 
)
static
Parameters
[in]aRfHandleThe handle for the RF core client
[in]aModulatedTRUE: Send modulated word FALSE: Send unmodulated word
Returns
handle of the running command returned by the command scheduler

References PLATFORM_RADIO_TX_TEST_MODULATED_WORD, PLATFORM_RADIO_TX_TEST_UNMODULATED_WORD, rfCoreTxTestCmdCallback(), and sTxTestCmd.

Referenced by otPlatDiagRadioToneStart().

§ rfCoreErrorCallback()

static void rfCoreErrorCallback ( RF_Handle  aHandle,
RF_CmdHandle  aCmdHandle,
RF_EventMask  aEvents 
)
static

Default error callback for RF Driver.

Errors are unlikely, and fatal.

Referenced by otPlatRadioEnable().

§ rfCoreDiagChannelDisable()

void rfCoreDiagChannelDisable ( uint8_t  aChannel)

Function documented in radio.h

References otPlatRadioReceive(), and sDisableChannel.

§ rfCoreDiagChannelEnable()

void rfCoreDiagChannelEnable ( uint8_t  aChannel)

Function documented in radio.h

References otPlatRadioReceive(), and sDisableChannel.

§ platformRadioInit()

void platformRadioInit ( void  )

§ otPlatRadioEnable()

otError otPlatRadioEnable ( otInstance *  aInstance)

§ otPlatRadioIsEnabled()

bool otPlatRadioIsEnabled ( otInstance *  aInstance)

Function documented in platform/radio.h

References platformRadio_phyState_Disabled, and sState.

§ otPlatRadioDisable()

otError otPlatRadioDisable ( otInstance *  aInstance)

Function documented in platform/radio.h

References platformRadio_phyState_Disabled, platformRadio_phyState_Sleep, sRfHandle, and sState.

§ otPlatRadioEnergyScan()

otError otPlatRadioEnergyScan ( otInstance *  aInstance,
uint8_t  aScanChannel,
uint16_t  aScanDuration 
)

§ otPlatRadioSetTransmitPower()

otError otPlatRadioSetTransmitPower ( otInstance *  aInstance,
int8_t  aPower 
)

Function documented in platform/radio.h

References rfCoreSetTransmitPower(), and sReqTxPower.

§ otPlatRadioGetTransmitPower()

otError otPlatRadioGetTransmitPower ( otInstance *  aInstance,
int8_t *  aPower 
)

Function documented in platform/radio.h

References sRfHandle.

§ otPlatRadioReceive()

otError otPlatRadioReceive ( otInstance *  aInstance,
uint8_t  aChannel 
)

§ otPlatRadioSleep()

otError otPlatRadioSleep ( otInstance *  aInstance)

§ otPlatRadioGetTransmitBuffer()

otRadioFrame* otPlatRadioGetTransmitBuffer ( otInstance *  aInstance)

Function documented in platform/radio.h

References sTransmitFrame.

§ otPlatRadioTransmit()

otError otPlatRadioTransmit ( otInstance *  aInstance,
otRadioFrame *  aFrame 
)

§ otPlatRadioGetRssi()

int8_t otPlatRadioGetRssi ( otInstance *  aInstance)

Function documented in platform/radio.h

References sRfStats.

§ otPlatRadioGetCaps()

otRadioCaps otPlatRadioGetCaps ( otInstance *  aInstance)

Function documented in platform/radio.h

§ otPlatRadioEnableSrcMatch()

void otPlatRadioEnableSrcMatch ( otInstance *  aInstance,
bool  aEnable 
)

Function documented in platform/radio.h

References rfCoreModifyRxAutoPend(), sReceiveCmd, and sRfHandle.

§ otPlatRadioAddSrcMatchShortEntry()

otError otPlatRadioAddSrcMatchShortEntry ( otInstance *  aInstance,
const uint16_t  aShortAddress 
)

§ otPlatRadioClearSrcMatchShortEntry()

otError otPlatRadioClearSrcMatchShortEntry ( otInstance *  aInstance,
const uint16_t  aShortAddress 
)

§ otPlatRadioAddSrcMatchExtEntry()

otError otPlatRadioAddSrcMatchExtEntry ( otInstance *  aInstance,
const otExtAddress *  aExtAddress 
)

§ otPlatRadioClearSrcMatchExtEntry()

otError otPlatRadioClearSrcMatchExtEntry ( otInstance *  aInstance,
const otExtAddress *  aExtAddress 
)

§ otPlatRadioClearSrcMatchShortEntries()

void otPlatRadioClearSrcMatchShortEntries ( otInstance *  aInstance)

§ otPlatRadioClearSrcMatchExtEntries()

void otPlatRadioClearSrcMatchExtEntries ( otInstance *  aInstance)

§ otPlatRadioGetPromiscuous()

bool otPlatRadioGetPromiscuous ( otInstance *  aInstance)

Function documented in platform/radio.h

References sReceiveCmd.

§ otPlatRadioSetPromiscuous()

void otPlatRadioSetPromiscuous ( otInstance *  aInstance,
bool  aEnable 
)

Function documented in platform/radio.h

References rfCoreModifyRxFrameFilter(), sReceiveCmd, and sRfHandle.

§ otPlatRadioGetIeeeEui64()

void otPlatRadioGetIeeeEui64 ( otInstance *  aInstance,
uint8_t *  aIeeeEui64 
)

Function documented in platform/radio.h

§ otPlatRadioSetPanId()

void otPlatRadioSetPanId ( otInstance *  aInstance,
uint16_t  aPanid 
)

Function documented in platform/radio.h

Note
it is entirely possible for this function to fail, but there is no valid way to return that error since the funciton prototype was changed.

References platformRadio_phyState_Receive, platformRadio_phyState_Transmit, rfCoreExecuteAbortCmd(), rfCoreSendReceiveCmd(), sReceiveCmd, sReceiveCmdHandle, sRfHandle, and sState.

§ otPlatRadioSetExtendedAddress()

void otPlatRadioSetExtendedAddress ( otInstance *  aInstance,
const otExtAddress *  aAddress 
)

Function documented in platform/radio.h

Note
it is entirely possible for this function to fail, but there is no valid way to return that error since the function prototype was changed.

References platformRadio_phyState_Receive, platformRadio_phyState_Transmit, rfCoreExecuteAbortCmd(), rfCoreSendReceiveCmd(), sReceiveCmd, sReceiveCmdHandle, sRfHandle, and sState.

§ otPlatRadioSetShortAddress()

void otPlatRadioSetShortAddress ( otInstance *  aInstance,
uint16_t  aAddress 
)

Function documented in platform/radio.h

Note
it is entirely possible for this function to fail, but there is no valid way to return that error since the funciton prototype was changed.

References platformRadio_phyState_Receive, platformRadio_phyState_Transmit, rfCoreExecuteAbortCmd(), rfCoreSendReceiveCmd(), sReceiveCmd, sReceiveCmdHandle, sRfHandle, and sState.

§ otPlatDiagRadioToneStart()

otError otPlatDiagRadioToneStart ( otInstance *  aInstance,
bool  aModulated 
)

§ otPlatDiagRadioToneStop()

otError otPlatDiagRadioToneStop ( otInstance *  aInstance)

§ platformRadioProcessTransmitDone()

static void platformRadioProcessTransmitDone ( otInstance *  aInstance,
otRadioFrame *  aTransmitFrame,
otRadioFrame *  aAckFrame,
otError  aTransmitError 
)
static

References otPlatDiagModeGet(), and sTransmitCmd.

Referenced by handleTxState().

§ platformRadioProcessReceiveDone()

static void platformRadioProcessReceiveDone ( otInstance *  aInstance,
otRadioFrame *  aReceiveFrame,
otError  aReceiveError 
)
static

References otPlatDiagModeGet().

Referenced by handleRxDataFinish().

§ releaseQueueEntry()

static void releaseQueueEntry ( struct rx_queue_info *  p)
static

Release an entry in the RX buffer list

Referenced by releaseAndNext().

§ nextQueueEntry()

static void nextQueueEntry ( struct rx_queue_info *  p)
static

Given a queue entry, give the next queue entry.

Referenced by ackSearchRxQueue(), handleRxAckFinish(), handleRxDataFinish(), processRxQueue(), and releaseAndNext().

§ releaseAndNext()

static void releaseAndNext ( struct rx_queue_info *  p)
static

Release the current entry and move to the next entry in the rx queue.

References nextQueueEntry(), and releaseQueueEntry().

Referenced by handleRxDataFinish(), handleTxState(), and processRxQueue().

§ populateReceiveFrame()

static otError populateReceiveFrame ( struct rx_queue_info *  p)
static

§ handleRxDataFinish()

static void handleRxDataFinish ( struct rx_queue_info *  p)
static

§ handleRxAckFinish()

static otRadioFrame* handleRxAckFinish ( struct rx_queue_info *  p,
uint8_t  ackDsn 
)
static

§ clearRxQueue()

static void clearRxQueue ( void  )
static

Empties the rx queue, regardless of the current state of the entries.

References sRxDataQueue.

Referenced by platformRadioProcess().

§ processRxQueue()

static void processRxQueue ( otInstance *  aInstance,
unsigned int  events 
)
static

Scan through the RX queue, looking for completed entries.

References handleRxDataFinish(), nextQueueEntry(), releaseAndNext(), and sRxDataQueue.

Referenced by platformRadioProcess().

§ ackSearchRxQueue()

static otRadioFrame* ackSearchRxQueue ( struct rx_queue_info *  rqi,
unsigned int  events,
uint8_t  ackDsn 
)
static

References handleRxAckFinish(), and nextQueueEntry().

Referenced by handleTxState().

§ handleTxState()

static void handleTxState ( otInstance *  aInstance,
unsigned int  events 
)
static

§ platformRadioProcess()

void platformRadioProcess ( otInstance *  aInstance,
uintptr_t  arg 
)

Variable Documentation

§ sState

volatile platformRadio_phyState sState
static

§ sDisableChannel

bool sDisableChannel = false
static

§ sTransmitRetryCount

volatile unsigned int sTransmitRetryCount = 0
static

§ sRadioSetupCmd

volatile rfc_CMD_RADIO_SETUP_PA_t sRadioSetupCmd
static

§ sModifyReceiveFilterCmd

volatile rfc_CMD_IEEE_MOD_FILT_t sModifyReceiveFilterCmd
static

§ sModifyReceiveSrcMatchCmd

volatile rfc_CMD_IEEE_MOD_SRC_MATCH_t sModifyReceiveSrcMatchCmd
static

§ sEdScanCmd

volatile rfc_CMD_IEEE_ED_SCAN_t sEdScanCmd
static

§ sTxTestCmd

volatile rfc_CMD_TX_TEST_t sTxTestCmd
static

Referenced by rfCoreSendTxTestCmd().

§ sReceiveCmd

volatile rfc_CMD_IEEE_RX_t sReceiveCmd
static

§ sCsmaBackoffCmd

volatile rfc_CMD_IEEE_CSMA_t sCsmaBackoffCmd
static

§ sTransmitCmd

volatile rfc_CMD_IEEE_TX_t sTransmitCmd
static

§ sTransmitRxAckCmd

volatile rfc_CMD_IEEE_RX_ACK_t sTransmitRxAckCmd
static

§ sSrcMatchExtData

volatile ext_src_match_data_t sSrcMatchExtData
static

§ sSrcMatchShortData

volatile short_src_match_data_t sSrcMatchShortData
static

§ sRfStats

volatile rfc_ieeeRxOutput_t sRfStats
static

§ sRxBuf0

uint8_t sRxBuf0[RX_BUF_SIZE]
static

Referenced by rfCoreInitBufs().

§ sRxBuf1

uint8_t sRxBuf1[RX_BUF_SIZE]
static

Referenced by rfCoreInitBufs().

§ sRxBuf2

uint8_t sRxBuf2[RX_BUF_SIZE]
static

Referenced by rfCoreInitBufs().

§ sRxBuf3

uint8_t sRxBuf3[RX_BUF_SIZE]
static

Referenced by rfCoreInitBufs().

§ sRxDataQueue

dataQueue_t sRxDataQueue = { 0 }
static

§ sTransmitFrame

otRadioFrame sTransmitFrame
static

§ sTransmitError

otError sTransmitError
static

Referenced by handleTxState().

§ sTransmitPsdu

uint8_t sTransmitPsdu[OT_RADIO_FRAME_MAX_SIZE]
static

Referenced by rfCoreInitBufs().

§ sRfObject

RF_Object sRfObject
static

Referenced by otPlatRadioEnable().

§ sRfHandle

RF_Handle sRfHandle
static

§ sReceiveCmdHandle

RF_CmdHandle sReceiveCmdHandle
static

§ sTransmitCmdHandle

RF_CmdHandle sTransmitCmdHandle
static

Referenced by handleTxAck(), and otPlatRadioTransmit().

§ sTxTestCmdHandle

RF_CmdHandle sTxTestCmdHandle
static

§ seedRandom

uint16_t seedRandom
static

§ sReqTxPower

int8_t sReqTxPower = 0
static

Value requested in dBm from the upper layers on the last call to otPlatRadioSetTransmitPower.

Referenced by otPlatRadioReceive(), and otPlatRadioSetTransmitPower().

§ cTxMaxPower

const struct tx_power_max cTxMaxPower[]
static
Initial value:
=
{
{ .channel = 26, .maxPower = 15 },
{ .channel = 25, .maxPower = 19 },
}

Array of back-off values necessary for passing FCC testing.

Referenced by rfCoreSetTransmitPower().

© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale