Radio Control Layer (RCL)
RCL.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020-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_h__include
34 #define ti_drivers_RCL_h__include
35 
36 #include <stdint.h>
37 #include <stddef.h>
38 
39 #include <ti/drivers/rcl/LRF.h>
46 
47 #include <ti/drivers/rcl/hal/hal.h>
48 
49 #include <ti/drivers/dpl/SemaphoreP.h>
50 
56 typedef enum {
60 
64 typedef struct RCL_s {
65  uint8_t numClients;
70  RCL_Command *nextCmd;
71  RCL_Command *doneCmd;
72 } RCL;
73 
81 void RCL_init(void);
82 
91 RCL_Handle RCL_open(RCL_Client *c, const LRF_Config *lrfConfig);
92 
98 void RCL_close(RCL_Handle h);
99 
103 void RCL_openPowerNotifications(void);
104 
108 void RCL_closePowerNotifications(void);
109 
122 
133 
147 
157 int8_t RCL_readRssi(void);
158 
159 #endif
void RCL_init(void)
Initializes the RCL driver state.
Definition: RCL.c:588
RCL_Command * nextCmd
Definition: RCL.h:70
void RCL_close(RCL_Handle h)
Closes client instance and deallocates open resources.
Definition: RCL.c:672
RCL_CommandStatus RCL_Command_submit(RCL_Handle h, RCL_Command_Handle c)
Submit RCL command object to be scheduled for execution.
Definition: RCL.c:720
int8_t RCL_readRssi(void)
Get the last valid RSSI value.
Definition: RCL.c:886
LRF_RadioState lrfState
Definition: RCL.h:67
RCL_Command * doneCmd
Definition: RCL.h:71
RCL_CommandStatus RCL_Command_stop(RCL_Command_Handle c, RCL_StopType stopType)
Stop a command.
Definition: RCL.c:781
uint8_t powerNotifyEnableCount
Definition: RCL.h:66
uint8_t numClients
Definition: RCL.h:65
Definition: RCL.h:58
RCL_PowerState powerState
Definition: RCL.h:68
LRF_RadioState
Definition: LRF.h:88
RCL_StopType
Stop types.
Definition: RCL_Command.h:139
void RCL_closePowerNotifications(void)
Remove RCL power notification request.
Definition: RCL.c:625
RCL_PowerState
RCL power state.
Definition: RCL.h:56
Radio configuration structure.
Definition: LRFCC23X0.h:518
void RCL_openPowerNotifications(void)
Request RCL power notifications.
Definition: RCL.c:611
void * RCL_Command_Handle
Definition: RCL_Types.h:36
Global shared driver state.
Definition: RCL.h:64
Definition: RCL.h:57
const LRF_Config * lrfConfig
Definition: RCL.h:69
RCL_Handle RCL_open(RCL_Client *c, const LRF_Config *lrfConfig)
Initializes an RCL client instance.
Definition: RCL.c:639
RCL_CommandStatus
Command status.
Definition: RCL_Command.h:83
RCL_CommandStatus RCL_Command_pend(RCL_Command_Handle c)
Wait for a submitted command to complete.
Definition: RCL.c:754