TI-RTOS Drivers  tidrivers_cc13xx_cc26xx_2_20_00_08
Data Structures | Macros | Typedefs | Enumerations | Functions
RF.h File Reference

Detailed Description

RF driver for the CC26/13xx family.

============================================================================

Driver include

The RF header file should be included in an application as follows:

Overview

The RF driver allows clients (applications or other drivers) to control the radio of the device. The radio interface can either be blocking or non-blocking. Furthermore, the RF driver manages the RF power domain and tries to power down when the radio is no longer needed. It also allows clients to setup callbacks when radio operations are completed and as such allows for fully interrupt based radio software. Callback is executed in software interrupt (SWI) context, therefore users should only executed minimum codes inside the callback. When integrated with applications, it is recommended users should set the RF software interrupt (SWI) to the highest priority in order to ensure proper operaton of the RF driver.

The RF driver can be used in either single mode only or multi-mode (dual-mode). The same RF.h is used for both modes. RFCC26XX_multiMode.c supports both single mode and multi-mode operation. RFCC26XX_singleMode.c supports single mode operation only.

Power Management

The driver sets RF Core power constraints (in the Power driver) when radio is required to keep the device out of standby. When the operation has finished, power constraints are released. The power state of the RF Core is solely controlled by the RF driver based on radio operation state. The following use-cases will power down the RF Core:

  1. nInactivityTimeout in RF_Params specifies the time RF Core will power down after completion of a radio command and no other commands pending in the command queue. The default is BIOS_WAIT_FOREVER which means infinite timeout and no power down after end of command.
  2. Schedule (or post) a radio command using RF_scheduleCmd() or RF_postCmd() APIs with the startTime sufficiently far in the future with startTrigger.triggerType set to TRIG_ABSTIME. This will power down RF Core and automatically power up before the startTime to execute the scheduled command.
  3. Force a power down using RF_yield() API. This will power down RF after all pending radio commands are complete.
  4. RF_close() API will power down the radio if all the radio access request from each client is done.

Note the above three cases will execute power down independently. For example when nInactivityTimeout is infinity, if a radio command is scheduled in sufficient future, the RF driver will power down and wake up at the scheduled startTime. Since RAT channels are part of the RF Core, they will not be available when the RF Core is off. The RF Driver maintains the sync between the RAT and RTC during power-up and power-down using the CMD_SYNC_RAT_START and CMD_SYNC_RAT_STOP radio operations.

Supported Functions

Generic API function Description
RF_open() Open client connection to RF driver
RF_close() Close client connection to RF driver
RF_getCurrentTime() Return current radio timer value
RF_scheduleCmd() Schedule an RF operation to the command queue
RF_postCmd() Post an RF operation to the command queue
RF_pendCmd() Wait for posted command to complete
RF_runCmd() Runs synchronously a (chain of) RF operation(s)
RF_flushCmd() Abort previously submitted command, clear queue
RF_requestAccess() Request access to radio resource
RF_yield() Signal that the radio will not be used for a while
RF_cancelCmd() Abort/stop/cancel single cmd in command queue
RF_getRssi() Get rssi value
RF_runImmediateCmd() Send any immediate command
RF_runDirectCmd() Send any direct command
RF_getInfo() Get value for some RF driver parameters
RF_ratCapture() Run RAT capture command
RF_ratCompare() Run RAT compare command
RF_ratHwOutput() Run RAT HW Output command
RF_ratDisableChannel()Disable RAT channel
RF_control() Set RF control parameters

Unsupported Functionality

The RF driver does not support:

Use Cases

Basic Single Mode Operation

Schedule a proprietary radio command.

