Radio Control Layer (RCL)
RCL_Command.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/rcl/RCL_Types.h>
#include <ti/drivers/rcl/RCL_Event.h>
#include <ti/drivers/rcl/LRF.h>
+ Include dependency graph for RCL_Command.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RCL_CommandRuntime
 Command runtime structure. More...
 
struct  RCL_CommandTiming
 Command timing structure. More...
 
struct  RCL_Command
 General command. More...
 
union  RCL_Command_CoexControl
 Type for Coex control. More...
 
struct  RCL_Command_CoexControl.__unnamed__
 

Macros

#define RCL_CommandStatus_isAnyStop(x)   (((x) >= RCL_CommandStatus_DescheduledApi) && ((x) <= RCL_CommandStatus_HardStopScheduling))
 
#define RCL_CommandStatus_isAnyDescheduled(x)   (((x) >= RCL_CommandStatus_DescheduledApi) && ((x) <= RCL_CommandStatus_DescheduledScheduling))
 
#define RCL_CommandStatus_isAnyGracefulStop(x)   (((x) >= RCL_CommandStatus_GracefulStopTimeout) && ((x) <= RCL_CommandStatus_GracefulStopScheduling))
 
#define RCL_CommandStatus_isAnyHardStop(x)   (((x) >= RCL_CommandStatus_HardStopTimeout) && ((x) <= RCL_CommandStatus_HardStopScheduling))
 
#define RCL_CommandStatus_isAnyTimeoutStop(x)   (((x) == RCL_CommandStatus_GracefulStopTimeout) || ((x) == RCL_CommandStatus_HardStopTimeout))
 
#define RCL_CommandStatus_isAnyApiStop(x)   (((x) == RCL_CommandStatus_DescheduledApi) || ((x) == RCL_CommandStatus_GracefulStopApi) || ((x) == RCL_CommandStatus_HardStopApi))
 
#define RCL_CommandStatus_isAnySchedulingStop(x)   (((x) == RCL_CommandStatus_DescheduledScheduling) || ((x) == RCL_CommandStatus_GracefulStopScheduling) || ((x) == RCL_CommandStatus_HardStopScheduling))
 
#define RCL_Command_Default(_id, _handler)
 
#define RCL_Command_DefaultRuntime(_id, _handler)   (RCL_Command) RCL_Command_Default(_id, _handler)
 

Typedefs

typedef RCL_Events(* RCL_CommandHandler) (RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEvents)
 Command handler function type. More...
 
typedef void(* RCL_Callback) (RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEvents)
 Callback function type. More...
 
typedef LRF_TxPowerTable_Index RCL_Command_TxPower
 Type for TX power. More...
 

Enumerations

enum  RCL_CommandStatus {
  RCL_CommandStatus_Idle = 0, RCL_CommandStatus_Queued, RCL_CommandStatus_Scheduled, RCL_CommandStatus_Active,
  RCL_CommandStatus_Suspended, RCL_CommandStatus_Deferred, RCL_CommandStatus_Finished = 0x10, RCL_CommandStatus_ChannelIdle,
  RCL_CommandStatus_ChannelBusy, RCL_CommandStatus_RxTimeout, RCL_CommandStatus_NoSync, RCL_CommandStatus_RxErr,
  RCL_CommandStatus_RejectedStart, RCL_CommandStatus_UnexpectedMdrRx, RCL_CommandStatus_CoexNoGrant, RCL_CommandStatus_DescheduledApi = 0x31,
  RCL_CommandStatus_DescheduledScheduling, RCL_CommandStatus_GracefulStopTimeout = 0x34, RCL_CommandStatus_GracefulStopApi, RCL_CommandStatus_GracefulStopScheduling,
  RCL_CommandStatus_HardStopTimeout = 0x38, RCL_CommandStatus_HardStopApi, RCL_CommandStatus_HardStopScheduling, RCL_CommandStatus_Connect = 0x40,
  RCL_CommandStatus_MaxNak, RCL_CommandStatus_MaxAuxWaitTimeExceeded, RCL_CommandStatus_FramePending, RCL_CommandStatus_Error = 0x80,
  RCL_CommandStatus_Error_Setup, RCL_CommandStatus_Error_Param, RCL_CommandStatus_Error_MissingTxBuffer, RCL_CommandStatus_Error_TxBufferCorruption,
  RCL_CommandStatus_Error_RxBufferCorruption, RCL_CommandStatus_Error_StartTooLate, RCL_CommandStatus_Error_TxFifo, RCL_CommandStatus_Error_RxFifo,
  RCL_CommandStatus_Error_Synth, RCL_CommandStatus_Error_UnknownOp, RCL_CommandStatus_Error_AlreadySubmitted, RCL_CommandStatus_Error_CommandQueueFull
}
 Command status. More...
 
