Data Structures | |
struct | KFifo |
Defines | |
#define | FIFOEMPTY(fifo) (fifo->mem_avail==fifo->size) |
#define | FIFOPRNTSTATS(fifo) {GENDEBUG("top = %d\r\n",(long)fifo->top);GENDEBUG("bottom = %d\r\n",(long)fifo->bottom); GENDEBUG("mem_avail = %d\r\n",(long)fifo->mem_avail);GENDEBUG("size = %d\r\n",(long)fifo->size);} |
Typedefs | |
typedef KFifo | KFifo |
Functions | |
int | InitFifo (KFifo *Fifo, size_t size, u8 *array) |
int | FifoPush (KFifo *Fifo, const char data) |
ssize_t | FifoPushBlock (KFifo *Fifo, const char *buffer, size_t count) |
char | FifoPull (KFifo *Fifo) |
ssize_t | FifoPullBlock (KFifo *Fifo, char *buffer, size_t count) |
int | DestroyFifo (KFifo *Fifo) |
|
Destroy a fifo Since this fifo implementation used static memory for everything this function is just an empty shell If you want to clear a fifo just re-initialize it.
|
|
Pull a byte from a fifo This function doesn't give any indication of success or failure, it simply returns 0 if no data is available (of course zero could be a valid data byte in the fifo) If you need to know if it succeeded or not use FifoPullBlock and just pull 1 byte
|
|
Pull a block of data from a fifo
|
|
Push a byte into a fifo
|
|
Push a block of data into a fifo
|
|
Create Initialize a new Fifo structure around an array InitFifo takes an existing array and wraps a fifo structure around it. Once this has been done the other fifo functions can be used to push and pull data out of it.
|