#include <stdbool.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
◆ FIFO_SIZE
◆ fifo_init()
Initialize a FIFO to empty state.
- Parameters
-
| f | Pointer to fifo_t to initialize |
◆ fifo_read()
| bool fifo_read |
( |
fifo_t * |
f, |
|
|
void * |
data, |
|
|
uint16_t |
len |
|
) |
| |
Read bytes from the FIFO.
- Parameters
-
| f | Pointer to initialized fifo_t |
| data | Destination buffer |
| len | Number of bytes to read |
- Returns
- true if len bytes were read, false if not enough data (FIFO unchanged)
◆ fifo_write()
| bool fifo_write |
( |
fifo_t * |
f, |
|
|
const void * |
data, |
|
|
uint16_t |
len |
|
) |
| |
Write bytes into the FIFO.
- Parameters
-
| f | Pointer to initialized fifo_t |
| data | Source buffer (must not overlap with fifo buffer) |
| len | Number of bytes to write |
- Returns
- true if all bytes were written, false if not enough space (FIFO unchanged)