enum  RCL_StopType { RCL_StopType_None = 0, RCL_StopType_DescheduleOnly, RCL_StopType_Graceful, RCL_StopType_Hard }
 Stop types. More...
 
enum  RCL_ScheduleType { RCL_Schedule_Now = 0, RCL_Schedule_AbsTime = 1 }
 Schedule type. More...
 
enum  RCL_ConflictPolicy { RCL_ConflictPolicy_AlwaysInterrupt = 0, RCL_ConflictPolicy_Polite = 1, RCL_ConflictPolicy_NeverInterrupt = 2 }
 Conflict resolution policy. More...
 
enum  RCL_Command_CoexPriority { RCL_CoexPriority_Low = 0, RCL_CoexPriority_High = 1 }
 Type for Coex priority. More...
 
enum  RCL_Command_CoexRxMode { RCL_CoexRxMode_AlwaysRequest = 0, RCL_CoexRxMode_RequestOnPacket = 1 }
 Type for Coex receive mode. More...
 

Functions

static void RCL_Command_setRawTxPower (uint32_t registerSetting, uint32_t temperatureCoefficient)
 Set raw TX power. More...
 

Data Structure Documentation

§ RCL_CommandRuntime_s

struct RCL_CommandRuntime_s

Command runtime structure.

Holds information on running the command

Data Fields
RCL_CommandHandler handler

Command handler to use for this command

RCL_Client * client

Client

LRF_Events lrfCallbackMask

Callbacks enabled for events directly from LRF

RCL_Events rclCallbackMask

Callbacks enabled for events generated in RCL

RCL_Callback callback

Callback function

§ RCL_CommandTiming_s

struct RCL_CommandTiming_s

Command timing structure.

Holds information on the timing of the command

Data Fields
uint32_t absStartTime

Unless timing is Schedule_Now: Start time of the command on SYSTIM (0.25 us steps)

uint32_t relMinTime

For scheduler: Minimum time command must be allowed to run (0.25 us steps). Not supported in this version.

int32_t relGracefulStopTime

Time to initiate graceful stop of command. If negative: Relative to hardStopTime, otherwise relative to startTime (0.25 us steps). 0: Not used

uint32_t relHardStopTime

Time to stop the command as soon as possible; relative to start time (0.25 us steps). 0: Not used.

§ RCL_Command_s

struct RCL_Command_s

General command.

Fields common for all commands

Data Fields
uint16_t cmdId

Command ID

uint16_t phyFeatures

PHY feature selector; use 0 if only one PHY

RCL_ScheduleType scheduling: 8

Scheduling type

RCL_CommandStatus status: 8

Status of command

RCL_ConflictPolicy conflictPolicy: 8

Conflict resolution policy

bool allowDelay

Start may be delayed

RCL_CommandRuntime runtime

Runtime information

RCL_CommandTiming timing

Timing information

§ RCL_Command_CoexControl

union RCL_Command_CoexControl

Type for Coex control.

Control which coex lines to enable, for commands supporting the feature

Data Fields
struct RCL_Command_CoexControl __unnamed__
uint8_t value

§ RCL_Command_CoexControl.__unnamed__

struct RCL_Command_CoexControl.__unnamed__
Data Fields
uint8_t grantEnable: 1

Enable GRANT line as an input according to global configuration

uint8_t requestPriorityEnable: 1

Enable REQUEST and PRIORITY lines according to global configuration

RCL_Command_CoexPriority priority: 1

Priority level to signal

RCL_Command_CoexRxMode rxMode: 1

RX mode for operation

uint8_t reserved: 4

Macro Definition Documentation

§ RCL_CommandStatus_isAnyStop

#define RCL_CommandStatus_isAnyStop (   x)    (((x) >= RCL_CommandStatus_DescheduledApi) && ((x) <= RCL_CommandStatus_HardStopScheduling))

Helper macros to compare command status

Referenced by RCL_Handler_Ieee_RxTx().

§ RCL_CommandStatus_isAnyDescheduled

#define RCL_CommandStatus_isAnyDescheduled (   x)    (((x) >= RCL_CommandStatus_DescheduledApi) && ((x) <= RCL_CommandStatus_DescheduledScheduling))

