MCU-Common
Modules useful for embedded (MCU) programming
|
FIFO instance. More...
#include <fifo.h>
Data Fields | |
void * | buffer |
Pointer to the buffer holding FIFO elements. More... | |
size_t | element_size |
Size of a single element. More... | |
size_t | buffer_capacity |
Number of elements the buffer can hold (The actual capacity of the FIFO is buffer_capacity-1 as one element is wasted for lock-free operation) More... | |
volatile size_t | tail |
Read index (handled internally) More... | |
volatile size_t | head |
Write index (handled internally) More... | |
FIFO instance.
void* buffer |
Pointer to the buffer holding FIFO elements.
Its size must be (element_size * buffer_capacity) bytes.
size_t element_size |
Size of a single element.
size_t buffer_capacity |
Number of elements the buffer can hold (The actual capacity of the FIFO is buffer_capacity-1
as one element is wasted for lock-free operation)
volatile size_t tail |
Read index (handled internally)
volatile size_t head |
Write index (handled internally)