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

Go to the source code of this file.

Data Structures

struct  RCL_SchedulerStopInfo
 
struct  RCL_SchedulerState
 

Macros

#define RCL_SCHEDULER_SYSTIM_US(x)   (((uint32_t) (x)) * 4U)
 
#define RCL_SCHEDULER_SYSTIM_MS(x)   (((uint32_t) (x)) * 4U * 1000U)
 
#define ABS_START_TIME_OFFSET   RCL_SCHEDULER_SYSTIM_US(100U)
 
#define IMM_START_TIME_OFFSET   RCL_SCHEDULER_SYSTIM_US(90U)
 
#define RCL_SCHEDULER_MARGIN_ARM   RCL_SCHEDULER_SYSTIM_US(40U)
 
#define RCL_SCHEDULER_MARGIN_CONFIGURE   RCL_SCHEDULER_SYSTIM_US(76U)
 
#define RCL_SCHEDULER_MARGIN_LOAD   RCL_SCHEDULER_SYSTIM_US(460U)
 
#define RCL_SCHEDULER_SLEEP_CUTOFF   RCL_SCHEDULER_SYSTIM_MS(10U)
 
#define RCL_SCHEDULER_TRIG_NOW_DELAY   RCL_SCHEDULER_SYSTIM_US(50U)
 
#define RCL_SCHEDULER_WAKEUP_MARGIN   RCL_SCHEDULER_SYSTIM_US(1000U)
 

Enumerations

enum  RCL_SchedulerStopReason { RCL_SchedulerStopReason_None = 0, RCL_SchedulerStopReason_Timeout = 1, RCL_SchedulerStopReason_Scheduling = 2, RCL_SchedulerStopReason_Api = 3 }
 
enum  RCL_SchedulerStopTimeState { RCL_SchedulerStopTimeState_Init = 0, RCL_SchedulerStopTimeState_Found = 1, RCL_SchedulerStopTimeState_Programmed = 2 }
 

Functions

RCL_CommandStatus RCL_Scheduler_findStopStatus (RCL_StopType stopType)
 Get relevant status when a command was stopped. More...
 
RCL_CommandStatus RCL_Scheduler_setStartStopTime (const RCL_Command *cmd)
 Set start and stop time for LRF based on command. More...
 
RCL_CommandStatus RCL_Scheduler_setStartStopTimeEarliestStart (const RCL_Command *cmd, uint32_t earliestStartTime)
 Set start and stop time for LRF based on command with earliest start time. More...
 
RCL_CommandStatus RCL_Scheduler_setCustomStartStopTime (const RCL_CommandTiming *timing, RCL_ScheduleType scheduling, bool allowDelay)
 Set start and stop time for LRF. More...
 
RCL_CommandStatus RCL_Scheduler_setCustomStartStopTimeEarliestStart (const RCL_CommandTiming *timing, RCL_ScheduleType scheduling, bool allowDelay, uint32_t earliestStartTime)
 Set start and stop time for LRF with earliest start time. More...
 
RCL_CommandStatus RCL_Scheduler_setCmdStopTimeNoStartTrigger (const RCL_Command *cmd)
 Set stop time for LRF based on command when it does not need a start trigger. More...
 
RCL_CommandStatus RCL_Scheduler_setNewStartNow (void)
 Set new start time for LRF to now, after a previous start. More...
 
RCL_CommandStatus RCL_Scheduler_setNewStartAbsTime (uint32_t startTime, bool allowDelay)
 Set new start time for LRF to given absolute time, after a previous start. More...
 
RCL_CommandStatus RCL_Scheduler_setNewStartRelTime (uint32_t relStartTime)
 Set new start time for LRF to given time relative to previous LRF start. More...
 
RCL_StopType RCL_Scheduler_setStopTimes (void)
 Function to apply relevant stop times. More...
 
bool RCL_Scheduler_isLater (uint32_t refTime, uint32_t chkTime)
 Find if a time instant occurs after another, allowing wrap-around. More...
 
int32_t RCL_Scheduler_delta (uint32_t refTime, uint32_t chkTime)
 Find the time difference between two times, allowing wrap-around. More...
 
static uint32_t RCL_Scheduler_getCurrentTime (void)
 Get current time. More...
 
RCL_StopType RCL_Scheduler_setSchedStopTime (RCL_SchedulerStopInfo *stopInfo, uint32_t schedStopTime)
 Set scheduler stop time. More...
 
RCL_StopType RCL_Scheduler_setCmdStopTime (RCL_SchedulerStopInfo *stopInfo, uint32_t cmdStopTime)
 Set command stop time. More...
 
RCL_StopType RCL_Scheduler_cancelSchedStopTime (RCL_SchedulerStopInfo *stopInfo)
 Cancel scheduler stop time. More...
 
