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