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_SchedulerStopTimeSelect { RCL_SchedulerStopTimeSelect_None = 0, RCL_SchedulerStopTimeSelect_Cmd = 1, RCL_SchedulerStopTimeSelect_Sched = 2 }
 
enum  RCL_SchedulerStopTimeState { RCL_SchedulerStopTimeState_Init = 0, RCL_SchedulerStopTimeState_Found = 1, RCL_SchedulerStopTimeState_Programmed = 2 }
 

Functions

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_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)
 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...
 
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_SchedulerStopTimeSelect stopTimeSelect: 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_Events postedRclEvents
uint32_t actualStartTime
RCL_SchedulerStopInfo hardStopInfo
RCL_SchedulerStopInfo gracefulStopInfo

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

◆ 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

◆ RCL_SCHEDULER_MARGIN_CONFIGURE

#define RCL_SCHEDULER_MARGIN_CONFIGURE   RCL_SCHEDULER_SYSTIM_US(76U)

Time to reload REGBANKs

◆ RCL_SCHEDULER_MARGIN_LOAD

#define RCL_SCHEDULER_MARGIN_LOAD   RCL_SCHEDULER_SYSTIM_US(460U)

Time to load TOPsm images

◆ RCL_SCHEDULER_SLEEP_CUTOFF

#define RCL_SCHEDULER_SLEEP_CUTOFF   RCL_SCHEDULER_SYSTIM_MS(10U)

Time margin when not to arm LRF immediately

◆ 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

◆ RCL_SCHEDULER_WAKEUP_MARGIN

#define RCL_SCHEDULER_WAKEUP_MARGIN   RCL_SCHEDULER_SYSTIM_US(1000U)

Wakeup margin to allow for varying command and setup time

Enumeration Type Documentation

◆ RCL_SchedulerStopTimeSelect

Enumerator
RCL_SchedulerStopTimeSelect_None 

Stop type is not active

RCL_SchedulerStopTimeSelect_Cmd 

Command stop time is the earliest for the stop type

RCL_SchedulerStopTimeSelect_Sched 

Scheduler stop time is the earliest for the stop type

◆ 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