Firmware SDK
|
FIFO buffer implementation. More...
Data Structures | |
struct | twr_fifo_t |
Structure of FIFO instance. More... | |
Functions | |
void | twr_fifo_init (twr_fifo_t *fifo, void *buffer, size_t size) |
Initialize FIFO buffer. More... | |
void | twr_fifo_purge (twr_fifo_t *fifo) |
Purge FIFO buffer. More... | |
size_t | twr_fifo_write (twr_fifo_t *fifo, const void *buffer, size_t length) |
Write data to FIFO. More... | |
size_t | twr_fifo_read (twr_fifo_t *fifo, void *buffer, size_t length) |
Read data from FIFO. More... | |
size_t | twr_fifo_irq_write (twr_fifo_t *fifo, const void *buffer, size_t length) |
Write data to FIFO from interrupt. More... | |
size_t | twr_fifo_irq_read (twr_fifo_t *fifo, void *buffer, size_t length) |
Read data from FIFO from interrupt. More... | |
bool | twr_fifo_is_empty (twr_fifo_t *fifo) |
Is empty. More... | |
FIFO buffer implementation.
void twr_fifo_init | ( | twr_fifo_t * | fifo, |
void * | buffer, | ||
size_t | size | ||
) |
Initialize FIFO buffer.
[in] | fifo | FIFO instance |
[in] | buffer | Pointer to buffer where FIFO holds data |
[in] | size | Size of buffer where FIFO holds data |
Definition at line 4 of file twr_fifo.c.
Referenced by twr_atci_init(), twr_cmwx1zzabz_init(), twr_dma_init(), twr_td1207r_init(), twr_usb_cdc_init(), and twr_wssfm10r1at_init().
size_t twr_fifo_irq_read | ( | twr_fifo_t * | fifo, |
void * | buffer, | ||
size_t | length | ||
) |
Read data from FIFO from interrupt.
[in] | fifo | FIFO instance |
[out] | buffer | Pointer to buffer where data will be read |
[in] | length | Number of requested bytes to be read |
Definition at line 133 of file twr_fifo.c.
size_t twr_fifo_irq_write | ( | twr_fifo_t * | fifo, |
const void * | buffer, | ||
size_t | length | ||
) |
Write data to FIFO from interrupt.
[in] | fifo | FIFO instance |
[in] | buffer | Pointer to buffer from which data will be written |
[in] | length | Number of requested bytes to be written |
Definition at line 101 of file twr_fifo.c.
bool twr_fifo_is_empty | ( | twr_fifo_t * | fifo | ) |
Is empty.
[in] | fifo | FIFO instance |
Definition at line 161 of file twr_fifo.c.
void twr_fifo_purge | ( | twr_fifo_t * | fifo | ) |
size_t twr_fifo_read | ( | twr_fifo_t * | fifo, |
void * | buffer, | ||
size_t | length | ||
) |
Read data from FIFO.
[in] | fifo | FIFO instance |
[out] | buffer | Pointer to buffer where data will be read |
[in] | length | Number of requested bytes to be read |
Definition at line 63 of file twr_fifo.c.
Referenced by twr_module_rs485_async_read(), twr_uart_async_read(), and twr_usb_cdc_read().
size_t twr_fifo_write | ( | twr_fifo_t * | fifo, |
const void * | buffer, | ||
size_t | length | ||
) |
Write data to FIFO.
[in] | fifo | FIFO instance |
[in] | buffer | Pointer to buffer from which data will be written |
[in] | length | Number of requested bytes to be written |
Definition at line 18 of file twr_fifo.c.
Referenced by twr_module_rs485_async_write(), and twr_uart_async_write().