![]() |
Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
|
#include <stdbool.h>#include <stddef.h>#include <stdint.h>

Go to the source code of this file.
Data Structures | |
| struct | kfifo |
Functions | |
| void | kfifo_init (struct kfifo *fifo, void *data, size_t esize, size_t size) |
| Initialize a FIFO using preallocated buffer. More... | |
| struct kfifo * | kfifo_alloc (size_t nmem, size_t size) |
| Dynamically allocate a new fifo buffer. More... | |
| void | kfifo_free (struct kfifo *fifo) |
| Deallocate the FIFO. More... | |
| void | kfifo_in (struct kfifo *fifo, const void *data, size_t n) |
| Put data into the FIFO. More... | |
| void | kfifo_out (struct kfifo *fifo, void *data, size_t n) |
| Get data from the FIFO. More... | |
| void | kfifo_out_peek (struct kfifo *fifo, void *data, size_t n) |
| Get some data from the FIFO without removing it. More... | |
| void | kfifo_dma_in_prepare (struct kfifo *fifo, char **data_ptr) |
| Read data pointer of the next element to write. More... | |
| void | kfifo_dma_in_finish (struct kfifo *fifo, size_t n) |
| Complete data writing of FIFO with DMA. More... | |
| void | kfifo_dma_out_prepare (struct kfifo *fifo, char **data_ptr, size_t *n) |
| Read data pointer of the next FIFO element to read. More... | |
| void | kfifo_dma_out_finish (struct kfifo *fifo) |
| Complete data reading of the FIFO with DMA. More... | |
| void | kfifo_put (struct kfifo *fifo, void *data) |
| Put data into the FIFO. More... | |
| void | kfifo_get (struct kfifo *fifo, void *data) |
| Get data from the FIFO. More... | |
| void | kfifo_peek (struct kfifo *fifo, void *data) |
| Get data from the FIFO without removing it. More... | |
| size_t | kfifo_peek_len (struct kfifo *fifo) |
| Return the record length of the next FIFO element to read. More... | |
| void | kfifo_skip (struct kfifo *fifo) |
| Skip next data to read from the FIFO. More... | |
| size_t | kfifo_avail (struct kfifo *fifo) |
| Return the number of unused elements (free space) in the FIFO. More... | |
| size_t | kfifo_len (struct kfifo *fifo) |
| Return the number of used elements in the FIFO. More... | |
| size_t | kfifo_esize (struct kfifo *fifo) |
| Return the size of the element managed by the FIFO. More... | |
| size_t | kfifo_size (struct kfifo *fifo) |
| Return the number of elements can be stored in the FIFO. More... | |
| size_t | kfifo_header_size (void) |
| Return the size of the kfifo header. More... | |
| bool | kfifo_is_empty (struct kfifo *fifo) |
| Return if the FIFO is empty or not. More... | |
| bool | kfifo_is_full (struct kfifo *fifo) |
| Return if the FIFO is full or not. More... | |
| struct kfifo* kfifo_alloc | ( | size_t | nmem, |
| size_t | size | ||
| ) |
Dynamically allocate a new fifo buffer.
| esize | Element size of the FIFO. |
| size | Number of elements in the FIFO. |
| kfifo | Returning object of the allocated FIFO. |
| None |
| size_t kfifo_avail | ( | struct kfifo * | fifo | ) |
Return the number of unused elements (free space) in the FIFO.
| fifo | Pointer to the FIFO. |
| size_t | The number of the avaliable slots. |
| void kfifo_dma_in_finish | ( | struct kfifo * | fifo, |
| size_t | n | ||
| ) |
Complete data writing of FIFO with DMA.
| fifo | The fifo object to provide. |
| n | Size of the data written to the FIFO in bytes. |
| None |
| void kfifo_dma_in_prepare | ( | struct kfifo * | fifo, |
| char ** | data_ptr | ||
| ) |
Read data pointer of the next element to write.
| fifo | Pointer to the FIFO. |
| data_ptr | For saving the data pointer of the next FIFO element to write with DMA. |
| None |
| void kfifo_dma_out_finish | ( | struct kfifo * | fifo | ) |
Complete data reading of the FIFO with DMA.
| fifo | Pointer to the FIFO. |
| None |
| void kfifo_dma_out_prepare | ( | struct kfifo * | fifo, |
| char ** | data_ptr, | ||
| size_t * | n | ||
| ) |
Read data pointer of the next FIFO element to read.
| fifo | Pointer to the FIFO. |
| data_ptr | For saving the data pointer of the next FIFO element to read with DMA. |
| n | Size of the data buffer to read from the fifo with DMA in bytes. |
| None |
| size_t kfifo_esize | ( | struct kfifo * | fifo | ) |
Return the size of the element managed by the FIFO.
| fifo | Pointer to the FIFO. |
| size_t | The size of the element managed by the FIFO. |
| void kfifo_free | ( | struct kfifo * | fifo | ) |
Deallocate the FIFO.
| fifo | Pointer to the FIFO. |
| None |
| void kfifo_get | ( | struct kfifo * | fifo, |
| void * | data | ||
| ) |
Get data from the FIFO.
| fifo | Pointer to the FIFO. |
| data | Pointer to the memory space for retrieving data. |
| None |
| size_t kfifo_header_size | ( | void | ) |
Return the size of the kfifo header.
| None |
| size_t | The size of the kfifo header. |
| void kfifo_in | ( | struct kfifo * | fifo, |
| const void * | data, | ||
| size_t | n | ||
| ) |
Put data into the FIFO.
| fifo | Pointer to the FIFO. |
| data | Pointer to the data. |
| n | Size of the data in bytes. |
| None |
| void kfifo_init | ( | struct kfifo * | fifo, |
| void * | data, | ||
| size_t | esize, | ||
| size_t | size | ||
| ) |
Initialize a FIFO using preallocated buffer.
| fifo | The fifo object. |
| data | The data space for the FIFO. |
| esize | Element size of the FIFO. |
| size | Number of elements in the FIFO. |
| None |
| bool kfifo_is_empty | ( | struct kfifo * | fifo | ) |
Return if the FIFO is empty or not.
| fifo | Pointer to the FIFO. |
| bool | true or false. |
| bool kfifo_is_full | ( | struct kfifo * | fifo | ) |
Return if the FIFO is full or not.
| fifo | Pointer to the FIFO. |
| bool | true or false. |
| size_t kfifo_len | ( | struct kfifo * | fifo | ) |
Return the number of used elements in the FIFO.
| fifo | Pointer to the FIFO. |
| size_t | The number of used elements can be read. |
| void kfifo_out | ( | struct kfifo * | fifo, |
| void * | data, | ||
| size_t | n | ||
| ) |
Get data from the FIFO.
| fifo | Pointer to the FIFO. |
| data | The memory space for retrieving data. |
| n | Size of the data buffer. |
| None |
| void kfifo_out_peek | ( | struct kfifo * | fifo, |
| void * | data, | ||
| size_t | n | ||
| ) |
Get some data from the FIFO without removing it.
| fifo | Pointer to the FIFO. |
| data | The memory space for retrieving data. |
| n | Size of the data buffer. |
| None |
| void kfifo_peek | ( | struct kfifo * | fifo, |
| void * | data | ||
| ) |
Get data from the FIFO without removing it.
| fifo | Pointer to the FIFO. |
| data | Pointer to the memory space for retrieving data. |
| None |
| size_t kfifo_peek_len | ( | struct kfifo * | fifo | ) |
Return the record length of the next FIFO element to read.
| fifo | Pointer to the memory space for retrieving data. |
| size_t | Size of the next FIFO element in bytes. |
| void kfifo_put | ( | struct kfifo * | fifo, |
| void * | data | ||
| ) |
Put data into the FIFO.
| fifo | Pointer to the FIFO. |
| data | Pointer to the data. |
| None |
| size_t kfifo_size | ( | struct kfifo * | fifo | ) |
Return the number of elements can be stored in the FIFO.
| fifo | Pointer to the FIFO. |
| size_t | The number of elements can be stored in the FIFO. |
| void kfifo_skip | ( | struct kfifo * | fifo | ) |
Skip next data to read from the FIFO.
| fifo | Pointer to the FIFO. |
| None |