Radio Control Layer (RCL)
Buffer APIs

Detailed Description

These functions are useful as part of the API to RCL.

Macros

#define RCL_Buffer_entryLen(numPad, hdrLen, dataLen)   (RCL_Buffer_DataEntry_paddedLen(sizeof(uint8_t) + (numPad) + (hdrLen) + (dataLen)))
 Total length of a data entry in bytes, including entry length field and padding. More...
 
#define RCL_TxBuffer_len(numPad, hdrLen, dataLen)   (offsetof(RCL_Buffer_TxBuffer, length) + RCL_Buffer_entryLen(numPad, hdrLen, dataLen))
 Total length of a TX buffer in bytes, including all fields and padding. More...
 
#define RCL_TxBuffer_len_u32(numPad, hdrLen, dataLen)   (RCL_Buffer_bytesToWords(RCL_TxBuffer_len(numPad, hdrLen, dataLen)))
 Total length of a TX buffer in 32-bit words, including all fields and padding. More...
 
#define RCL_MultiBuffer_len(dataLen)   (offsetof(RCL_MultiBuffer, data) + (dataLen))
 Total length of a multi buffer in bytes, including all fields. More...
 
#define RCL_MultiBuffer_len_u32(dataLen)   (RCL_Buffer_bytesToWords(RCL_MultiBuffer_len(dataLen)))
 Total length of a multi buffer in 32-bit words, including all fields. More...
 

Functions

static RCL_Buffer_TxBuffer * RCL_TxBuffer_get (List_List *list)
 Function to atomically get the first elem in a Tx Buffer list. More...
 
static RCL_Buffer_TxBuffer * RCL_TxBuffer_head (List_List *list)
 Function to return the head of a TxBuffer list. More...
 
static RCL_Buffer_TxBuffer * RCL_TxBuffer_next (RCL_Buffer_TxBuffer *elem)
 Function to return the next elem in a linked list of Tx Buffers. More...
 
uint8_t * RCL_TxBuffer_init (RCL_Buffer_TxBuffer *buffer, uint32_t numPad, uint32_t hdrLen, uint32_t dataLen)
 Function to initialize a TX buffer entry for use by RCL. More...
 
void RCL_TxBuffer_put (List_List *list, RCL_Buffer_TxBuffer *elem)
 Function to atomically put an elem onto the end of a Tx Buffer list. More...
 
static RCL_MultiBuffer * RCL_MultiBuffer_head (List_List *list)
 Function to return the head of a MultiBuffer list. More...
 
static RCL_MultiBuffer * RCL_MultiBuffer_next (RCL_MultiBuffer *elem)
 Function to return the next elem in a linked list of MultiBuffers. More...
 
static RCL_MultiBuffer * RCL_MultiBuffer_get (List_List *list)
 Function to get the first elem in a MultiBuffer list. More...
 
void RCL_MultiBuffer_clear (RCL_MultiBuffer *buffer)
 Function to clear a multi buffer entry for re-use by RCL. More...
 
void RCL_MultiBuffer_init (RCL_MultiBuffer *buffer, size_t size)
 Function to initialize a multi buffer entry for use by RCL. More...
 
RCL_Buffer_DataEntry * RCL_MultiBuffer_RxEntry_get (List_List *list, List_List *consumedBuffers)
 Function to get the first entry in a MultiBuffer list. More...
 
bool RCL_MultiBuffer_RxEntry_isEmpty (List_List *list)
 Function to check if the MultiBuffer List is out of entries. More...
 
void RCL_MultiBuffer_ListInfo_init (RCL_MultiBuffer_ListInfo *listInfo, List_List *list)
 Function to initialize information for traversing a multi buffer list. More...
 
RCL_Buffer_DataEntry * RCL_MultiBuffer_RxEntry_next (RCL_MultiBuffer_ListInfo *listInfo)
 Function to return the next entry in a list of multi buffers. More...
 
bool RCL_MultiBuffer_RxEntry_isLast (RCL_MultiBuffer_ListInfo *listInfo)
 Function to check a traversed entry was the last one. More...
 
void RCL_MultiBuffer_put (List_List *list, RCL_MultiBuffer *elem)
 Function to atomically put an elem onto the end of a multi buffer list. More...
 

Macro Definition Documentation

◆ RCL_Buffer_entryLen

#define RCL_Buffer_entryLen (   numPad,
  hdrLen,
  dataLen 
)    (RCL_Buffer_DataEntry_paddedLen(sizeof(uint8_t) + (numPad) + (hdrLen) + (dataLen)))

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Total length of a data entry in bytes, including entry length field and padding.

Parameters
numPadNumber of padding bytes in front of the packet
hdrLenNumber of header bytes to hold
dataLenNumber of payload bytes to hold

◆ RCL_TxBuffer_len

#define RCL_TxBuffer_len (   numPad,
  hdrLen,
  dataLen 
)    (offsetof(RCL_Buffer_TxBuffer, length) + RCL_Buffer_entryLen(numPad, hdrLen, dataLen))

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Total length of a TX buffer in bytes, including all fields and padding.

