MCU-Common
Modules useful for embedded (MCU) programming
fifo Struct Reference

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...
 

Detailed Description

FIFO instance.

Field Documentation

◆ buffer

void* buffer

Pointer to the buffer holding FIFO elements.

Its size must be (element_size * buffer_capacity) bytes.

◆ element_size

size_t element_size

Size of a single element.

◆ buffer_capacity

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)

◆ tail

volatile size_t tail

Read index (handled internally)

◆ head

volatile size_t head

Write index (handled internally)


The documentation for this struct was generated from the following file: