Radio Control Layer (RCL)
RCL_Lite.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2023, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef ti_drivers_RCL_Lite_h__include
34 #define ti_drivers_RCL_Lite_h__include
35 
36 #include <stdint.h>
37 #include <stddef.h>
38 
43 #include <ti/drivers/rcl/LRF.h>
44 #include <ti/drivers/rcl/hal/hal.h>
45 
49 void RCL_Lite_CommandHwi(void);
50 
62 static inline LRF_SetupResult RCL_Lite_configSetPhyFeatures(const LRF_Config *lrfConfig, uint16_t phyFeatures)
63 {
64  /* Temporary solution: Enable all needed clocks here and leave them enabled */
66  return LRF_setupRadio(lrfConfig, phyFeatures, RadioState_Down);
67 }
68 
78 static inline LRF_SetupResult RCL_Lite_config(const LRF_Config *lrfConfig)
79 {
81 }
82 
96 static inline LRF_SetupResult RCL_Lite_setPhyFeatures(const LRF_Config *lrfConfig, uint16_t phyFeatures)
97 {
98  return LRF_setupRadio(lrfConfig, phyFeatures, RadioState_Configured);
99 }
100 
101 
111 
119 bool RCL_Lite_Command_isFinished(void);
120 
133 
144 {
146 }
147 
157 static inline int8_t RCL_Lite_readRssi(void)
158 {
159  return LRF_readRssi();
160 }
161 
162 #endif
RadioState_Down
@ RadioState_Down
Definition: LRF.h:87
RCL_Scheduler.h
hal_setup_setup_time
void hal_setup_setup_time(uint32_t time)
Definition: hal_cc23x0rx.c:170
RCL_SchedulerStopInfo::apiStopEnabled
uint32_t apiStopEnabled
Definition: RCL_Scheduler.h:81
RCL_Lite_readRssi
static int8_t RCL_Lite_readRssi(void)
Get the last valid RSSI value.
Definition: RCL_Lite.h:157
hal.h
RCL_SchedulerState::currCmd
RCL_Command * currCmd
Definition: RCL_Scheduler.h:88
HalTimerEvent
HalTimerEvent
Definition: hal.h:59
RCL_Lite_Command_stop
RCL_Command_Handle * RCL_Lite_Command_stop(RCL_StopType stopType)
Stop the running command if any.
Definition: RCL_Lite.c:220
RCL_Lite.h
RCL_Event.h
RCL_StopType
RCL_StopType
Stop types.
Definition: RCL_Command.h:121
LRF.h
LRF_SetupResult
LRF_SetupResult
Setup operation result.
Definition: LRF.h:95
RCL_Lite_CommandHwi
void RCL_Lite_CommandHwi(void)
Routine to be called in the RFD_IRQ0 interrupt handler.
Definition: RCL_Lite.c:56
RCL_Scheduler_getCurrentTime
static uint32_t RCL_Scheduler_getCurrentTime(void)
Get current time.
Definition: RCL_Scheduler.h:233
RCL_Command.h
LRF_sendGracefulStop
void LRF_sendGracefulStop(void)
RCL_CommandStatus_Finished
@ RCL_CommandStatus_Finished
Definition: RCL_Command.h:90
hal_get_ifg_reg
uint32_t hal_get_ifg_reg(void)
Definition: hal_cc23x0rx.c:99
RCL_Lite_CommandHwi
void RCL_Lite_CommandHwi(void)
Routine to be called in the RFD_IRQ0 interrupt handler.
Definition: RCL_Lite.c:56
RCL_Lite_Command_stop
RCL_Command_Handle * RCL_Lite_Command_stop(RCL_StopType stopType)
Stop the running command if any.
Definition: RCL_Lite.c:220
RCL_Buffer.h
RCL_SchedulerState::gracefulStopInfo
RCL_SchedulerStopInfo gracefulStopInfo
Definition: RCL_Scheduler.h:94
RCL_Lite_Command_start
void RCL_Lite_Command_start(RCL_Command_Handle c)
Submit RCL command object to be executed.
Definition: RCL_Lite.c:164
hal_disable_radio_interrupts
void hal_disable_radio_interrupts(void)
Definition: hal_cc23x0rx.c:293
RCL_Scheduler_isLater
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
RCL_Debug_assert
#define RCL_Debug_assert(expr)
Definition: RCL_Debug.h:39
RCL_Schedule_Now
@ RCL_Schedule_Now
Definition: RCL_Command.h:135
hal_cancel_graceful_stop_time
void hal_cancel_graceful_stop_time(void)
Definition: hal_cc23x0rx.c:231
RCL_StopType_Graceful
@ RCL_StopType_Graceful
Definition: RCL_Command.h:124
RCL_SchedulerState::postedRclEvents
RCL_Events postedRclEvents
Definition: RCL_Scheduler.h:91
HAL_TIMER_EVT_GRACEFUL_STOP
@ HAL_TIMER_EVT_GRACEFUL_STOP
Definition: hal.h:63
RCL_CommandStatus_Descheduled
@ RCL_CommandStatus_Descheduled
Definition: RCL_Command.h:98
RCL_StopType_None
@ RCL_StopType_None
Definition: RCL_Command.h:122
RCL_Lite_Command_start
void RCL_Lite_Command_start(RCL_Command_Handle c)
Submit RCL command object to be executed.
Definition: RCL_Lite.c:164
RCL_Lite_config
static LRF_SetupResult RCL_Lite_config(const LRF_Config *lrfConfig)
Sets up the radio for configuration with default PHY features.
Definition: RCL_Lite.h:78
RCL_SchedulerState
Definition: RCL_Scheduler.h:87
RCL_StopType_DescheduleOnly
@ RCL_StopType_DescheduleOnly
Definition: RCL_Command.h:123
RCL_Lite_configSetPhyFeatures
static LRF_SetupResult RCL_Lite_configSetPhyFeatures(const LRF_Config *lrfConfig, uint16_t phyFeatures)
Sets up the radio for configuration with non-default PHY features.
Definition: RCL_Lite.h:62
RCL_CommandStatus_Idle
@ RCL_CommandStatus_Idle
Definition: RCL_Command.h:84
hal_cancel_setup_time
void hal_cancel_setup_time(void)
Definition: hal_cc23x0rx.c:207
RCL_LITE_SCHEDULE_MARGIN
#define RCL_LITE_SCHEDULE_MARGIN
Definition: RCL_Lite.c:51
LRF_hardStop
void LRF_hardStop(void)
RCL_CommandStatus_Error_StartTooLate
@ RCL_CommandStatus_Error_StartTooLate
Definition: RCL_Command.h:108
LRF_setupRadio
LRF_SetupResult LRF_setupRadio(const LRF_Config *lrfConfig, uint16_t phyFeatures, LRF_RadioState lrfState)
Definition: LRFCC23X0.c:87
RCL_Debug.h
RCL_Lite_Command_abort
static RCL_Command_Handle * RCL_Lite_Command_abort(void)
Abort the running command if any.
Definition: RCL_Lite.h:143
RCL_Lite_Command_isFinished
bool RCL_Lite_Command_isFinished(void)
Check if a command is finished. The function may be polled to wait for the running command to end.
Definition: RCL_Lite.c:212
LRF_readRssi
int8_t LRF_readRssi(void)
Definition: LRFCC23X0.c:1247
HAL_TIMER_EVT_START
@ HAL_TIMER_EVT_START
Definition: hal.h:62
LRF_PhyFeatures_Default
#define LRF_PhyFeatures_Default
Definition: LRF.h:182
RCL_Lite_Command_isFinished
bool RCL_Lite_Command_isFinished(void)
Check if a command is finished. The function may be polled to wait for the running command to end.
Definition: RCL_Lite.c:212
LRF_rclEnableRadioClocks
void LRF_rclEnableRadioClocks(void)
Definition: LRFCC23X0.c:1221
hal_check_clear_timer_compare
HalTimerEvent hal_check_clear_timer_compare(void)
Definition: hal_cc23x0rx.c:258
hal_cancel_hard_stop_time
void hal_cancel_hard_stop_time(void)
Definition: hal_cc23x0rx.c:223
HAL_TIMER_EVT_HARD_STOP
@ HAL_TIMER_EVT_HARD_STOP
Definition: hal.h:64
HAL_TIMER_EVT_SETUP
@ HAL_TIMER_EVT_SETUP
Definition: hal.h:61
RadioState_Configured
@ RadioState_Configured
Definition: LRF.h:89
RCL_EventNone
#define RCL_EventNone
Definition: RCL_Event.h:38
RCL_SchedulerState::hardStopInfo
RCL_SchedulerStopInfo hardStopInfo
Definition: RCL_Scheduler.h:93
RCL_Command_Handle
void * RCL_Command_Handle
Definition: RCL_Types.h:36
RCL_Lite_setPhyFeatures
static LRF_SetupResult RCL_Lite_setPhyFeatures(const LRF_Config *lrfConfig, uint16_t phyFeatures)
Change PHY features after radio has been configured.
Definition: RCL_Lite.h:96
RCL_EventSetup
#define RCL_EventSetup
Definition: RCL_Event.h:53
LRF_sendHardStop
void LRF_sendHardStop(void)
RCL_CommandStatus_Scheduled
@ RCL_CommandStatus_Scheduled
Definition: RCL_Command.h:86
RCL_Scheduler_postEvent
bool RCL_Scheduler_postEvent(RCL_Command_Handle c, RCL_Events e)
Post event to command handler.
Definition: RCL_Scheduler.c:498
rclSchedulerState
RCL_SchedulerState rclSchedulerState
Definition: RCL_Scheduler.c:51
LRF_Config
Radio configuration structure.
Definition: LRFCC23X0.h:456
RCL_StopType_Hard
@ RCL_StopType_Hard
Definition: RCL_Command.h:125
RCL_Scheduler_setStopTimes
RCL_StopType RCL_Scheduler_setStopTimes(void)
Function to apply relevant stop times.
Definition: RCL_Scheduler.c:294