AVR library
circbuf8.h
1 #ifndef MAT_CIRCBUF8_H
2 #define MAT_CIRCBUF8_H
3 
4 #include <inttypes.h>
5 
6 struct cbuf8_t
7 {
8  uint8_t* buf;
9  uint8_t head;
10  uint8_t tail;
11  uint8_t len;
12  uint8_t size;
13 };
14 
15 void cbuf8_clear(volatile struct cbuf8_t* cb, uint8_t* const p, const uint8_t s);
16 uint8_t cbuf8_put(volatile struct cbuf8_t* cb, const uint8_t d);
17 uint8_t cbuf8_get(volatile struct cbuf8_t* cb, uint8_t* const d);
18 
19 #endif
uint8_t tail
Definition: circbuf8.h:10
uint8_t len
Definition: circbuf8.h:11
uint8_t size
Definition: circbuf8.h:12
uint8_t cbuf8_get(volatile struct cbuf8_t *cb, uint8_t *const d)
Get next element.
Definition: circbuf8.c:66
Definition: circbuf8.h:6
uint8_t * buf
Definition: circbuf8.h:8
uint8_t head
Definition: circbuf8.h:9
uint8_t cbuf8_put(volatile struct cbuf8_t *cb, const uint8_t d)
Insert an element.
Definition: circbuf8.c:41
void cbuf8_clear(volatile struct cbuf8_t *cb, uint8_t *const p, const uint8_t s)
Initializes (clears) circbuf.
Definition: circbuf8.c:21