12 #include "qcritical.h"
20 #define Q_QUEUES ( 1 )
53 typedef struct _qQueue_s {
55 struct _qQueue_Private_s {
60 volatile size_t itemsWaiting;
71 #define QUEUE_SEND_TO_BACK ( 0U )
75 #define QUEUE_SEND_TO_FRONT ( 1U )
100 const size_t itemSize,
101 const size_t itemsCount );
qBool_t qQueue_IsEmpty(const qQueue_t *const q)
Returns the empty status of the Queue.
Definition qqueues.c:72
void * qQueue_Peek(const qQueue_t *const q)
Looks at the data from the front of the Queue without removing it.
Definition qqueues.c:118
qUINT8_t qQueue_InsertMode_t
A typedef to indicate the queue send mode : QUEUE_SEND_TO_BACK or QUEUE_SEND_TO_FRONT.
Definition qqueues.h:79
qBool_t qQueue_Send(qQueue_t *const q, void *itemToQueue, const qQueue_InsertMode_t pos)
Post an item to the the queue. The item is queued by copy, not by reference.
Definition qqueues.c:218
qBool_t qQueue_IsFull(const qQueue_t *const q)
Returns the full status of the Queue.
Definition qqueues.c:105
qBool_t qQueue_Receive(qQueue_t *const q, void *dst)
Receive an item from a queue (and removes it). The item is received by copy so a buffer of adequate s...
Definition qqueues.c:197
qBool_t qQueue_RemoveFront(qQueue_t *const q)
Remove the data located at the front of the Queue.
Definition qqueues.c:142
qBool_t qQueue_Setup(qQueue_t *const q, void *pData, const size_t itemSize, const size_t itemsCount)
Configures a Queue. Here, the RAM used to hold the queue data pData is statically allocated at compil...
Definition qqueues.c:32
qBool_t qQueue_IsReady(const qQueue_t *const q)
Check if the queue is already initialized by using qQueue_Setup() API.
Definition qqueues.c:19
qBool_t qQueue_Reset(qQueue_t *const q)
Resets a queue to its original empty state.
Definition qqueues.c:55
size_t qQueue_Count(const qQueue_t *const q)
Returns the number of items in the Queue.
Definition qqueues.c:83
size_t qQueue_ItemsAvailable(const qQueue_t *const q)
Returns the number of available slots to hold items inside the queue.
Definition qqueues.c:94
qUINT8_t qBool_t
A type to instantiate an OS boolean variable.
Definition qtypes.h:139
uint8_t qUINT8_t
Unsigned integer type with width of exactly 8 bits respectively.
Definition qtypes.h:44
A Queue object.
Definition qqueues.h:53