14 #ifndef COLL_BYTEFIFO_H_
15 #define COLL_BYTEFIFO_H_
42 #define BF_INIT(NAME, CAP) \
43 static uint8_t NAME ## _buf[CAP]; \
44 static ByteFifo NAME = { \
45 .buf = NAME ## _buf, \
61 return bf->len == bf->cap;
107 bf->len = 0, bf->wp = 0, bf->rp = bf->cap - 1; \
static bool bfEmpty(ByteFifo *const bf)
Returns whether or not the byte-fifo is empty.
bool bfWrite(ByteFifo *const bf, uint8_t b)
Writes a byte to the byte-fifo.
static void bfClear(ByteFifo *const bf)
Clear the fifo.
static bool bfFull(ByteFifo *const bf)
Returns whether or not the byte-fifo is full.
bool bfRead(ByteFifo *const bf, uint8_t *const b)
Reads a byte from the byte-fifo.