21 lines
354 B
C
21 lines
354 B
C
#ifndef FIFO_h
|
|
#define FIFO_h
|
|
|
|
#include <stdint.h>
|
|
|
|
#define FIFO_SIZE 64
|
|
|
|
struct FIFO {
|
|
int head;
|
|
int tail;
|
|
int size;
|
|
uint8_t buffer[FIFO_SIZE];
|
|
};
|
|
|
|
void FIFO_push(volatile struct FIFO* fifo, uint8_t value);
|
|
uint8_t FIFO_pop(volatile struct FIFO* fifo);
|
|
int FIFO_size(volatile struct FIFO* fifo);
|
|
void FIFO_clear(volatile struct FIFO* fifo);
|
|
|
|
#endif
|