Radio Control Layer (RCL)
Radio Control Layer (RCL)

.conan_data_loki-rcl_7.11.00.39_library-lprf_ga_build_7420b9b308abc4f5ce764e660ca18db63e51be32_docs_rcl_source_rcl_product_overview

Product Overview

The radio control layer (RCL) module provides access to the radio for LPF3 devices. It offers a high-level interface for command execution while also ensuring the lowest possible power consumption by providing automatic power management that is fully transparent to the application.

Conceptually, the RCL module can be divided into RCL "High" and RCL "Low". RCL High takes care aspects such as command scheduling and buffer management, while RCL Low takes care of protocol specific operations through command handlers. Finally, to ensure that critical sections are reduced and timing constraints are met, the RCL module uses three different priority interrupts depending on the operation.

Usage

The bare minimum for using the RCL component involves:

  1. Initializing the RCL by calling RCL_init
  2. Initializing an RCL client instance with RCL_open
  3. Declaring an RCL command
  4. Configuring the RCL command
  5. Submitting the RCL command with RCL_Command_submit
  6. Waiting for the command to conclude using RCL_Command_pend or the configured Callback function.
  7. Closing the RCL client and deallocating open resources with RCL_Command_stop.

The following example simple that uses the Generic Tx Test illustrates how the RCL component is used.

void runGenericTxTest(void)
{
RCL_Handle h = RCL_open(&rclClient, &LRF_configGfsk500Kbps);
/* Declare command */
RCL_CmdGenericTxTest cmd;
/* Command configuration */
cmd.common.scheduling = RCL_Schedule_Now;
cmd.common.runtime.callback = defaultCallback;
cmd.common.runtime.rclCallbackMask.value = RCL_EventLastCmdDone.value | RCL_EventCmdStarted.value;
cmd.common.timing.relHardStopTime = RCL_SCHEDULER_SYSTIM_US(5000); // Stop continuous wave after 5000 [us]
cmd.rfFrequency = FREQUENCY;
cmd.config.sendCw = 1; // Send continuous wave
cmd.config.whitenMode = 1; // Default whitening
cmd.config.txWord = 0;
cmd.common.status = RCL_CommandStatus_Idle;
/* Wait for command to conclude */
}
RCL_EventCmdStarted
#define RCL_EventCmdStarted
Definition: RCL_Event.h:39
RCL_Command_pend
RCL_CommandStatus RCL_Command_pend(RCL_Command_Handle c)
Wait for a submitted command to complete.
Definition: RCL.c:667
RCL_open
RCL_Handle RCL_open(RCL_Client *c, const LRF_Config *lrfConfig)
Initializes an RCL client instance.
Definition: RCL.c:554
RCL_SCHEDULER_SYSTIM_US
#define RCL_SCHEDULER_SYSTIM_US(x)
Definition: RCL_Scheduler.h:45
RCL_Command_submit
RCL_CommandStatus RCL_Command_submit(RCL_Handle h, RCL_Command_Handle c)
Submit RCL command object to be scheduled for execution.
Definition: RCL.c:633
RCL_Schedule_Now
@ RCL_Schedule_Now
Definition: RCL_Command.h:135
RCL_close
void RCL_close(RCL_Handle h)
Closes client instance and deallocates open resources.
Definition: RCL.c:587
RCL_EventLastCmdDone
#define RCL_EventLastCmdDone
Definition: RCL_Event.h:40
RCL_CmdGenericTxTest_DefaultRuntime
#define RCL_CmdGenericTxTest_DefaultRuntime()
Definition: generic.h:216
RCL_CommandStatus_Idle
@ RCL_CommandStatus_Idle
Definition: RCL_Command.h:84
RCL_init
int RCL_init(void)
Initializes the RCL driver state.
Definition: RCL.c:537