32#include "ove_config.h"
41#include "ove/storage.h"
43#ifdef CONFIG_OVE_QUEUE
67 void *buffer,
size_t item_size,
unsigned int max_items);
103 unsigned int max_items);
116#elif !defined(__ZIG_CIMPORT__)
119#define ove_queue_create(pq, item_size, max_items) \
120 ({ static ove_queue_storage_t _ove_stor_; \
121 static uint8_t _ove_buf_[(item_size) * (max_items)]; \
122 ove_queue_init((pq), &_ove_stor_, _ove_buf_, \
123 (item_size), (max_items)); })
124#define ove_queue_destroy(q) ove_queue_deinit(q)
149 uint32_t timeout_ms);
174 uint32_t timeout_ms);
void ove_queue_destroy(ove_queue_t q)
Destroy and free a queue allocated with ove_queue_create().
int ove_queue_send(ove_queue_t q, const void *data, uint32_t timeout_ms)
Send an item to the back of the queue, blocking if it is full.
void ove_queue_deinit(ove_queue_t q)
Release resources held by a queue initialised with ove_queue_init().
int ove_queue_receive_from_isr(ove_queue_t q, void *buf)
Receive an item from the queue from an interrupt service routine.
struct ove_queue * ove_queue_t
Opaque handle for a message queue object.
Definition queue.h:39
int ove_queue_init(ove_queue_t *q, ove_queue_storage_t *storage, void *buffer, size_t item_size, unsigned int max_items)
Initialise a queue using caller-supplied static storage and data buffer.
int ove_queue_send_from_isr(ove_queue_t q, const void *data)
Send an item to the queue from an interrupt service routine.
int ove_queue_create(ove_queue_t *q, size_t item_size, unsigned int max_items)
Allocate and initialise a queue from the heap.
int ove_queue_receive(ove_queue_t q, void *buf, uint32_t timeout_ms)
Receive (remove) an item from the front of the queue, blocking if it is empty.
#define OVE_ERR_NOT_SUPPORTED
The requested feature is not supported by the active backend.
Definition types.h:38