|
Radio Control Layer (RCL)
|
#include <stdint.h>#include <stddef.h>#include <ti/drivers/rcl/LRF.h>#include <ti/drivers/rcl/RCL_Types.h>#include <ti/drivers/rcl/RCL_Client.h>#include <ti/drivers/rcl/RCL_Event.h>#include <ti/drivers/rcl/RCL_Command.h>#include <ti/drivers/rcl/RCL_Buffer.h>#include <ti/drivers/rcl/RCL_Scheduler.h>#include <ti/drivers/rcl/hal/hal.h>#include <ti/drivers/dpl/SemaphoreP.h>
Include dependency graph for RCL.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | RCL |
| Global shared driver state. More... | |
Enumerations | |
| enum | RCL_PowerState { RCL_standbyAllow = 0, RCL_standbyDisallow } |
| RCL power state. More... | |
Functions | |
| int | RCL_init () |
| Initializes the RCL driver state. More... | |
| RCL_Handle | RCL_open (RCL_Client *c, const LRF_Config *lrfConfig) |
| Initializes an RCL client instance. More... | |
| void | RCL_close (RCL_Handle h) |
| Closes client instance and deallocates open resources. More... | |
| RCL_CommandStatus | RCL_Command_submit (RCL_Handle h, RCL_Command_Handle c) |
| Submit RCL command object to be scheduled for execution. More... | |
| RCL_CommandStatus | RCL_Command_pend (RCL_Command_Handle c) |
| Wait for a submitted command to complete. More... | |
| RCL_CommandStatus | RCL_Command_stop (RCL_Command_Handle c, RCL_StopType stopType) |
| Stop a command. More... | |
| int8_t | RCL_readRssi (void) |
| Get the last valid RSSI value. More... | |
| struct RCL |
Global shared driver state.
Collaboration diagram for RCL:| Data Fields | ||
|---|---|---|
| uint16_t | numClients | |
| LRF_RadioState | lrfState | |
| RCL_PowerState | powerState | |
| const LRF_Config * | lrfConfig | |
| RCL_Command * | nextCmd | |
| RCL_Command * | doneCmd | |
| enum RCL_PowerState |
| int RCL_init | ( | ) |
Initializes the RCL driver state.
Resets global state and initialize hardware.
References hal_init_fsm(), RCL::numClients, RadioState_Down, rclCommandHwi(), rclDispatchHwi(), rclSchedulerHwi(), and rclState.
Referenced by RCL_AdcNoise_get_samples_blocking(), and RCL_AdcNoise_get_samples_callback().
| RCL_Handle RCL_open | ( | RCL_Client * | c, |
| const LRF_Config * | lrfConfig | ||
| ) |
Initializes an RCL client instance.
| [in] | c | - Client object struct to be initialized |
| [in] | lrfConfig | - Radio configuration to be used by client |
References hal_enable_clk_buffer(), hal_power_open(), LRF_rclEnableRadioClocks(), RCL::numClients, rclPowerNotify(), and rclState.
Referenced by RCL_AdcNoise_get_samples_blocking(), and RCL_AdcNoise_get_samples_callback().
| void RCL_close | ( | RCL_Handle | h | ) |
Closes client instance and deallocates open resources.
| [in] | h | - Client handle |
References hal_power_close(), LRF_rclDisableRadioClocks(), RCL::lrfConfig, RCL::numClients, and rclState.
Referenced by adcNoiseCallback(), and RCL_AdcNoise_get_samples_blocking().
| RCL_CommandStatus RCL_Command_submit | ( | RCL_Handle | h, |
| RCL_Command_Handle | c | ||
| ) |
Submit RCL command object to be scheduled for execution.
This API returns immediately with either RCL_CommandStatus_Error or the asynchronous current state of the command.
| [in] | h | - Client handle |
| [in] | c | - Command handle |
References RCL_SchedulerState::currCmd, hal_trigger_scheduler_fsm(), RCL::nextCmd, RCL_CommandStatus_Error, RCL_CommandStatus_Error_AlreadySubmitted, RCL_CommandStatus_Finished, RCL_CommandStatus_Idle, rclSchedulerState, and rclState.
Referenced by RCL_AdcNoise_get_samples_blocking(), and RCL_AdcNoise_get_samples_callback().
| RCL_CommandStatus RCL_Command_pend | ( | RCL_Command_Handle | c | ) |
Wait for a submitted command to complete.
Uses SemaphoreP_pend to block in the callers context.
| [in] | c | - Client handle |
References RCL_CommandStatus_Active, and RCL_Debug_assert.
Referenced by RCL_AdcNoise_get_samples_blocking().
| RCL_CommandStatus RCL_Command_stop | ( | RCL_Command_Handle | c, |
| RCL_StopType | stopType | ||
| ) |
Stop a command.
Sends the message to try to stop a command. When the function returns, the command may still be running. Depending on the stop type, the command may stop after some time. RCL_Command_pend may be used to wait for the command to finish.
| c | [in] - Command handle |
| stopType | [in] - Stop type; telling which situations the command will stop |
References RCL_SchedulerStopInfo::apiStopEnabled, RCL_SchedulerState::gracefulStopInfo, RCL_SchedulerState::hardStopInfo, LRF_sendGracefulStop(), LRF_sendHardStop(), RCL::nextCmd, RCL_CommandStatus_Descheduled, RCL_CommandStatus_Finished, RCL_CommandStatus_Queued, RCL_Debug_assert, RCL_EventNone, RCL_Scheduler_postEvent(), RCL_StopType_DescheduleOnly, RCL_StopType_Graceful, RCL_StopType_Hard, RCL_StopType_None, rclSchedulerState, and rclState.
Referenced by rclCommandHwi().
| int8_t RCL_readRssi | ( | void | ) |
Get the last valid RSSI value.
This API returns the last valid RSSI value or a specific error status if the last obtained RSSI value is no longer valid.
References LRF_readRssi(), LRF_RSSI_INVALID, RCL::lrfState, RadioState_Configured, and rclState.