66 #define VQ_INIT(NAME, SIZE) \
67 static uint8_t NAME ## _mem[SIZE];\
68 static VarQueue NAME = { \
69 .mem = NAME ## _mem, \
115 bool vqPeek(
VarQueue *
const vq, uint16_t * length, uint8_t * buffer);
bool vqDeQueue(VarQueue *const vq, uint16_t *length, uint8_t *buffer)
DeQueues an element from the queue.
bool vqQueue(VarQueue *const vq, uint16_t length, uint8_t *buffer)
Queues an element on the queue.
uint8_t *const mem
Pointer to memory.
static void vqReset(VarQueue *const vq)
Resets the queue, such that is is empty.
Variable length queue structure.
uint16_t vqDeQueueLength(VarQueue *const vq)
Returns the lenght of the next element to dequeue.
bool vqPeek(VarQueue *const vq, uint16_t *length, uint8_t *buffer)
Peeks an element from the queue.
const uint16_t size
Size of the memory.
uint16_t vqFree(VarQueue *const vq)
Returns the number of bytes free for the next element.
uint16_t write
write index
bool vqRemove(VarQueue *const vq)
Removes the first element from the queue (not the last).