RF_Object rfObj;
RF_Handle handle;
RF_Params params;
RF_Mode RF_prop =
{
.rfMode = RF_MODE_PROPRIETARY_SUB_1,
.cpePatchFxn = &rf_patch_cpe_genfsk,
.mcePatchFxn = 0,
.rfePatchFxn = 0,
};
// Init RF and specify non-default parameters
RF_Params_init(&params);
params.nInactivityTimeout = 500; // 500us
// Configure RF schedule command parameters
schParams.endTime = 0;
// Open a proprietary RF handle
handle = RF_open(rfObj, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &params);
// Run a proprietary Fs command
RF_runCmd(handle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
// Schedule a proprietary TX command
RF_scheduleCmd(handle, (RF_Op*)&RF_cmdPropTx, &schParams, &callback, RF_EventLastCmdDone);

Basic Dual Mode Operation

Schedule BLE and proprietary radio commands.

RF_Object ble_rfObj;
RF_Object prop_rfObject;
RF_Handle ble_handle, prop_handle;
RF_Params ble_params, prop_params;
RF_ScheduleCmdParams ble_schParams, prop_schParams;
RF_Mode RF_ble =
{
.rfMode = RF_MODE_MULTIPLE, // rfMode for dual mode
.cpePatchFxn = &rf_patch_cpe_ble,
.mcePatchFxn = 0,
.rfePatchFxn = &rf_patch_rfe_ble,
};
RF_Mode RF_prop =
{
.rfMode = RF_MODE_MULTIPLE, // rfMode for dual mode
.cpePatchFxn = &rf_patch_cpe_genfsk,
.mcePatchFxn = 0,
.rfePatchFxn = 0,
};
// Init RF and specify non-default parameters
RF_Params_init(&ble_params);
ble_params.nInactivityTimeout = 200; // 200us
RF_Params_init(&prop_params);
prop_params.nInactivityTimeout = 200; // 200us
// Configure RF schedule command parameters
ble_schParams.priority = RF_PriorityNormal;
ble_schParams.endTime = 0;
prop_schParams.priority = RF_PriorityNormal;
prop_schParams.endTime = 0;
// Open BLE and proprietary RF handles
ble_handle = RF_open(ble_rfObj, &RF_ble, (RF_RadioSetup*)&RF_cmdRadioSetup, &ble_params);
prop_handle = RF_open(prop_rfObj, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &prop_params);
// Run a proprietary Fs command
RF_runCmd(prop_handle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
// Schedule a proprietary RX command
RF_scheduleCmd(prop_handle, (RF_Op*)&RF_cmdPropRx, &schParams_prop, &prop_callback, RF_EventRxOk);
// Schedule a BLE advertizer command
RF_scheduleCmd(ble_handle, (RF_Op*)&RF_cmdBleAdv, &schParams_ble, &ble_callback,

#include <stdint.h>
#include <stdbool.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <driverlib/rf_common_cmd.h>
#include <driverlib/rf_prop_cmd.h>
Include dependency graph for RF.h:

Go to the source code of this file.

Data Structures

struct  RF_Mode
 Struct defining operating mode of RF driver. More...
 
union  RF_RadioSetup
 Union of the different flavors of RADIO_SETUP commands. More...
 
struct  RFCC26XX_HWAttrs
 RF Hardware attributes. More...
 
struct  RF_Object
 Struct used to store RF client state and configuration Pointer to an RF_Object is used as handles (RF_Handle) in interactions with the RF driver. More...
 
union  RF_InfoVal
 RF_getParamsVal used to input and return RF driver paramters with RF_getParams() More...
 
struct  RF_Params
 RF parameter struct RF parameters are used with the RF_open() and RF_Params_init() call. More...
 
struct  RF_ScheduleCmdParams
 RF schedule command parameter struct RF schedule command parameters are used with the RF_scheduleCmd() call. More...
 
struct  RF_AccessParams
 RF request access parameter struct RF request access command parameters are used with the RF_requestAccess() call. More...
 

Macros

#define RF_EventCmdDone   (1<<0)
 Radio operation command finished. More...
 
#define RF_EventLastCmdDone   (1<<1)
 Last radio operation command in a chain finished. More...
 
#define RF_EventTxDone   (1<<4)
 Packet transmitted. More...
 
#define RF_EventTXAck   (1<<5)
 ACK packet transmitted. More...
 
#define RF_EventTxCtrl   (1<<6)
 Control packet transmitted. More...
 
#define RF_EventTxCtrlAck   (1<<7)
 Acknowledgement received on a transmitted control packet. More...
 
#define RF_EventTxCtrlAckAck   (1<<8)
 Acknowledgement received on a transmitted control packet, and acknowledgement transmitted for that packet. More...
 
#define RF_EventTxRetrans   (1<<9)
 Packet retransmitted. More...
 
#define RF_EventTxEntryDone   (1<<10)
 Tx queue data entry state changed to Finished. More...
 
#define RF_EventTxBufferChange   (1<<11)
 A buffer change is complete. More...
 
#define RF_EventRxOk   (1<<16)
 Packet received with CRC OK, payload, and not to be ignored. More...
 
#define RF_EventRxNOk   (1<<17)
 Packet received with CRC error. More...
 
#define RF_EventRxIgnored   (1<<18)
 Packet received with CRC OK, but to be ignored. More...
 
#define RF_EventRxEmpty   (1<<19)
 Packet received with CRC OK, not to be ignored, no payload. More...
 
#define RF_EventRxCtrl   (1<<20)
 Control packet received with CRC OK, not to be ignored. More...
 
#define RF_EventRxCtrlAck   (1<<21)
 Control packet received with CRC OK, not to be ignored, then ACK sent. More...
 
#define RF_EventRxBufFull   (1<<22)
 Packet received that did not fit in the Rx queue. More...
 
#define RF_EventRxEntryDone   (1<<23)
 Rx queue data entry changing state to Finished. More...
 
#define RF_EventDataWritten   (1<<24)
 Data written to partial read Rx buffer. More...
 
#define RF_EventNDataWritten   (1<<25)
 Specified number of bytes written to partial read Rx buffer. More...
 
#define RF_EventRxAborted   (1<<26)
 Packet reception stopped before packet was done. More...
 
#define RF_EventRxCollisionDetected   (1<<27)
 A collision was indicated during packet reception. More...
 
#define RF_EventModulesUnlocked   (1<<29)
 As part of the boot process, the CM0 has opened access to RF core modules and memories. More...
 
#define RF_EventInternalError   (uint32_t)(1<<31)
 Internal error observed. More...
 
#define RF_EventMdmSoft   0x0000002000000000
 Modem Sync detected (MDMSOFT IFG) More...
 
#define RF_EventCmdCancelled   0x1000000000000000
 Command cancelled : RF driver event. More...
 
#define RF_EventCmdAborted   0x2000000000000000
 Command aborted : RF driver event. More...
 
#define RF_EventCmdStopped   0x4000000000000000
 Command stopped : RF driver event. More...
 
#define RF_EventCmdError   0x8000000000000000
 Command error : RF driver event. More...
 
#define RF_EventRatCh   0x0800000000000000
 RAT Channel interrupt : RF driver event. More...
 
#define RF_EventPowerUp   0x0400000000000000
 RF power up event. More...
 
#define RF_EventError   0x0200000000000000
 RF mode error event. More...
 
#define RF_CTRL_SET_INACTIVITY_TIMEOUT   0
 Control code used by RF_control to set inactivity timeout. More...
 
#define RF_GET_RSSI_ERROR_VAL   (-128)
 Error return value for RF_getRssi() More...
 
#define RF_CMDHANDLE_FLUSH_ALL   (-1)
 RF command handle to flush all RF commands. More...
 
#define RF_ALLOC_ERROR   (-2)
 RF command or RAT channel allocation error. More...
 
#define RF_ERROR_INVALID_RFMODE   (-256)
 Invalid RF_Mode. Used in error callback. More...
 
#define RF_ERROR_CMDFS_SYNTH_PROG   (-257)
 Synthesizer error with CMD_FS. Used in error callback. If this error occurred in error callback, user needs to resend CMD_Fs to recover. See errata SWRA521. More...
 

Typedefs

typedef rfc_radioOp_t RF_Op
 Alias for the data type of the header common to all radio operations. More...
 
typedef uint64_t RF_EventMask
 Event mask type (construct mask with combinations of RF_EventMask) More...
 
typedef int16_t RF_CmdHandle
 A command handle that is returned from RF_postCmd() Used by RF_pendCmd() and RF_flushCmd(). A negative value indicates an error. More...
 
typedef struct RFCC26XX_HWAttrs RFCC26XX_HWAttrs
 RF Hardware attributes. More...
 
typedef RF_ObjectRF_Handle
 A handle that is returned from a RF_open() call Used for further RF client interaction with the RF driver. More...
 
typedef void(* RF_Callback) (RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
 RF callback function pointer type RF callbacks can occur at the completion of posted RF operation (chain). The callback is called from SWI context and provides the relevant RF_Handle, relevant radio operation command handle RF_CmdHandle, as well as an RF_EventMask that indicates what has occurred. in the case of error callback the RF_CmdHandle will indicate the error code. More...
 

Enumerations

enum  RF_Priority {
  RF_PriorityHighest = 3,
  RF_PriorityHigh = 2,
  RF_PriorityNormal = 1,
  RF_PriorityLow = 0
}
 Priority of RF commands. More...
 
enum  RF_Stat {
  RF_StatBusyError,
  RF_StatRadioInactiveError,
  RF_StatCmdDoneError,
  RF_StatInvalidParamsError,
  RF_StatError = 0x80,
  RF_StatCmdDoneSuccess,
  RF_StatCmdSch,
  RF_StatSuccess
}
 RF Stat reported as return value for RF_ratCmd(), RF_getRssi(). RF_setTxPwr(), RF_cancelCmd() More...
 
enum  RF_InfoType {
  RF_GET_CURR_CMD,
  RF_GET_AVAIL_RAT_CH,
  RF_GET_RADIO_STATE
}
 RF_getParamsType contains the options available for using the RF_getParams() More...
 

Functions

RF_Handle RF_open (RF_Object *pObj, RF_Mode *pRfMode, RF_RadioSetup *pOpSetup, RF_Params *params)
 Open client connection to RF driver. More...
 
void RF_close (RF_Handle h)
 Close client connection to RF driver. More...
 
uint32_t RF_getCurrentTime (void)
 Return current radio timer value. More...
 
RF_CmdHandle RF_postCmd (RF_Handle h, RF_Op *pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent)
 Post an RF operation (chain) to the command queue Post an RF_Op to the RF command queue of the client with handle h.
The command can be the first in a chain of RF operations or a standalone RF operation. If a chain of operations are posted they are treated atomically, i.e. either all or none of the chained operations are run.
All operations must be posted in strictly increasing chronological order. Function returns immediately.
More...
 
RF_CmdHandle RF_scheduleCmd (RF_Handle h, RF_Op *pOp, RF_ScheduleCmdParams *pSchParams, RF_Callback pCb, RF_EventMask bmEvent)
 Schedule an RF operation (chain) to the command queue Schedule an RF_Op to the RF command queue of the client with handle h.
The command can be the first in a chain of RF operations or a standalone RF operation. If a chain of operations are posted they are treated atomically, i.e. either all or none of the chained operations are run.
All operations must be posted in strictly increasing chronological order. Function returns immediately.
More...
 
RF_EventMask RF_pendCmd (RF_Handle h, RF_CmdHandle ch, RF_EventMask bmEvent)
 Wait for posted command to complete Wait until completion of RF command identified by handle ch for client identified by handle h to complete.
Some RF operations (or chains of operations) post additional events during execution which, if enabled in event mask bmEvent, will make RF_pendCmd() return early. In this case, multiple calls to RF_pendCmd() for a single command can be made.
If RF_pendCmd() is called for a command that registered a callback function it will take precedence and the callback function will never be called.
More...
 
RF_EventMask RF_runCmd (RF_Handle h, RF_Op *pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent)
 Runs synchronously a (chain of) RF operation(s) Allows a (chain of) operation(s) to be posted to the command queue and then waits for it to complete.
More...
 
RF_Stat RF_cancelCmd (RF_Handle h, RF_CmdHandle ch, uint8_t mode)
 Abort/stop/cancel single command in command queue If command is running, aborts/stops it and posts callback for the aborted/stopped command.
If command has not yet run, cancels it it and posts callback for the cancelled command.
If command has already run or been aborted/stopped/cancelled, has no effect.
More...
 
RF_Stat RF_flushCmd (RF_Handle h, RF_CmdHandle ch, uint8_t mode)
 Abort/stop/cancel command and any subsequent commands in command queue If command is running, aborts/stops it and then cancels all later commands in queue.
If command has not yet run, cancels it and all later commands in queue.
If command has already run or been aborted/stopped/cancelled, has no effect.
More...
 
RF_Stat RF_runImmediateCmd (RF_Handle h, uint32_t *pCmdStruct)
 Send any Immediate command.
More...
 
RF_Stat RF_runDirectCmd (RF_Handle h, uint32_t cmd)
 Send any Direct command.
More...
 
void RF_yield (RF_Handle h)
 Signal that radio client is not going to issue more commands in a while.
More...
 
void RF_Params_init (RF_Params *params)
 Function to initialize the RF_Params struct to its defaults. More...
 
RF_Stat RF_getInfo (RF_Handle h, RF_InfoType type, RF_InfoVal *pValue)
 Get value for some RF driver parameters.
More...
 
int8_t RF_getRssi (RF_Handle h)
 Get rssi value. More...
 
RF_OpRF_getCmdOp (RF_Handle h, RF_CmdHandle cmdHnd)
 Get command structure pointer. More...
 
int8_t RF_ratCompare (RF_Handle h, rfc_CMD_SET_RAT_CMP_t *pCmdStruct, uint32_t compareTime, RF_Callback pRatCb)
 Setup RAT compare, and callback when compare matches. Note radio needs to be on for RAT to operate. If radio is off, this API returns RF_ALLOC_ERROR. More...
 
int8_t RF_ratCapture (RF_Handle h, uint16_t config, RF_Callback pRatCb)
 Setup RAT capture, and callback when capture event happens. Note radio needs to be on for RAT to operate. If radio is off, this API returns RF_ALLOC_ERROR. More...
 
RF_Stat RF_ratHwOutput (RF_Handle h, uint16_t config)
 Setup RAT HW output. Note radio needs to be on for RAT to operate. If radio is off, this API returns RF_ALLOC_ERROR. More...
 
RF_Stat RF_ratDisableChannel (RF_Handle h, int8_t ratChannelNum)
 Disable a RAT channel. More...
 
RF_Stat RF_control (RF_Handle h, int8_t ctrl, void *args)
 Set RF control parameters. More...
 
RF_Stat RF_requestAccess (RF_Handle h, RF_AccessParams *pParams)
 Request radio access. More...
 

Macro Definition Documentation

#define RF_GET_RSSI_ERROR_VAL   (-128)

Error return value for RF_getRssi()

#define RF_CMDHANDLE_FLUSH_ALL   (-1)

RF command handle to flush all RF commands.

#define RF_ALLOC_ERROR   (-2)

RF command or RAT channel allocation error.

#define RF_ERROR_INVALID_RFMODE   (-256)

Invalid RF_Mode. Used in error callback.

#define RF_ERROR_CMDFS_SYNTH_PROG   (-257)

Synthesizer error with CMD_FS. Used in error callback. If this error occurred in error callback, user needs to resend CMD_Fs to recover. See errata SWRA521.

Typedef Documentation

typedef rfc_radioOp_t RF_Op

Alias for the data type of the header common to all radio operations.

typedef uint64_t RF_EventMask

Event mask type (construct mask with combinations of RF_EventMask)

typedef int16_t RF_CmdHandle

A command handle that is returned from RF_postCmd() Used by RF_pendCmd() and RF_flushCmd(). A negative value indicates an error.

RF Hardware attributes.

typedef RF_Object* RF_Handle

A handle that is returned from a RF_open() call Used for further RF client interaction with the RF driver.

typedef void(* RF_Callback) (RF_Handle h, RF_CmdHandle ch, RF_EventMask e)

RF callback function pointer type RF callbacks can occur at the completion of posted RF operation (chain). The callback is called from SWI context and provides the relevant RF_Handle, relevant radio operation command handle RF_CmdHandle, as well as an RF_EventMask that indicates what has occurred. in the case of error callback the RF_CmdHandle will indicate the error code.

Enumeration Type Documentation

Priority of RF commands.

Enumerator
RF_PriorityHighest 

Highest, use sparingly.

RF_PriorityHigh 

High, time-critical commands in synchronous protocols.

RF_PriorityNormal 

Normal, usually best choice.

RF_PriorityLow 

Low, use for infinite or background commands.

enum RF_Stat

RF Stat reported as return value for RF_ratCmd(), RF_getRssi(). RF_setTxPwr(), RF_cancelCmd()

Enumerator
RF_StatBusyError 

Cmd not executed as RF driver is busy.

RF_StatRadioInactiveError 

Cmd not executed as radio is inactive.

RF_StatCmdDoneError 

Cmd done but with error in CMDSTA.

RF_StatInvalidParamsError 

Invalid API parameters.

RF_StatError 

General error specifier.

RF_StatCmdDoneSuccess 

Cmd done and Successful.

RF_StatCmdSch 

Cmd scheduled for execution.

RF_StatSuccess 

API ran successfully.

RF_getParamsType contains the options available for using the RF_getParams()

Enumerator
RF_GET_CURR_CMD 

Get RF_CmdHandle for current cmd.

RF_GET_AVAIL_RAT_CH 

Get bitmap for the avail RAT channel.

RF_GET_RADIO_STATE 

Get Radio state 0: Radio OFF, 1: Radio ON.

Function Documentation

RF_Handle RF_open ( RF_Object pObj,
RF_Mode pRfMode,
RF_RadioSetup pOpSetup,
RF_Params params 
)

Open client connection to RF driver.

Allows a RF client (high-level driver or application) to request access to RF hardware.

Note
Calling context : Task
This API does not start the radio.
For dual mode operation, rfMode in the RF_Mode struct must be set to RF_MODE_MULTIPLE.
Parameters
pObjPointer to a RF_Object that will hold the state for this RF client. The object must be in persistent and writeable memory
pRfModePointer to a RF_Mode struct holding patch information
pOpSetupPointer to the setup command used in this RF configuration. This is used by RF Driver during power-up so the user should allocated setup command in persistent memory.
paramsPointer to an RF_Params object that is initialized with desired RF parameters. Can be set to NULL for defaults
Returns
A handle for further RF driver calls or NULL if a client connection was not possible or the supplied parameters invalid
void RF_close ( RF_Handle  h)

Close client connection to RF driver.

Allows a RF client (high-level driver or application) to close its connection to the RF driver.

Note
Calling context : Task
Parameters
hHandle previously returned by RF_open()
uint32_t RF_getCurrentTime ( void  )

Return current radio timer value.

If the radio is powered returns the current radio timer value, if not returns a conservative estimate of the current radio timer value

Note
Calling context : Task/SWI/HWI
Returns
Current radio timer value
RF_CmdHandle RF_postCmd ( RF_Handle  h,
RF_Op pOp,
RF_Priority  ePri,
RF_Callback  pCb,
RF_EventMask  bmEvent 
)

Post an RF operation (chain) to the command queue Post an RF_Op to the RF command queue of the client with handle h.
The command can be the first in a chain of RF operations or a standalone RF operation. If a chain of operations are posted they are treated atomically, i.e. either all or none of the chained operations are run.
All operations must be posted in strictly increasing chronological order. Function returns immediately.

Limitations apply to the operations posted:

  • The operation must be in the set supported in the chosen radio mode when RF_open() was called
  • Only a subset of radio operations are supported
  • Only some of the trigger modes are supported
    • TRIG_NOW, TRIG_ABSTIME
  • Only some of the conditional execution modes are supported
    • COND_ALWAYS, COND_NEVER
Note
Calling context : Task/SWI
Parameters
hHandle previously returned by RF_open()
pOpPointer to the RF_Op. Must normally be in persistent and writeable memory
ePriPriority of this RF command (used for arbitration in multi-client systems)
pCbCallback function called upon command completion (and some other events). If RF_postCmd() fails no callback is made
bmEventBitmask of events that will trigger the callback.
Returns
A handle to the RF command. Return value of RF_ALLOC_ERROR indicates error.
RF_CmdHandle RF_scheduleCmd ( RF_Handle  h,
RF_Op pOp,
RF_ScheduleCmdParams pSchParams,
RF_Callback  pCb,
RF_EventMask  bmEvent 
)

Schedule an RF operation (chain) to the command queue Schedule an RF_Op to the RF command queue of the client with handle h.
The command can be the first in a chain of RF operations or a standalone RF operation. If a chain of operations are posted they are treated atomically, i.e. either all or none of the chained operations are run.
All operations must be posted in strictly increasing chronological order. Function returns immediately.

Limitations apply to the operations posted:

  • The operation must be in the set supported in the chosen radio mode when RF_open() was called
  • Only a subset of radio operations are supported
  • Only some of the trigger modes are supported with potential power saving (TRIG_NOW, TRIG_ABSTIME)
Note
Calling context : Task/SWI
Parameters
hHandle previously returned by RF_open()
pOpPointer to the RF_Op. Must normally be in persistent and writeable memory
pSchParamsPointer to the schdule command parameter structure
pCbCallback function called upon command completion (and some other events). If RF_scheduleCmd() fails no callback is made
bmEventBitmask of events that will trigger the callback.
Returns
A handle to the RF command. Return value of RF_ALLOC_ERROR indicates error.
RF_EventMask RF_pendCmd ( RF_Handle  h,
RF_CmdHandle  ch,
RF_EventMask  bmEvent 
)

Wait for posted command to complete Wait until completion of RF command identified by handle ch for client identified by handle h to complete.
Some RF operations (or chains of operations) post additional events during execution which, if enabled in event mask bmEvent, will make RF_pendCmd() return early. In this case, multiple calls to RF_pendCmd() for a single command can be made.
If RF_pendCmd() is called for a command that registered a callback function it will take precedence and the callback function will never be called.

Note
Calling context : Task
Only one call to RF_pendCmd() or RF_runCmd() can be made at a time for each client
Returns immediately if command has already run or has been aborted/cancelled
Parameters
hHandle previously returned by RF_open()
chCommand handle previously returned by RF_postCmd().
bmEventBitmask of events that make RF_pendCmd() return. The command done event can not be masked away.
Returns
The relevant RF_EventMask (including RF_EventCmdDone) for the command or last command in a chain
RF_EventMask RF_runCmd ( RF_Handle  h,
RF_Op pOp,
RF_Priority  ePri,
RF_Callback  pCb,
RF_EventMask  bmEvent 
)

Runs synchronously a (chain of) RF operation(s) Allows a (chain of) operation(s) to be posted to the command queue and then waits for it to complete.

Note
Calling context : Task
Only one call to RF_pendCmd() or RF_runCmd() can be made at a time for each client
Parameters
hHandle previously returned by RF_open()
pOpPointer to the RF_Op. Must normally be in persistent and writeable memory
ePriPriority of this RF command (used for arbitration in multi-client systems)
pCbCallback function called upon command completion (and some other events). If RF_runCmd() fails no callback is made
bmEventBitmask of events that will trigger the callback.
Returns
The relevant RF_EventMask (including RF_EventLastCmdDone) for the last command.
RF_Stat RF_cancelCmd ( RF_Handle  h,
RF_CmdHandle  ch,
uint8_t  mode 
)

Abort/stop/cancel single command in command queue If command is running, aborts/stops it and posts callback for the aborted/stopped command.
If command has not yet run, cancels it it and posts callback for the cancelled command.
If command has already run or been aborted/stopped/cancelled, has no effect.

Note
Calling context : Task/SWI
Parameters
hHandle previously returned by RF_open()
chCommand handle previously returned by RF_postCmd().
mode1: Stop gracefully, 0: abort abruptly
Returns
RF_Stat indicates if command was successfully completed
RF_Stat RF_flushCmd ( RF_Handle  h,
RF_CmdHandle  ch,
uint8_t  mode 
)

Abort/stop/cancel command and any subsequent commands in command queue If command is running, aborts/stops it and then cancels all later commands in queue.
If command has not yet run, cancels it and all later commands in queue.
If command has already run or been aborted/stopped/cancelled, has no effect.

The callbacks for all cancelled commands are issued in chronological order.

Note
Calling context : Task/SWI
Parameters
hHandle previously returned by RF_open()
chCommand handle previously returned by RF_postCmd().
mode1: Stop gracefully, 0: abort abruptly
Returns
RF_Stat indicates if command was successfully completed
RF_Stat RF_runImmediateCmd ( RF_Handle  h,
uint32_t *  pCmdStruct 
)

Send any Immediate command.

Immediate Comamnd is send to RDBELL, if radio is active and the RF_Handle points to the current client.
In other appropriate RF_Stat values are returned.

Note
Calling context : Task/SWI/HWI
Parameters
hHandle previously returned by RF_open()
pCmdStructPointer to the immediate command structure
Returns
RF_Stat indicates if command was successfully completed
RF_Stat RF_runDirectCmd ( RF_Handle  h,
uint32_t  cmd 
)

Send any Direct command.

Direct Comamnd value is send to RDBELL immediately, if radio is active and the RF_Handle point to the current client.
In other appropriate RF_Stat values are returned.

Note
Calling context : Task/SWI/HWI
Parameters
hHandle previously returned by RF_open()
cmdDirect command value.
Returns
RF_Stat indicates if command was successfully completed.
void RF_yield ( RF_Handle  h)

Signal that radio client is not going to issue more commands in a while.

Hint to RF driver that, irrespective of inactivity timeout, no new further commands will be issued for a while and thus the radio can be powered down at the earliest convenience.

Note
Calling context : Task
Parameters
hHandle previously returned by RF_open()
void RF_Params_init ( RF_Params params)

Function to initialize the RF_Params struct to its defaults.

Parameters
paramsAn pointer to RF_Params structure for initialization

Defaults values are: nInactivityTimeout = BIOS_WAIT_FOREVER nPowerUpDuration = RF_DEFAULT_POWER_UP_TIME bPowerUpXOSC = TRUE

RF_Stat RF_getInfo ( RF_Handle  h,
RF_InfoType  type,
RF_InfoVal pValue 
)

Get value for some RF driver parameters.

Note
Calling context : Task/SWI/HWI
Parameters
hHandle previously returned by RF_open()
typeRequest value paramter defined by RF_InfoType
pValuePointer to return parameter values specified by RF_InfoVal
Returns
RF_Stat indicates if command was successfully completed
int8_t RF_getRssi ( RF_Handle  h)

Get rssi value.

Note
Calling context : Task/SWI/HWI
Parameters
hHandle previously returned by RF_open()
Returns
RSSI value. Return value of RF_GET_RSSI_ERROR_VAL indicates error case.
RF_Op* RF_getCmdOp ( RF_Handle  h,
RF_CmdHandle  cmdHnd 
)

Get command structure pointer.

Note
Calling context : Task/SWI/HWI
Parameters
hHandle previously returned by RF_open()
cmdHndCommand handle returned by RF_postCmd()
Returns
Pointer to the command structure.
int8_t RF_ratCompare ( RF_Handle  h,
rfc_CMD_SET_RAT_CMP_t *  pCmdStruct,
uint32_t  compareTime,
RF_Callback  pRatCb 
)

Setup RAT compare, and callback when compare matches. Note radio needs to be on for RAT to operate. If radio is off, this API returns RF_ALLOC_ERROR.

Note
Calling context : Task/SWI
Parameters
hHandle previously returned by RF_open()
pCmdStructPointer to the RAT compare command structure.
compareTimeCompare time in RAT ticks
pRatCbCallback function when capture event happens
Returns
Allocated RAT channel. Returned value RF_ALLOC_ERROR indicates error.
int8_t RF_ratCapture ( RF_Handle  h,
uint16_t  config,
RF_Callback  pRatCb 
)

Setup RAT capture, and callback when capture event happens. Note radio needs to be on for RAT to operate. If radio is off, this API returns RF_ALLOC_ERROR.

Note
Calling context : Task/SWI
Parameters
hHandle previously returned by RF_open()
configConfig field of RAT capture command structure
pRatCbCallback function when capture event happens
Returns
Allocated RAT channel. Returned value RF_ALLOC_ERROR indicates error.
RF_Stat RF_ratHwOutput ( RF_Handle  h,
uint16_t  config 
)

Setup RAT HW output. Note radio needs to be on for RAT to operate. If radio is off, this API returns RF_ALLOC_ERROR.

Note
Calling context : Task/SWI
Parameters
hHandle previously returned by RF_open()
configConfig field of RAT HW output command structure
Returns
RF_Stat indicates if command was successfully completed
RF_Stat RF_ratDisableChannel ( RF_Handle  h,
int8_t  ratChannelNum 
)

Disable a RAT channel.

Note
Calling context : Task/SWI
Parameters
hHandle previously returned by RF_open()
ratChannelNumRAT channel number to be disabled
Returns
RF_Stat indicates if command was successfully completed.
RF_Stat RF_control ( RF_Handle  h,
int8_t  ctrl,
void *  args 
)

Set RF control parameters.

Note
Calling context : Task
Parameters
hHandle previously returned by RF_open()
ctrlControl codes
argsPointer to control arguments
Returns
RF_Stat indicates if API call was successfully completed.
RF_Stat RF_requestAccess ( RF_Handle  h,
RF_AccessParams pParams 
)

Request radio access.

Note
Calling context : Task
Parameters
hHandle previously returned by RF_open()
pParamsPointer to request access parameters
Returns
RF_Stat indicates if API call was successfully completed.
Copyright 2016, Texas Instruments Incorporated