§ RCL_CommandStatus_isAnyGracefulStop

#define RCL_CommandStatus_isAnyGracefulStop (   x)    (((x) >= RCL_CommandStatus_GracefulStopTimeout) && ((x) <= RCL_CommandStatus_GracefulStopScheduling))

§ RCL_CommandStatus_isAnyHardStop

#define RCL_CommandStatus_isAnyHardStop (   x)    (((x) >= RCL_CommandStatus_HardStopTimeout) && ((x) <= RCL_CommandStatus_HardStopScheduling))

§ RCL_CommandStatus_isAnyTimeoutStop

#define RCL_CommandStatus_isAnyTimeoutStop (   x)    (((x) == RCL_CommandStatus_GracefulStopTimeout) || ((x) == RCL_CommandStatus_HardStopTimeout))

§ RCL_CommandStatus_isAnyApiStop

#define RCL_CommandStatus_isAnyApiStop (   x)    (((x) == RCL_CommandStatus_DescheduledApi) || ((x) == RCL_CommandStatus_GracefulStopApi) || ((x) == RCL_CommandStatus_HardStopApi))

§ RCL_CommandStatus_isAnySchedulingStop

#define RCL_CommandStatus_isAnySchedulingStop (   x)    (((x) == RCL_CommandStatus_DescheduledScheduling) || ((x) == RCL_CommandStatus_GracefulStopScheduling) || ((x) == RCL_CommandStatus_HardStopScheduling))

§ RCL_Command_Default

#define RCL_Command_Default (   _id,
  _handler 
)
Value:
{ \
.cmdId = _id, \
.phyFeatures = 0, \
.scheduling = RCL_Schedule_Now, \
.allowDelay = false, \
.runtime = { \
.handler = _handler, \
}, \
.timing = { \
.absStartTime = 0, \
.relGracefulStopTime = 0, \
.relHardStopTime = 0, \
}, \
}
Definition: RCL_Command.h:158
Definition: RCL_Command.h:168
Definition: RCL_Command.h:87

§ RCL_Command_DefaultRuntime

#define RCL_Command_DefaultRuntime (   _id,
  _handler 
)    (RCL_Command) RCL_Command_Default(_id, _handler)

Typedef Documentation

§ RCL_CommandHandler

typedef RCL_Events(* RCL_CommandHandler) (RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEvents)

Command handler function type.

§ RCL_Callback

typedef void(* RCL_Callback) (RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEvents)

Callback function type.

§ RCL_Command_TxPower

Type for TX power.

The wanted TX power to program; the RCL will select the highest available power smaller than or equal to the requested setting.

Special settings: LRF_TxPower_Use_Min: Use minimum available TX power LRF_TxPower_Use_Max: Use maximum available TX power LRF_TxPower_Use_Raw: Use a raw TX power register setting given with RCL_Command_setRawTxPower() LRF_TxPower_None: Do not write TX power

Enumeration Type Documentation

§ RCL_CommandStatus

Command status.

Gives information on the command, and if finished, how it finished.

Enumerator
RCL_CommandStatus_Idle 

Command is not yet run. This state is mandatory when submitting.

RCL_CommandStatus_Queued 

Command is queued, but pending end of previous command

RCL_CommandStatus_Scheduled 

Command is scheduled, pending start time.

RCL_CommandStatus_Active 

Command is currently running.

RCL_CommandStatus_Suspended 

Command is suspended and will resume once the othe running commands have finished

RCL_CommandStatus_Deferred 

Command is deferred.

RCL_CommandStatus_Finished 

Command has finished normally

RCL_CommandStatus_ChannelIdle 

Channel assessment has finished with channel idle

RCL_CommandStatus_ChannelBusy 

Channel assessment has finished with channel busy

RCL_CommandStatus_RxTimeout 

Command timed out waiting for sync

RCL_CommandStatus_NoSync 

Command timed out waiting for a returned packet from peer device

RCL_CommandStatus_RxErr 

Command ended due to errors with the received packet (e.g, CRC errors)

RCL_CommandStatus_RejectedStart 

Command was rejected start due to scheduling parameters

RCL_CommandStatus_UnexpectedMdrRx 

Command ended because an MDR packet was received when we have MDR disabled

RCL_CommandStatus_CoexNoGrant 

Command ended because the coexistence procedure did not allow operation

RCL_CommandStatus_DescheduledApi 

Command was descheduled before starting running in the radio because stop API was called

RCL_CommandStatus_DescheduledScheduling 

Command was descheduled before starting running in the radio due to scheduling of another command

