#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
|
| #define | FIFO_POOL(name, len, esize) uint8_t (name)[(len) * (esize)]; |
| |
|
| typedef void() | FifoLockFn(bool lock) |
| | FIFO lock function.
|
| |
◆ FIFO_POOL
| #define FIFO_POOL |
( |
|
name, |
|
|
|
len, |
|
|
|
esize |
|
) |
| uint8_t (name)[(len) * (esize)]; |
◆ FifoLockFn
| typedef void() FifoLockFn(bool lock) |
FIFO lock function.
- Parameters
-
| lock | lock or unlock the system |
Definition at line 16 of file fifo.h.
◆ fifo_clear()
| void fifo_clear |
( |
Fifo * |
f | ) |
|
Clear the FIFO. (Thread-safe)
- Parameters
-
| f | pointer to a FIFO object |
Definition at line 75 of file fifo.c.
◆ fifo_get_level()
| uint32_t fifo_get_level |
( |
const Fifo * |
f | ) |
|
Get the FIFO utilization level.
- Parameters
-
- Returns
- utilization level
Definition at line 44 of file fifo.c.
◆ fifo_init()
| void fifo_init |
( |
Fifo * |
f, |
|
|
uint32_t |
len, |
|
|
uint32_t |
esize, |
|
|
uint8_t * |
data, |
|
|
FifoLockFn |
lockFn |
|
) |
| |
Initialize the FIFO.
- Parameters
-
| f | pointer to an uninitialized FIFO object |
| len | number of slots |
| esize | size of an element |
| data | pointer to the data pool |
| lockFn | pointer to the locking function |
Definition at line 4 of file fifo.c.
◆ fifo_pop()
| bool fifo_pop |
( |
Fifo * |
f, |
|
|
void * |
item |
|
) |
| |
Pop the front item from the FIFO. (Thread-safe)
- Parameters
-
| f | pointer to a FIFO object |
| item | pointer to a block where the item is going to be pushed |
- Returns
- pop successful
Definition at line 48 of file fifo.c.
◆ fifo_push()
| bool fifo_push |
( |
Fifo * |
f, |
|
|
void const * |
item |
|
) |
| |
Push a new item into the FIFO. (Thread-safe)
- Parameters
-
| f | pointer to a FIFO object |
| item | pointer to an item to push |
- Returns
- push successful
Definition at line 17 of file fifo.c.