Parameters
numPadNumber of padding bytes in front of the packet
hdrLenNumber of header bytes to hold
dataLenNumber of payload bytes to hold

◆ RCL_TxBuffer_len_u32

#define RCL_TxBuffer_len_u32 (   numPad,
  hdrLen,
  dataLen 
)    (RCL_Buffer_bytesToWords(RCL_TxBuffer_len(numPad, hdrLen, dataLen)))

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Total length of a TX buffer in 32-bit words, including all fields and padding.

Parameters
numPadNumber of padding bytes in front of the packet
hdrLenNumber of header bytes to hold
dataLenNumber of payload bytes to hold

◆ RCL_MultiBuffer_len

#define RCL_MultiBuffer_len (   dataLen)    (offsetof(RCL_MultiBuffer, data) + (dataLen))

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Total length of a multi buffer in bytes, including all fields.

Parameters
dataLenNumber of bytes available to store data entries

◆ RCL_MultiBuffer_len_u32

#define RCL_MultiBuffer_len_u32 (   dataLen)    (RCL_Buffer_bytesToWords(RCL_MultiBuffer_len(dataLen)))

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Total length of a multi buffer in 32-bit words, including all fields.

Parameters
dataLenNumber of bytes available to store data entries

Function Documentation

◆ RCL_TxBuffer_get()

static RCL_Buffer_TxBuffer* RCL_TxBuffer_get ( List_List *  list)
inlinestatic

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to atomically get the first elem in a Tx Buffer list.

Parameters
listA pointer to a linked list of Tx Buffers
Returns
Pointer the first elem in the linked list or NULL if empty

Referenced by RCL_Handler_BLE5_conn(), RCL_Handler_BLE5_genericTx(), RCL_Handler_Generic_Tx(), and RCL_Handler_Nesb_Ptx().

◆ RCL_TxBuffer_head()

static RCL_Buffer_TxBuffer* RCL_TxBuffer_head ( List_List *  list)
inlinestatic

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to return the head of a TxBuffer list.

This function does not remove the head, it simply returns a pointer to it. This function is typically used when traversing a linked list.

Parameters
listA pointer to the linked list of Tx Buffers
Returns
Pointer to the first elem in the linked list or NULL if empty

Referenced by RCL_Handler_BLE5_adv(), RCL_Handler_BLE5_scan_init(), RCL_Handler_BLE5_updateTxBuffers(), RCL_Handler_Generic_updateTxBuffers(), and RCL_Handler_Nesb_updateHeader().

◆ RCL_TxBuffer_next()

static RCL_Buffer_TxBuffer* RCL_TxBuffer_next ( RCL_Buffer_TxBuffer *  elem)
inlinestatic

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to return the next elem in a linked list of Tx Buffers.

This function does not remove the elem, it simply returns a pointer to next one. This function is typically used when traversing a linked list.

Parameters
elemElem in the TxBuffer list
Returns
Pointer to the next elem in linked list or NULL if at the end

Referenced by RCL_Handler_BLE5_updateTxBuffers(), and RCL_Handler_Generic_updateTxBuffers().

◆ RCL_TxBuffer_init()

uint8_t* RCL_TxBuffer_init ( RCL_Buffer_TxBuffer *  buffer,
uint32_t  numPad,
uint32_t  hdrLen,
uint32_t  dataLen 
)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to initialize a TX buffer entry for use by RCL.

Initialize a new TX buffer entry with the correct length and padding

Parameters
bufferTx buffer to initialize
numPadNumber of padding bytes in front of the packet
hdrLenNumber of header bytes to hold
dataLenNumber of payload bytes to hold
Returns
Pointer to address where first header byte should be stored (followed by payload)

References RCL_BufferStatePending.

◆ RCL_TxBuffer_put()

void RCL_TxBuffer_put ( List_List *  list,
RCL_Buffer_TxBuffer *  elem 
)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to atomically put an elem onto the end of a Tx Buffer list.

Add an entry to the TX buffer list and notify the running command if there is any

Parameters
listA pointer to the Tx buffer list
elemElement to place onto the end of the linked list

References RCL_SchedulerState::currCmd, RCL_EventTxBufferUpdate, RCL_Scheduler_postEvent(), and rclSchedulerState.

◆ RCL_MultiBuffer_head()

static RCL_MultiBuffer* RCL_MultiBuffer_head ( List_List *  list)
inlinestatic

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to return the head of a MultiBuffer list.

This function does not remove the head, it simply returns a pointer to it. This function is typically used when traversing a linked list.

Parameters
listA pointer to the linked list of Multi Buffers
Returns
Pointer to the first elem in the linked list or NULL if empty

Referenced by RCL_MultiBuffer_RxEntry_consume(), and RCL_MultiBuffer_RxEntry_next().

◆ RCL_MultiBuffer_next()

static RCL_MultiBuffer* RCL_MultiBuffer_next ( RCL_MultiBuffer *  elem)
inlinestatic

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to return the next elem in a linked list of MultiBuffers.

This function does not remove the elem, it simply returns a pointer to next one. This function is typically used when traversing a linked list.

Parameters
elemElem in the MultiBuffer list
Returns
Pointer to the next elem in linked list or NULL if at the end