RCL_CommandStatus_GracefulStopTimeout 

Command ended because graceful stop time was reached

RCL_CommandStatus_GracefulStopApi 

Command ended because stop API was called with RCL_StopType_Graceful argument

RCL_CommandStatus_GracefulStopScheduling 

Command ended due to scheduling where interrupting command had RCL_ConflictPolicy_Polite

RCL_CommandStatus_HardStopTimeout 

Command ended because hard stop time was reached

RCL_CommandStatus_HardStopApi 

Command ended because stop API was called with RCL_StopType_Hard argument

RCL_CommandStatus_HardStopScheduling 

Command ended due to scheduling where interrupting command had RCL_ConflictPolicy_AlwaysInterrupt

RCL_CommandStatus_Connect 

Command has finished and a connection may be established (BLE5 advertiser and initiator)

RCL_CommandStatus_MaxNak 

Command ended because more subsequent NAKs than supported were received (BLE5)

RCL_CommandStatus_MaxAuxWaitTimeExceeded 

Command ended because the wait time for a new packet following an AuxPtr was exceeded (BLE5 scanner and initiator)

RCL_CommandStatus_FramePending 

Command or TX action ended after receiving ACK with frame pending bit set to 1 (IEEE 802.15.4)

RCL_CommandStatus_Error 

Command ended with unknown error

RCL_CommandStatus_Error_Setup 

Command ended because of an error in the setup

RCL_CommandStatus_Error_Param 

Command ended because of an error with a parameter

RCL_CommandStatus_Error_MissingTxBuffer 

Command ended because no TX buffer was available when required

RCL_CommandStatus_Error_TxBufferCorruption 

Command ended because of errors in TX buffer structure

RCL_CommandStatus_Error_RxBufferCorruption 

Command ended because of errors in RX buffer structure

RCL_CommandStatus_Error_StartTooLate 

Command ended because start time was in the past

RCL_CommandStatus_Error_TxFifo 

Command ended because of underflow of TX FIFO

RCL_CommandStatus_Error_RxFifo 

Command ended because of unsupported overflow of RX FIFO (no buffer to store packets)

RCL_CommandStatus_Error_Synth 

Command ended because of synth programming error

RCL_CommandStatus_Error_UnknownOp 

Command ended because radio did not recognize command; probably wrong image for given command

RCL_CommandStatus_Error_AlreadySubmitted 

Command is already submitted and planned or running and can't be submitted again without calling stop first

RCL_CommandStatus_Error_CommandQueueFull 

Command was not submitted because there is no space in the pending commands queue

§ RCL_StopType

Stop types.

Type of stop to perform

Enumerator
RCL_StopType_None 

No stop requested

RCL_StopType_DescheduleOnly 

Stop a command that is queued or pending start, but do not stop it from running

RCL_StopType_Graceful 

Stop the command gracefully, that is finish a packet or transaction in progress before ending

RCL_StopType_Hard 

Stop the command as soon as possible

§ RCL_ScheduleType

Schedule type.

The type of scheduling used for a command

Enumerator
RCL_Schedule_Now 

Schedule the command to start as soon as possible

RCL_Schedule_AbsTime 

Schedule command to start at a given time; give error if delays occur

§ RCL_ConflictPolicy

Conflict resolution policy.

How will this command interact with an already running and overlapping command

Enumerator
RCL_ConflictPolicy_AlwaysInterrupt 

Always stop a running command if necessary to run this command

RCL_ConflictPolicy_Polite 

Stop a running command unless it is communicating, i.e. transmitting or is actively receiving

RCL_ConflictPolicy_NeverInterrupt 

Never stop an ongoing command

§ RCL_Command_CoexPriority

Type for Coex priority.

Enumerator
RCL_CoexPriority_Low 

Low priority

RCL_CoexPriority_High 

High priority

§ RCL_Command_CoexRxMode

Type for Coex receive mode.

Enumerator
RCL_CoexRxMode_AlwaysRequest 

Always assert request while in RX

RCL_CoexRxMode_RequestOnPacket 

Request assert in RX only on indication of a packet to receive

Function Documentation

§ RCL_Command_setRawTxPower()

static void RCL_Command_setRawTxPower ( uint32_t  registerSetting,
uint32_t  temperatureCoefficient 
)
inlinestatic

Set raw TX power.

Set the TX power to be written directly into the TX power register applicable to the chip. The setting only applies to commands where the TX power is set to LRF_TxPower_Use_Raw

References LRF_setRawTxPower().