/* * fifo.h * * Created on: 25.10.2015 * Author: bernd */ #ifndef INC_FIFO_H_ #define INC_FIFO_H_ #include #include #ifndef FALSE #define FALSE 0 #define TRUE (!FALSE) #endif typedef struct { volatile uint8_t * buffer; volatile size_t size; volatile size_t put; volatile size_t get; }fifo_t; void fifo_init(fifo_t *self, uint8_t * buffer, size_t size); uint8_t fifo_put(fifo_t *self, uint8_t data); uint8_t fifo_get(fifo_t *self, uint8_t * data); uint8_t fifo_is_empty(fifo_t *self); #endif /* INC_FIFO_H_ */