HRI board firmware  v2.1
Microcontroller firmware of the board used during the HRI labs.
Data Structures | Functions
circular_buffer.h File Reference
#include "../main.h"

Go to the source code of this file.

Data Structures

struct  cb_CircularBuffer
 Circular buffer structure. More...
 

Functions

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 buffer. The buffer has to be provided by the user, to avoid dynamic memory allocation. More...
 
uint16_t cb_ItemsCount (cb_CircularBuffer *cb)
 Gets the number of bytes stored in the queue. More...
 
bool cb_IsEmpty (cb_CircularBuffer *cb)
 Check if the queue is empty. More...
 
bool cb_IsFull (cb_CircularBuffer *cb)
 Check if the queue is full. More...
 
void cb_Push (cb_CircularBuffer *cb, uint8_t newElem)
 Add a item at the back of the queue. More...
 
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, and remove this item from the queue. More...