17 #ifndef __CIRCULAR_BUFFER_H 18 #define __CIRCULAR_BUFFER_H 41 volatile uint16_t readIndex,
bool cb_IsFull(cb_CircularBuffer *cb)
Check if the queue is full.
Definition: circular_buffer.c:65
uint8_t * buffer
Pointer to the byte buffer.
Definition: circular_buffer.h:39
void cb_Push(cb_CircularBuffer *cb, uint8_t newElem)
Add a item at the back of the queue.
Definition: circular_buffer.c:84
uint8_t cb_Pull(cb_CircularBuffer *cb)
Extract the item at the front of the queue. Returns the value of the item at the front of the queue...
Definition: circular_buffer.c:108
volatile uint16_t writeIndex
Index of the next free location at the end of the queue.
Definition: circular_buffer.h:41
void cb_Init(cb_CircularBuffer *cb, uint8_t *buffer, uint16_t bufferSize)
Initializes a cb_CircularBuffer structure. Initializes a cb_CircularBuffer structure with the given b...
Definition: circular_buffer.c:29
bool cb_IsEmpty(cb_CircularBuffer *cb)
Check if the queue is empty.
Definition: circular_buffer.c:55
Circular buffer structure.
Definition: circular_buffer.h:37
uint16_t cb_ItemsCount(cb_CircularBuffer *cb)
Gets the number of bytes stored in the queue.
Definition: circular_buffer.c:42
uint16_t bufferSize
Size of buffer.
Definition: circular_buffer.h:40