Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
queues.h
Go to the documentation of this file.
1
5// do not use pragma once here, has this can be mocked
6#ifndef HAL_QUEUES_H
7#define HAL_QUEUES_H
8
9#ifdef __cplusplus
10
11#include <cstddef>
12#include <cstdint>
13
14namespace lampda {
15namespace hal {
17namespace queues {
18
19extern "C" {
20#endif
21
22 typedef void* QueueHandle_t;
23
27 typedef enum
28 {
29 HAL_QUEUE_OK = 0,
30 HAL_QUEUE_ERR_INVALID_PARAM = -1,
31 HAL_QUEUE_ERR_TIMEOUT = -2,
32 HAL_QUEUE_ERR_FULL = -3,
33 HAL_QUEUE_ERR_EMPTY = -4,
34 HAL_QUEUE_ERR_OTHER = -5
36
43 QueueHandle_t HAL_create_queue(size_t itemSize, uint32_t queueLength);
44
49 void HAL_delete_queue(QueueHandle_t handle);
50
58 HAL_queue_status_t HAL_queue_send(QueueHandle_t handle, const void* item, uint32_t timeoutMs);
59
67 HAL_queue_status_t HAL_queue_receive(QueueHandle_t handle, void* const outItem, uint32_t timeoutMs);
68
69#ifdef __cplusplus
70}
71} // namespace queues
72} // namespace hal
73} // namespace lampda
74#endif
75
76#endif
HAL_queue_status_t HAL_queue_receive(QueueHandle_t handle, void *const outItem, uint32_t timeoutMs)
Receive an item from the queue. Blocks until an item is available or timeout expires.
Definition: queues.cpp:39
HAL_queue_status_t HAL_queue_send(QueueHandle_t handle, const void *item, uint32_t timeoutMs)
Send an item to the queue.
Definition: queues.cpp:23
void HAL_delete_queue(QueueHandle_t handle)
Delete/free a queue and release its underlying resources.
Definition: queues.cpp:18
QueueHandle_t HAL_create_queue(size_t itemSize, uint32_t queueLength)
Create a queue with the specified item size and maximum length.
Definition: queues.cpp:12
HAL_queue_status_t
Queue operation status codes.
Definition: queues.h:28
Program scope.
Definition: control_fixed_modes.hpp:12