Chapter 2. API Reference
• [in] xBufferType: Type of ring buffer, see documentation.
RingbufHandle_t xRingbufferCreateNoSplit(size_t xItemSize, size_t xItemNum)
Create a ring buffer of type RINGBUF_TYPE_NOSPLIT for a fixed item_size.
This API is similar to xRingbufferCreate(), but it will internally allocate additional space for the headers.
Return A RingbufHandle_t handle to the created ring buffer, or NULL in case of error.
Parameters
• [in] xItemSize: Size of each item to be put into the ring buffer
• [in] xItemNum: Maximum number of items the buffer needs to hold simultaneously
RingbufHandle_t xRingbufferCreateStatic(size_t xBufferSize, RingbufferType_t xBufferType,
uint8_t *pucRingbufferStorage, StaticRingbuffer_t
*pxStaticRingbuffer)
Create a ring buffer but manually provide the required memory.
Note xBufferSize of no-split/allow-split buffers MUST be 32-bit aligned.
Return A handle to the created ring buffer
Parameters
• [in] xBufferSize: Size of the buffer in bytes.
• [in] xBufferType: Type of ring buffer, see documentation
• [in] pucRingbufferStorage: Pointer to the ring buffer’s storage area. Storage area must
of the same size as specified by xBufferSize
• [in] pxStaticRingbuffer: Pointed to a struct of type StaticRingbuffer_t which will be
used to hold the ring buffer’s data structure
BaseType_t xRingbufferSend(RingbufHandle_t xRingbuffer, const void *pvItem, size_t xItemSize,
TickType_t xTicksToWait)
Insert an item into the ring buffer.
Attempt to insert an item into the ring buffer. This function will block until enough free space is available or
until it times out.
Note For no-split/allow-split ring buffers, the actual size of memory that the item will occupy will be rounded
up to the nearest 32-bit aligned size. This is done to ensure all items are always stored in 32-bit aligned
fashion.
Return
• pdTRUE if succeeded
• pdFALSE on time-out or when the data is larger than the maximum permissible size of the buffer
Parameters
• [in] xRingbuffer: Ring buffer to insert the item into
• [in] pvItem: Pointer to data to insert. NULL is allowed if xItemSize is 0.
• [in] xItemSize: Size of data to insert.
• [in] xTicksToWait: Ticks to wait for room in the ring buffer.
BaseType_t xRingbufferSendFromISR(RingbufHandle_t xRingbuffer, const void *pvItem, size_t
xItemSize, BaseType_t *pxHigherPriorityTaskWoken)
Insert an item into the ring buffer in an ISR.
Attempt to insert an item into the ring buffer from an ISR. This function will return immediately if there is
insufficient free space in the buffer.
Note For no-split/allow-split ring buffers, the actual size of memory that the item will occupy will be rounded
up to the nearest 32-bit aligned size. This is done to ensure all items are always stored in 32-bit aligned
fashion.
Return
• pdTRUE if succeeded
• pdFALSE when the ring buffer does not have space.
Parameters
• [in] xRingbuffer: Ring buffer to insert the item into
• [in] pvItem: Pointer to data to insert. NULL is allowed if xItemSize is 0.
• [in] xItemSize: Size of data to insert.
• [out] pxHigherPriorityTaskWoken: Value pointed to will be set to pdTRUE if the
function woke up a higher priority task.
Espressif Systems 965
Submit Document Feedback
Release v4.4