|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Data Structures | |
| struct | sys_ringq |
| A structure to represent a ringq queue. More... | |
Macros | |
| #define | SYS_RINGQ_DEFINE(name, item_size, item_capacity) |
| Define and initialize a ring queue. | |
Functions | |
| static void | sys_ringq_init (struct sys_ringq *ringq, uint8_t *data, size_t data_size, size_t item_size) |
| Initialize a ringq queue. | |
| static void | sys_ringq_reset (struct sys_ringq *ringq) |
| Reset ringq queue state to its initial state. | |
| static bool | sys_ringq_empty (const struct sys_ringq *ringq) |
| Determine if a sys_ringq is empty. | |
| static bool | sys_ringq_full (const struct sys_ringq *ringq) |
| Determine if a sys_ringq is full. | |
| static size_t | sys_ringq_space (const struct sys_ringq *ringq) |
| Determine free space in a ringq queue. | |
| static size_t | sys_ringq_capacity (const struct sys_ringq *ringq) |
| Return ringq queue capacity. | |
| static size_t | sys_ringq_size (const struct sys_ringq *ringq) |
| Determine size of available data in a ringq queue. | |
| static int | sys_ringq_put (struct sys_ringq *ringq, const void *element) |
| Write (copy) data to a ringq queue. | |
| static int | sys_ringq_get (struct sys_ringq *ringq, void *element) |
| Read data from a sys_ringq queue. | |
| static int | sys_ringq_peek (struct sys_ringq *ringq, void *data) |
| Peek first element from a sys_ringq queue. | |
| #define SYS_RINGQ_DEFINE | ( | name, | |
| item_size, | |||
| item_capacity ) |
#include <zephyr/sys/ringq.h>
Define and initialize a ring queue.
This macro establishes a sys_ringq queue of a fixed size.
| name | Name of the ringq instance. |
| item_size | Size of each ringq element (in bytes). |
| item_capacity | capacity (in number of elements). |
#include <zephyr/sys/ringq.h>
Return ringq queue capacity.
| ringq | Address of sys_ringq struct. |
#include <zephyr/sys/ringq.h>
Determine if a sys_ringq is empty.
| ringq | Address of sys_ringq struct. |
#include <zephyr/sys/ringq.h>
Determine if a sys_ringq is full.
| ringq | Address of sys_ringq struct. |
|
inlinestatic |
#include <zephyr/sys/ringq.h>
Read data from a sys_ringq queue.
This routine reads data from a ringq queue buf.
| ringq | Address of the sys_ringq struct. |
| element | Address of the output buffer. |
| 0 | if successful, -ENODATA if the ringq is empty. |
|
inlinestatic |
#include <zephyr/sys/ringq.h>
Initialize a ringq queue.
This routine initializes a ringq queue.
| ringq | Address of sys_ringq struct. |
| data | ringq sys_ringq data area. |
| data_size | Size of the ringq data area (in bytes). |
| item_size | Size of each ringq element (in bytes). |
|
inlinestatic |
#include <zephyr/sys/ringq.h>
Peek first element from a sys_ringq queue.
| ringq | Address of sys_ringq struct. |
| data | Address of the output buffer. |
| 0 | if successful, -ENODATA if the ringq is empty. |
|
inlinestatic |
#include <zephyr/sys/ringq.h>
Write (copy) data to a ringq queue.
This routine writes data to a ringq queue queue.
| ringq | Address of sys_ringq queue. |
| element | Address of item. |
| 0 | if successful, -ENOSPC if there is no space in the ringq. |
|
inlinestatic |
#include <zephyr/sys/ringq.h>
Reset ringq queue state to its initial state.
| ringq | Address of sys_ringq struct. |
#include <zephyr/sys/ringq.h>
Determine size of available data in a ringq queue.
| ringq | Address of sys_ringq struct. |
#include <zephyr/sys/ringq.h>
Determine free space in a ringq queue.
| ringq | Address of ringq queue. |