FIFO Library
Software FIFO
 All Data Structures Functions Variables Typedefs Groups Pages
Functions
FUNCTIONS

Functions

void fifo_init (fifo_t *fifo, fifo_data_t *data, fifo_size_t size)
 FIFO initialization. More...
 
void fifo_write (fifo_t *fifo, fifo_data_t data)
 FIFO write access without check for free space. More...
 
void fifo_write_busy (fifo_t *fifo, fifo_data_t data)
 FIFO write access with busy waiting for free space (blocking function) More...
 
fifo_data_t fifo_read_busy (fifo_t *fifo)
 FIFO read access with busy waiting for available data (blocking function) More...
 
fifo_data_t fifo_read (fifo_t *fifo)
 FIFO read access without check for available data. More...
 
fifo_size_t fifo_get_level (fifo_t *fifo)
 Get fill level of FIFO. More...
 
fifo_size_t fifo_get_free (fifo_t *fifo)
 Get free space of fifo. More...
 
void fifo_write_bursted (fifo_t *fifo, fifo_size_t count)
 FIFO write pointer correction after burst write access. More...
 
void fifo_read_bursted (fifo_t *fifo, fifo_size_t count)
 FIFO read pointer correction after burst read access. More...
 
fifo_size_t fifo_get_write_wrap (fifo_t *fifo)
 Get number of elements for write access until pointer wrap around. More...
 
fifo_size_t fifo_get_read_wrap (fifo_t *fifo)
 Get number of elements for read access until pointer wrap around. More...
 

Detailed Description

Standard functions, can be used in normal programm or ISR.

Function Documentation

fifo_size_t fifo_get_free ( fifo_t fifo)

Get free space of fifo.

Parameters
*fifopointer to FIFO struct
Returns
free space of FIFO in elements
fifo_size_t fifo_get_level ( fifo_t fifo)

Get fill level of FIFO.

Parameters
*fifopointer to FIFO struct
Returns
fill level of FIFO in elements
fifo_size_t fifo_get_read_wrap ( fifo_t fifo)

Get number of elements for read access until pointer wrap around.

Parameters
*fifopointer to FIFO struct
Returns
number of elements for read access until pointer wrap around
fifo_size_t fifo_get_write_wrap ( fifo_t fifo)

Get number of elements for write access until pointer wrap around.

Parameters
*fifopointer to FIFO struct
Returns
number of elements for write access until pointer wrap around
void fifo_init ( fifo_t fifo,
fifo_data_t data,
fifo_size_t  size 
)

FIFO initialization.

FIFO can hold only size-1 elements! One element is unused due to organization.

Parameters
*fifopointer to FIFO struct
*datapointer to data buffer
sizesize of data buffer in elements
Returns
none
fifo_data_t fifo_read ( fifo_t fifo)

FIFO read access without check for available data.

Parameters
*fifopointer to FIFO struct
Returns
read data
void fifo_read_bursted ( fifo_t fifo,
fifo_size_t  count 
)

FIFO read pointer correction after burst read access.

Parameters
*fifopointer to FIFO struct
countnumber of elements that have been read
Returns
none
fifo_data_t fifo_read_busy ( fifo_t fifo)

FIFO read access with busy waiting for available data (blocking function)

Parameters
*fifopointer to FIFO struct
Returns
read data
void fifo_write ( fifo_t fifo,
fifo_data_t  data 
)

FIFO write access without check for free space.

Parameters
*fifopointer to FIFO struct
datawrite data
Returns
none
void fifo_write_bursted ( fifo_t fifo,
fifo_size_t  count 
)

FIFO write pointer correction after burst write access.

Parameters
*fifopointer to FIFO struct
countnumber of elements that have been written
Returns
none
void fifo_write_busy ( fifo_t fifo,
fifo_data_t  data 
)

FIFO write access with busy waiting for free space (blocking function)

Parameters
*fifopointer to FIFO struct
datawrite data
Returns
none