RCL_StopType RCL_Scheduler_cancelCmdStopTime (RCL_SchedulerStopInfo *stopInfo)
 Cancel command stop time. More...
 
bool RCL_Scheduler_postEvent (RCL_Command_Handle c, RCL_Events e)
 Post event to command handler. More...
 

Variables

RCL_SchedulerState rclSchedulerState
 

Data Structure Documentation

§ RCL_SchedulerStopInfo

struct RCL_SchedulerStopInfo
Data Fields
uint32_t cmdStopEnabled: 1
uint32_t schedStopEnabled: 1
uint32_t apiStopEnabled: 1
RCL_SchedulerStopReason stopReason: 2
uint32_t cmdStopTime
uint32_t schedStopTime

§ RCL_SchedulerState

struct RCL_SchedulerState
+ Collaboration diagram for RCL_SchedulerState:
Data Fields
RCL_Command * currCmd
uint32_t nextWantsStop: 1
RCL_SchedulerStopTimeState stopTimeState: 2
RCL_SchedulerStopReason descheduleReason: 2
RCL_Events postedRclEvents
uint32_t actualStartTime
RCL_SchedulerStopInfo hardStopInfo
RCL_SchedulerStopInfo gracefulStopInfo
uint16_t requestedPhyFeatures

Macro Definition Documentation

§ RCL_SCHEDULER_SYSTIM_US

#define RCL_SCHEDULER_SYSTIM_US (   x)    (((uint32_t) (x)) * 4U)

Number of ticks in the given number of microseconds

Referenced by RCL_Handler_BLE5_adv(), RCL_Handler_BLE5_aux_adv(), and RCL_Handler_BLE5_scan_init().

§ RCL_SCHEDULER_SYSTIM_MS

#define RCL_SCHEDULER_SYSTIM_MS (   x)    (((uint32_t) (x)) * 4U * 1000U)

Number of ticks in the given number of milliseconds

§ ABS_START_TIME_OFFSET

#define ABS_START_TIME_OFFSET   RCL_SCHEDULER_SYSTIM_US(100U)

Delay from scheduled start to start trigger to LRF

§ IMM_START_TIME_OFFSET

#define IMM_START_TIME_OFFSET   RCL_SCHEDULER_SYSTIM_US(90U)

Delay from immediate start to start trigger to LRF

§ RCL_SCHEDULER_MARGIN_ARM

#define RCL_SCHEDULER_MARGIN_ARM   RCL_SCHEDULER_SYSTIM_US(40U)

Time to prepare FIFO + PBE

Referenced by rclSchedulerHwi().

§ RCL_SCHEDULER_MARGIN_CONFIGURE

#define RCL_SCHEDULER_MARGIN_CONFIGURE   RCL_SCHEDULER_SYSTIM_US(76U)

Time to reload REGBANKs

Referenced by rclSchedulerHwi().

§ RCL_SCHEDULER_MARGIN_LOAD

#define RCL_SCHEDULER_MARGIN_LOAD   RCL_SCHEDULER_SYSTIM_US(460U)

Time to load TOPsm images

Referenced by __attribute__(), and rclSchedulerHwi().

§ RCL_SCHEDULER_SLEEP_CUTOFF

#define RCL_SCHEDULER_SLEEP_CUTOFF   RCL_SCHEDULER_SYSTIM_MS(10U)

Time margin when not to arm LRF immediately

Referenced by rclSchedulerHwi().

§ RCL_SCHEDULER_TRIG_NOW_DELAY

#define RCL_SCHEDULER_TRIG_NOW_DELAY   RCL_SCHEDULER_SYSTIM_US(50U)

Delay to add to current time to allow start to be in the future

Referenced by rclSchedulerHwi(), and rclSchedulerProcessCmdStartStopTime().

§ RCL_SCHEDULER_WAKEUP_MARGIN

#define RCL_SCHEDULER_WAKEUP_MARGIN   RCL_SCHEDULER_SYSTIM_US(1000U)

Wakeup margin to allow for varying command and setup time

Referenced by rclSchedulerHwi().

Enumeration Type Documentation

§ RCL_SchedulerStopReason

Enumerator
RCL_SchedulerStopReason_None 

No stop active

RCL_SchedulerStopReason_Timeout 

Command stop time is active

RCL_SchedulerStopReason_Scheduling 

Scheduler stop is active

RCL_SchedulerStopReason_Api 

API stop has been sent and will take precedence

§ RCL_SchedulerStopTimeState

Enumerator
RCL_SchedulerStopTimeState_Init 

Stop times not calculated or programmed

RCL_SchedulerStopTimeState_Found 

Stop times calculated, but not programmed

RCL_SchedulerStopTimeState_Programmed 

Stop times calculated and programmed to timer

Variable Documentation

§ rclSchedulerState