Chapter 2. API Reference
Warning This API is not thread safe. So, if multiple threads are accessing the same ring buffer, it is the
application’s responsibility to ensure atomic access to this API and the subsequent Send
Note An empty no-split buffer has a max current free size for an item that is limited to ((buffer_size/2)-
header_size). See API reference for xRingbufferGetMaxItemSize().
Return Current free size, in bytes, available for an entry
Parameters
• [in] xRingbuffer: Ring buffer to query
BaseType_t xRingbufferAddToQueueSetRead(RingbufHandle_t xRingbuffer, QueueSetHandle_t
xQueueSet)
Add the ring buffer’s read semaphore to a queue set.
The ring buffer’s read semaphore indicates that data has been written to the ring buffer. This function adds
the ring buffer’s read semaphore to a queue set.
Return
• pdTRUE on success, pdFALSE otherwise
Parameters
• [in] xRingbuffer: Ring buffer to add to the queue set
• [in] xQueueSet: Queue set to add the ring buffer’s read semaphore to
BaseType_t xRingbufferCanRead(RingbufHandle_t xRingbuffer, QueueSetMemberHandle_t xMem-
ber)
Check if the selected queue set member is the ring buffer’s read semaphore.
This API checks if queue set member returned from xQueueSelectFromSet() is the read semaphore of this
ring buffer. If so, this indicates the ring buffer has items waiting to be retrieved.
Return
• pdTRUE when semaphore belongs to ring buffer
• pdFALSE otherwise.
Parameters
• [in] xRingbuffer: Ring buffer which should be checked
• [in] xMember: Member returned from xQueueSelectFromSet
BaseType_t xRingbufferRemoveFromQueueSetRead(RingbufHandle_t xRingbuffer, Queue-
SetHandle_t xQueueSet)
Remove the ring buffer’s read semaphore from a queue set.
This specifically removes a ring buffer’s read semaphore from a queue set. The read semaphore is used to
indicate when data has been written to the ring buffer
Return
• pdTRUE on success
• pdFALSE otherwise
Parameters
• [in] xRingbuffer: Ring buffer to remove from the queue set
• [in] xQueueSet: Queue set to remove the ring buffer’s read semaphore from
void vRingbufferGetInfo(RingbufHandle_t xRingbuffer, UBaseType_t *uxFree, UBaseType_t
*uxRead, UBaseType_t *uxWrite, UBaseType_t *uxAcquire, UBaseType_t
*uxItemsWaiting)
Get information about ring buffer status.
Get information of the a ring buffer’s current status such as free/read/write pointer positions, and number of
items waiting to be retrieved. Arguments can be set to NULL if they are not required.
Parameters
• [in] xRingbuffer: Ring buffer to remove from the queue set
• [out] uxFree: Pointer use to store free pointer position
• [out] uxRead: Pointer use to store read pointer position
• [out] uxWrite: Pointer use to store write pointer position
• [out] uxAcquire: Pointer use to store acquire pointer position
• [out] uxItemsWaiting: Pointer use to store number of items (bytes for byte buffer) waiting
to be retrieved
Espressif Systems 969
Submit Document Feedback
Release v4.4