◆ RCL_MultiBuffer_get()

static RCL_MultiBuffer* RCL_MultiBuffer_get ( List_List *  list)
inlinestatic

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to get the first elem in a MultiBuffer list.

Returns the first whole MultiBuffer from a list. Note that this will be done even if the buffer wasn't finished and that the buffer may contain several entries.

Parameters
listA pointer to a linked list of Tx Buffers
Returns
Pointer the first elem in the linked list or NULL if empty

◆ RCL_MultiBuffer_clear()

void RCL_MultiBuffer_clear ( RCL_MultiBuffer *  buffer)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to clear a multi buffer entry for re-use by RCL.

Clear a new multi buffer entry so that it can be re-used by RCL for storing received packets

Parameters
bufferMulti buffer to clear

References RCL_BufferStatePending.

Referenced by RCL_MultiBuffer_init().

◆ RCL_MultiBuffer_init()

void RCL_MultiBuffer_init ( RCL_MultiBuffer *  buffer,
size_t  size 
)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to initialize a multi buffer entry for use by RCL.

Initialize a new multi buffer entry so that it can be provided to RCL for storing received packets

Parameters
bufferMulti buffer to initialize
sizeSize of the buffer in bytes including all fields

References RCL_Debug_assert, and RCL_MultiBuffer_clear().

◆ RCL_MultiBuffer_RxEntry_get()

RCL_Buffer_DataEntry* RCL_MultiBuffer_RxEntry_get ( List_List *  list,
List_List *  consumedBuffers 
)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to get the first entry in a MultiBuffer list.

This function gets the first entry in a MultiBuffer list and consumes it. If one or two whole RCL_MultiBuffer are consumed as a result of this, they are added to the consumedBuffers list.

Parameters
listA pointer to a linked list of MultiBuffers
consumedBuffersA pointer to a linked list which will hold the buffers that were consumed and can now be re-used. The list is not initialized, so that it is possible to get consumed entries appended. If this is not desired, the list should be cleared first. If NULL, consumed buffers are not reported
Returns
Pointer the first entry in the linked list or NULL if empty

References List_consumeAndStore(), RCL_Buffer_DataEntry_paddedLen, RCL_BufferStateFinished, and RCL_Debug_assert.

◆ RCL_MultiBuffer_RxEntry_isEmpty()

bool RCL_MultiBuffer_RxEntry_isEmpty ( List_List *  list)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to check if the MultiBuffer List is out of entries.

This function returns true if there are no more entries to read from a list of MultiBuffers

Parameters
listPointer to list of multi buffers
Returns
true if there are no more entries to read now; false if there are more entries to read

References RxEntry_isAtEnd().

◆ RCL_MultiBuffer_ListInfo_init()

void RCL_MultiBuffer_ListInfo_init ( RCL_MultiBuffer_ListInfo *  listInfo,
List_List *  list 
)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to initialize information for traversing a multi buffer list.

This function prepares a struct for holding information about entries being read from a list of multi buffers. It will set up the struct to start by traversing the head of the list.

Parameters
listInfoPointer to list information which will be set up to start traversing the head of the list
listPointer to list of multi buffers

References RCL_Debug_assert.

◆ RCL_MultiBuffer_RxEntry_next()

RCL_Buffer_DataEntry* RCL_MultiBuffer_RxEntry_next ( RCL_MultiBuffer_ListInfo *  listInfo)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to return the next entry in a list of multi buffers.

This function does not remove the entry, it simply returns a pointer to next one. This function is typically used when traversing a linked list of multi buffers.

Parameters
listInfoStruct with information of the next entry to access. Set up using RCL_MultiBuffer_ListInfo_init before starting.
Returns
Pointer to the entry in the linked list of MultiBuffers or NULL if at the end

References RCL_Buffer_DataEntry_paddedLen, RCL_BufferStateFinished, RCL_Debug_assert, and RCL_MultiBuffer_head().

◆ RCL_MultiBuffer_RxEntry_isLast()

bool RCL_MultiBuffer_RxEntry_isLast ( RCL_MultiBuffer_ListInfo *  listInfo)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to check a traversed entry was the last one.

This function returns true if the latest entry returned by RCL_MultiBuffer_RxEntry_next was the last one

Parameters
listInfoStruct with information of the next entry to access
Returns
true if there are no more entries to read now; false if there are more entries to read

References RCL_Debug_assert, and RxEntry_isAtEnd().

◆ RCL_MultiBuffer_put()

void RCL_MultiBuffer_put ( List_List *  list,
RCL_MultiBuffer *  elem 
)

#include </home/developer/.conan/data/rcl/7.20.01.02/library-lprf/eng/package/b64f4a52bedd1ff8fbfa2101ba929a67456d11d1/source/ti/drivers/rcl/RCL_Buffer.h>

Function to atomically put an elem onto the end of a multi buffer list.

Add an entry to the multi buffer list and notify the running command if there is any

Parameters
listA pointer to the multi buffer list
elemMulti buffer to place onto the end of the linked list

References RCL_SchedulerState::currCmd, RCL_EventRxBufferUpdate, RCL_Scheduler_postEvent(), and rclSchedulerState.