Command Types

The main CPU uses various commands to control the setup and behavior of the RF core. Three types of commands exist:

  • immediate commands
  • direct commands
  • radio operation commands

Immediate and direct commands execute immediately and return a status code RF_Stat upon completion. They are protocol-independent and often used to configure the RF core. Radio operation commands, in contrast, are more complex. They support various start and end triggers and may be connected towards complex command chains. Their execution can often take a long time.

Some immediate and direct commands can be used to interact with running radio operation commands, for instance, to trigger or abort execution.

Immediate and Direct Commands

Immediate commands are characterized by a command identifier (an unsigned integer) and additional parameters. They are executed via RF_runImmediateCmd() which returns a result when the command has completed. The CMD_SET_TX_POWER command, for instance, is an immediate command that configures the transmission output power and takes the desired level as a parameter:

#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
#include <ti/drivers/rf/RF.h>

rfc_CMD_SET_TX_POWER_s txPowerCommand =
{
    .commandNo = CMD_SET_TX_POWER,    // command identifier
    .txPower   = 0xAB3F               // value generated by SmartRF Studio
};
RF_Stat status = RF_runImmediateCmd(rfHandle, &txPowerCommand);

Direct commands behave like immediate commands, but do not have any parameters. They are executed via RF_runDirectCmd() by providing the command identifier.

The CMD_ABORT command is an example of a direct command. It stops the execution of any ongoing radio operation as soon as possible:

#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
#include <ti/drivers/rf/RF.h>

RF_Stat status = RF_runDirectCmd(rfHandle, CMD_ABORT);

A list of all direct and immediate commands can be obtained from the RF commands reference.

Radio Operation Commands

Radio operation commands are complex commands for RX and TX operation. Unlike direct and immediate commands, they pass several execution stages which may take a long time. In addition to certain command-specific parameters which can be also found in immediate commands, all radio operations provide a common subset of execution features:

Start triggers:Different trigger types specify when the command execution actually starts.
End triggers:Similar to start triggers, but define the end of execution.
Chaining:Multiple commands can be linked towards a chain. A chain executes without further assistance of the main CPU.
Conditions:The execution of subsequent commands may depend on the result of a previous command.
Callbacks:Each radio operation command may generate several callback events during execution and upon completion. These are command-specific.

Radio operations are divided into 3 groups:

Command Group Available on Defined in
Protocol-independent CC1310, CC1350 <ti/devices/${DEVICE_FAMILY}/driverlib/rf_common_cmd.h>
Proprietary CC1310, CC1350 <ti/devices/${DEVICE_FAMILY}/driverlib/rf_prop_cmd.h>
Bluetooth Low Energy (BLE) CC1350 <ti/devices/${DEVICE_FAMILY}/driverlib/rf_ble_cmd.h>

A list of all radio operation commands can be obtained from the RF commands reference.

Wrapping Immediate and Direct Commands as Radio Operations

Sometimes it is necessary to embed a direct or immediate command into a chain of radio operation commands, for instance, to execute it at a certain time. This can be achieved with the CMD_SCH_IMM command. The following example wraps the CMD_SET_TX_POWER from above:

#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
#include <ti/drivers/rf/RF.h>

rfc_CMD_SCH_IMM wrappedTxPowerCommand =
{
    .commandNo = CMD_SCH_IMM,
    .cmdrVal = &txPowerCommand
    // ... additional parameters which are defined for radio operation commands
    // ... for instance triggers and conditions
};
RF_CmdHandle wrappedTxPowerCommandHandle = RF_runCmd(rfHandle, &wrappedTxPowerCommand);