|
PatchworkOS
3984a1d
A non-POSIX operating system.
|
First-in first-out buffer. More...
First-in first-out buffer.
Data Structures | |
| struct | fifo_t |
| FIFO Buffer. More... | |
Macros | |
| #define | FIFO_CREATE(_buf, _size) {.buffer = (uint8_t*)(_buf), .size = (_size), .head = 0, .tail = 0} |
| Create a fifo buffer initializer. | |
| #define | FIFO_DEFINE(_name, _size) |
| Define and initialize a fifo buffer. | |
Functions | |
| void | fifo_init (fifo_t *fifo, uint8_t *buffer, size_t size) |
| Initialize a fifo buffer. | |
| void | fifo_reset (fifo_t *fifo) |
| Reset a fifo buffer. | |
| size_t | fifo_bytes_readable (const fifo_t *fifo) |
| Return the number of bytes available for reading in a fifo buffer. | |
| size_t | fifo_bytes_writeable (const fifo_t *fifo) |
| Return the number of bytes available for writing in a fifo buffer. | |
| size_t | fifo_read (fifo_t *fifo, void *buffer, size_t count) |
| Read data from a fifo buffer at a specific offset. | |
| size_t | fifo_write (fifo_t *fifo, const void *buffer, size_t count) |
| Write data to the fifo buffer. | |
| void | fifo_advance_head (fifo_t *fifo, size_t count) |
| Advance the head of the fifo buffer. | |
| void | fifo_advance_tail (fifo_t *fifo, size_t count) |
| Advance the tail of the fifo buffer. | |
Define and initialize a fifo buffer.
Helps define a fifo buffer with a backing buffer.
| _name | The name of the fifo buffer. |
| _size | The size of the fifo buffer in bytes. |
Read data from a fifo buffer at a specific offset.
| fifo | The fifo buffer structure. |
| buffer | The destination buffer. |
| count | The number of bytes to read. |
Definition at line 41 of file fifo.c.
Write data to the fifo buffer.
Will write up to the available space.
| fifo | Pointer to the fifo buffer structure. |
| buffer | The source buffer. |
| count | The number of bytes to write. |
Definition at line 73 of file fifo.c.