#include "fifo.h"
#include <string.h>
Go to the source code of this file.
◆ FIFO_ADVANCE_INDEX
#define FIFO_ADVANCE_INDEX |
( |
|
f, |
|
|
|
k |
|
) |
| ((k) >= ((f)->len - 1)) ? 0 : ((k) + 1) |
◆ FIFO_GET_ELEMENT_PTR
#define FIFO_GET_ELEMENT_PTR |
( |
|
f, |
|
|
|
i |
|
) |
| ((void *)(f->data + (f->esize * i))) |
◆ 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.