Radio Control Layer (RCL)
|
Go to the documentation of this file.
33 #ifndef ti_drivers_RCL_h__include
34 #define ti_drivers_RCL_h__include
49 #include <ti/drivers/dpl/SemaphoreP.h>
64 typedef struct RCL_s {
RCL_Command * nextCmd
Definition: RCL.h:69
void hal_enable_clk_buffer(void)
Definition: hal_octopus.c:278
void RCL_close(RCL_Handle h)
Closes client instance and deallocates open resources.
Definition: RCL.c:592
@ RadioState_Down
Definition: LRF.h:87
void hal_power_open(void(*f)(RCL_PowerEvent))
Definition: hal_octopus.c:290
RCL_CommandStatus RCL_Command_pend(RCL_Command_Handle c)
Wait for a submitted command to complete.
Definition: RCL.c:672
int8_t RCL_readRssi(void)
Get the last valid RSSI value.
Definition: RCL.c:760
RCL_Handle RCL_open(RCL_Client *c, const LRF_Config *lrfConfig)
Initializes an RCL client instance.
Definition: RCL.c:559
RCL_CommandStatus RCL_Command_stop(RCL_Command_Handle c, RCL_StopType stopType)
Stop a command.
Definition: RCL.c:699
@ RCL_POWER_STANDBY_AWAKE
Definition: hal.h:70
#define RCL_SCHEDULER_WAKEUP_MARGIN
Definition: RCL_Scheduler.h:63
RCL_StopType RCL_Scheduler_setSchedStopTime(RCL_SchedulerStopInfo *stopInfo, uint32_t schedStopTime)
Set scheduler stop time.
Definition: RCL_Scheduler.c:391
uint32_t apiStopEnabled
Definition: RCL_Scheduler.h:81
RCL_CommandStatus RCL_Command_stop(RCL_Command_Handle c, RCL_StopType stopType)
Stop a command.
Definition: RCL.c:699
RCL_Command * currCmd
Definition: RCL_Scheduler.h:88
RCL_Command * doneCmd
Definition: RCL.h:70
HalTimerEvent
Definition: hal.h:61
bool LRF_imagesNeedUpdate(const LRF_Config *lrfConfig)
Definition: LRFCC23X0.c:184
void phyHook(RCL *rclState, RCL_Handle client, RCL_Command *cmd)
Hook function to allow dynamic PHY change.
void hal_init_fsm(void(*dispatchFsmCb)(void), void(*schedFsmCb)(void), void(*commandFsmCb)(void))
Definition: hal_octopus.c:96
void hal_cancel_start_time(void)
Definition: hal_octopus.c:204
void hal_trigger_dispatch_fsm(void)
Definition: hal_octopus.c:121
int8_t RCL_readRssi(void)
Get the last valid RSSI value.
Definition: RCL.c:760
int RCL_init()
Initializes the RCL driver state.
Definition: RCL.c:542
static void rclCommandHwi(void)
Definition: RCL.c:94
@ RCL_CommandStatus_RejectedStart
Definition: RCL_Command.h:99
RCL_StopType
Stop types.
Definition: RCL_Command.h:129
void hal_cancel_hard_stop_time(void)
Definition: hal_octopus.c:210
void hal_set_systim_imask(void)
Definition: hal_octopus.c:299
RCL_CommandStatus RCL_Command_submit(RCL_Handle h, RCL_Command_Handle c)
Submit RCL command object to be scheduled for execution.
Definition: RCL.c:638
void hal_power_release_constraint(void)
Definition: hal_octopus.c:286
@ RCL_standbyAllow
Definition: RCL.h:57
LRF_SetupResult
Setup operation result.
Definition: LRF.h:95
static uint32_t RCL_Scheduler_getCurrentTime(void)
Get current time.
Definition: RCL_Scheduler.h:233
void LRF_sendGracefulStop(void)
RCL_CommandStatus RCL_Command_submit(RCL_Handle h, RCL_Command_Handle c)
Submit RCL command object to be scheduled for execution.
Definition: RCL.c:638
@ RCL_CommandStatus_Finished
Definition: RCL_Command.h:90
@ RCL_ProfilingEvent_PreprocStart
Definition: RCL_Profiling.h:37
@ RCL_POWER_XTAL_AVAILABLE
Definition: hal.h:71
#define LRF_EventNone
Definition: LRFCC23X0.h:70
@ SetupResult_Ok
Definition: LRF.h:96
RCL_SchedulerStopInfo gracefulStopInfo
Definition: RCL_Scheduler.h:94
#define RCL_SCHEDULER_MARGIN_CONFIGURE
Definition: RCL_Scheduler.h:56
@ RCL_CommandStatus_Queued
Definition: RCL_Command.h:85
bool RCL_Scheduler_isLater(uint32_t refTime, uint32_t chkTime)
Find if a time instant occurs after another, allowing wrap-around.
Definition: RCL_Scheduler.c:345
#define RCL_Debug_assert(expr)
Definition: RCL_Debug.h:39
Global shared driver state.
Definition: RCL.h:64
@ RCL_ConflictPolicy_AlwaysInterrupt
Definition: RCL_Command.h:153
RCL_PowerEvent
Definition: hal.h:69
RCL_CommandStatus
Command status.
Definition: RCL_Command.h:83
@ RCL_Schedule_Now
Definition: RCL_Command.h:143
static void rclDispatchHwi(void)
Definition: RCL.c:250
LRF_RadioState lrfState
Definition: RCL.h:66
RCL_PowerState
RCL power state.
Definition: RCL.h:56
void hal_power_close(void)
Definition: hal_octopus.c:295
@ RCL_StopType_Graceful
Definition: RCL_Command.h:132
RCL_Events postedRclEvents
Definition: RCL_Scheduler.h:91
@ HAL_TIMER_EVT_GRACEFUL_STOP
Definition: hal.h:65
void RCL_close(RCL_Handle h)
Closes client instance and deallocates open resources.
Definition: RCL.c:592
@ RCL_CommandStatus_Descheduled
Definition: RCL_Command.h:98
HalTimerEvent hal_check_clear_timer_compare(void)
Definition: hal_octopus.c:233
int32_t RCL_Scheduler_delta(uint32_t refTime, uint32_t chkTime)
Find the time difference between two times, allowing wrap-around.
Definition: RCL_Scheduler.c:363
@ RCL_StopType_None
Definition: RCL_Command.h:130
const LRF_Config * lrfConfig
Definition: RCL.h:68
Definition: RCL_Scheduler.h:87
@ RCL_ConflictPolicy_NeverInterrupt
Definition: RCL_Command.h:155
RCL_Handle RCL_open(RCL_Client *c, const LRF_Config *lrfConfig)
Initializes an RCL client instance.
Definition: RCL.c:559
#define RCL_SCHEDULER_SLEEP_CUTOFF
Definition: RCL_Scheduler.h:58
uint16_t numClients
Definition: RCL.h:65
@ RCL_CommandStatus_Error_AlreadySubmitted
Definition: RCL_Command.h:113
uint32_t nextWantsStop
Definition: RCL_Scheduler.h:89
@ RCL_StopType_DescheduleOnly
Definition: RCL_Command.h:131
Definition: RCL_Scheduler.h:78
#define LRF_RSSI_INVALID
Definition: LRF.h:83
@ RCL_CommandStatus_Idle
Definition: RCL_Command.h:84
@ RadioState_ImagesLoaded
Definition: LRF.h:88
static void rclPowerNotify(RCL_PowerEvent eventType)
Definition: RCL.c:500
LRF_RadioState
Definition: LRF.h:86
@ RCL_CommandStatus_Error_StartTooLate
Definition: RCL_Command.h:108
uint32_t hal_get_ifg_reg(void)
Definition: hal_octopus.c:80
LRF_SetupResult LRF_setupRadio(const LRF_Config *lrfConfig, uint16_t phyFeatures, LRF_RadioState lrfState)
Definition: LRFCC23X0.c:88
int RCL_init(void)
Initializes the RCL driver state.
Definition: RCL.c:542
void(* RCL_Callback)(RCL_Command *cmd, LRF_Events lrfEvents, RCL_Events rclEvents)
Callback function type.
Definition: RCL_Command.h:51
int8_t LRF_readRssi(void)
Definition: LRFCC23X0.c:1261
@ HAL_TIMER_EVT_START
Definition: hal.h:64
@ RCL_CommandStatus_Active
Definition: RCL_Command.h:87
static void rclSchedulerHwi(void)
Definition: RCL.c:417
@ RCL_CommandStatus_Error
Definition: RCL_Command.h:102
void LRF_rclDisableRadioClocks(void)
Definition: LRFCC23X0.c:1248
#define RCL_SCHEDULER_MARGIN_LOAD
Definition: RCL_Scheduler.h:57
void LRF_rclEnableRadioClocks(void)
Definition: LRFCC23X0.c:1235
@ HAL_TIMER_EVT_HARD_STOP
Definition: hal.h:66
#define RCL_SCHEDULER_TRIG_NOW_DELAY
Definition: RCL_Scheduler.h:59
@ RCL_ConflictPolicy_Polite
Definition: RCL_Command.h:154
void hal_setup_setup_time(uint32_t startTime)
Definition: hal_octopus.c:149
#define RCL_SCHEDULER_MARGIN_ARM
Definition: RCL_Scheduler.h:55
@ HAL_TIMER_EVT_SETUP
Definition: hal.h:63
RCL rclState
Definition: RCL.c:54
void scheduleHook(RCL_SchedulerState *rclSchedulerState, RCL_Handle client, RCL_Command *cmd)
Hook function to schedule new command.
@ RCL_CommandStatus_Error_Setup
Definition: RCL_Command.h:103
void hal_enable_setup_time_irq(void)
Definition: hal_octopus.c:144
@ RadioState_Configured
Definition: LRF.h:89
#define RCL_EventNone
Definition: RCL_Event.h:38
void hal_trigger_scheduler_fsm(void)
Definition: hal_octopus.c:127
RCL_SchedulerStopInfo hardStopInfo
Definition: RCL_Scheduler.h:93
@ RCL_ProfilingEvent_PostprocStop
Definition: RCL_Profiling.h:40
void * RCL_Command_Handle
Definition: RCL_Types.h:36
RCL_StopType policyHook(RCL_Command *currentCmd, RCL_Command *newCmd)
Hook function to determine what stop type the ongoing command should get.
#define RCL_EventSetup
Definition: RCL_Event.h:53
void LRF_sendHardStop(void)
void hal_cancel_graceful_stop_time(void)
Definition: hal_octopus.c:216
@ RCL_CommandStatus_Scheduled
Definition: RCL_Command.h:86
bool RCL_Scheduler_postEvent(RCL_Command_Handle c, RCL_Events e)
Post event to command handler.
Definition: RCL_Scheduler.c:498
RCL_CommandStatus RCL_Command_pend(RCL_Command_Handle c)
Wait for a submitted command to complete.
Definition: RCL.c:672
@ RCL_standbyDisallow
Definition: RCL.h:58
RCL_SchedulerState rclSchedulerState
Definition: RCL_Scheduler.c:51
Radio configuration structure.
Definition: LRFCC23X0.h:456
RCL_PowerState powerState
Definition: RCL.h:67
void hal_disable_radio_interrupts(void)
Definition: hal_octopus.c:266
@ RCL_StopType_Hard
Definition: RCL_Command.h:133
__attribute__((weak))
Definition: RCL.c:337
void hal_power_set_constraint(void)
Definition: hal_octopus.c:282
RCL_StopType RCL_Scheduler_setStopTimes(void)
Function to apply relevant stop times.
Definition: RCL_Scheduler.c:294