Go to the source code of this file.
Data Structures | |
| struct | ocs_cbuf_t |
Functions | |
| ocs_cbuf_t * | ocs_cbuf_alloc (ocs_os_handle_t os, uint32_t entry_count) |
| Initialize a circular buffer queue. More... | |
| void | ocs_cbuf_free (ocs_cbuf_t *cbuf) |
| Free a circular buffer. More... | |
| void * | ocs_cbuf_get (ocs_cbuf_t *cbuf, int32_t timeout_usec) |
| Get pointer to buffer. More... | |
| int32_t | ocs_cbuf_put (ocs_cbuf_t *cbuf, void *elem) |
| write a buffer More... | |
| int32_t | ocs_cbuf_prime (ocs_cbuf_t *cbuf, ocs_array_t *array) |
| Prime a circular buffer data. More... | |
| ocs_cbuf_t* ocs_cbuf_alloc | ( | ocs_os_handle_t | os, |
| uint32_t | entry_count | ||
| ) |
Initialize a circular buffer queue.
A circular buffer with producer/consumer API is allocated
| os | OS handle |
| entry_count | count of entries |
Definition at line 65 of file ocs_cbuf.c.
| void ocs_cbuf_free | ( | ocs_cbuf_t * | cbuf | ) |
Free a circular buffer.
The memory resources of a circular buffer are free'd
| cbuf | pointer to circular buffer |
Definition at line 103 of file ocs_cbuf.c.
| void* ocs_cbuf_get | ( | ocs_cbuf_t * | cbuf, |
| int32_t | timeout_usec | ||
| ) |
Get pointer to buffer.
Wait for a buffer to become available, and return a pointer to the buffer.
| cbuf | pointer to circular buffer |
| timeout_usec | timeout in microseconds |
Definition at line 126 of file ocs_cbuf.c.
| int32_t ocs_cbuf_prime | ( | ocs_cbuf_t * | cbuf, |
| ocs_array_t * | array | ||
| ) |
Prime a circular buffer data.
Post array buffers to a circular buffer
| cbuf | pointer to circular buffer |
| array | pointer to buffer array |
Definition at line 182 of file ocs_cbuf.c.
| int32_t ocs_cbuf_put | ( | ocs_cbuf_t * | cbuf, |
| void * | elem | ||
| ) |
write a buffer
The buffer is written to the circular buffer.
| cbuf | pointer to circular buffer |
| elem | pointer to entry |
Definition at line 153 of file ocs_cbuf.c.