Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_fifo

FIFO buffer implementation. More...

Data Structures

struct  bc_fifo_t
 Structure of FIFO instance. More...
 

Functions

void bc_fifo_init (bc_fifo_t *fifo, void *buffer, size_t size)
 Initialize FIFO buffer. More...
 
void bc_fifo_purge (bc_fifo_t *fifo)
 Purge FIFO buffer. More...
 
size_t bc_fifo_write (bc_fifo_t *fifo, const void *buffer, size_t length)
 Write data to FIFO. More...
 
size_t bc_fifo_read (bc_fifo_t *fifo, void *buffer, size_t length)
 Read data from FIFO. More...
 
size_t bc_fifo_irq_write (bc_fifo_t *fifo, const void *buffer, size_t length)
 Write data to FIFO from interrupt. More...
 
size_t bc_fifo_irq_read (bc_fifo_t *fifo, void *buffer, size_t length)
 Read data from FIFO from interrupt. More...
 
bool bc_fifo_is_empty (bc_fifo_t *fifo)
 Is empty. More...
 

Detailed Description

FIFO buffer implementation.

Function Documentation

void bc_fifo_init ( bc_fifo_t fifo,
void *  buffer,
size_t  size 
)

Initialize FIFO buffer.

Parameters
[in]fifoFIFO instance
[in]bufferPointer to buffer where FIFO holds data
[in]sizeSize of buffer where FIFO holds data

Definition at line 4 of file bc_fifo.c.

Referenced by bc_atci_init(), bc_cmwx1zzabz_init(), bc_dma_init(), bc_esp8266_init(), bc_td1207r_init(), bc_usb_cdc_init(), and bc_wssfm10r1at_init().

Here is the caller graph for this function:

size_t bc_fifo_irq_read ( bc_fifo_t fifo,
void *  buffer,
size_t  length 
)

Read data from FIFO from interrupt.

Parameters
[in]fifoFIFO instance
[out]bufferPointer to buffer where data will be read
[in]lengthNumber of requested bytes to be read
Returns
Number of bytes read

Definition at line 133 of file bc_fifo.c.

size_t bc_fifo_irq_write ( bc_fifo_t fifo,
const void *  buffer,
size_t  length 
)

Write data to FIFO from interrupt.

Parameters
[in]fifoFIFO instance
[in]bufferPointer to buffer from which data will be written
[in]lengthNumber of requested bytes to be written
Returns
Number of bytes written

Definition at line 101 of file bc_fifo.c.

bool bc_fifo_is_empty ( bc_fifo_t fifo)

Is empty.

Parameters
[in]fifoFIFO instance
Returns
true When is empty
false When is not empty

Definition at line 161 of file bc_fifo.c.

Here is the call graph for this function:

void bc_fifo_purge ( bc_fifo_t fifo)

Purge FIFO buffer.

Parameters
[in]fifoFIFO instance

Definition at line 12 of file bc_fifo.c.

size_t bc_fifo_read ( bc_fifo_t fifo,
void *  buffer,
size_t  length 
)

Read data from FIFO.

Parameters
[in]fifoFIFO instance
[out]bufferPointer to buffer where data will be read
[in]lengthNumber of requested bytes to be read
Returns
Number of bytes read

Definition at line 63 of file bc_fifo.c.

Referenced by bc_module_rs485_async_read(), bc_uart_async_read(), and bc_usb_cdc_read().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t bc_fifo_write ( bc_fifo_t fifo,
const void *  buffer,
size_t  length 
)

Write data to FIFO.

Parameters
[in]fifoFIFO instance
[in]bufferPointer to buffer from which data will be written
[in]lengthNumber of requested bytes to be written
Returns
Number of bytes written

Definition at line 18 of file bc_fifo.c.

Referenced by bc_module_rs485_async_write(), and bc_uart_async_write().

Here is the call graph for this function:

Here is the caller graph for this function: