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
Definition: LRF.h:88
void LRF_rclEnableRadioClocks(void)
Definition: LRFCC23X0.c:1335
static int8_t RCL_Lite_readRssi(void)
Get the last valid RSSI value.
Definition: RCL_Lite.h:157
LRF_SetupResult LRF_setupRadio(const LRF_Config *lrfConfig, uint16_t phyFeatures, LRF_RadioState lrfState)
Definition: LRFCC23X0.c:95
LRF_SetupResult
Setup operation result.
Definition: LRF.h:96
RCL_StopType
Stop types.
Definition: RCL_Command.h:138
int8_t LRF_readRssi(void)
Definition: LRFCC23X0.c:1361
void RCL_Lite_CommandHwi(void)
Routine to be called in the RFD_IRQ0 interrupt handler.
Definition: RCL_Lite.c:56
RCL_Command_Handle * RCL_Lite_Command_stop(RCL_StopType stopType)
Stop the running command if any.
Definition: RCL_Lite.c:232
Radio configuration structure.
Definition: LRFCC23X0.h:476
void RCL_Lite_Command_start(RCL_Command_Handle c)
Submit RCL command object to be executed.
Definition: RCL_Lite.c:176
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
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
void * RCL_Command_Handle
Definition: RCL_Types.h:36
static RCL_Command_Handle * RCL_Lite_Command_abort(void)
Abort the running command if any.
Definition: RCL_Lite.h:143
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:224
Definition: LRF.h:90
#define LRF_PhyFeatures_Default
Definition: LRF.h:183
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
Definition: RCL_Command.h:142