CANopen Slave Documentation
Version 6.16.04
|
This FIFO implementation is using inline functions and is optimized for embedded implementation. The FIFO can store data elements of arbitrary size.
Data Structures | |
struct | McFifoCtrl_s |
Functions | |
void * | McFifoDataInPtr (McFifoCtrl_ts *ptsFifoV) |
void * | McFifoDataOutPtr (McFifoCtrl_ts *ptsFifoV) |
uint32_t | McFifoFree (McFifoCtrl_ts *ptsFifoV) |
void | McFifoIncIn (McFifoCtrl_ts *ptsFifoV) |
void | McFifoIncOut (McFifoCtrl_ts *ptsFifoV) |
void | McFifoInit (McFifoCtrl_ts *ptsFifoV, void *pvdDataV, uint32_t ulDataSizeV, uint32_t ulFifoSizeV) |
bool_t | McFifoIsEmpty (McFifoCtrl_ts *ptsFifoV) |
bool_t | McFifoIsFull (McFifoCtrl_ts *ptsFifoV) |
uint32_t | McFifoPending (McFifoCtrl_ts *ptsFifoV) |
void * McFifoDataInPtr | ( | McFifoCtrl_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to FIFO control structure |
The function returns a pointer to the next free data element inside the FIFO defined by ptsFifoV for push operation.
void * McFifoDataOutPtr | ( | McFifoCtrl_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to FIFO control structure |
The function returns a pointer to the first data element inside the FIFO defined by ptsFifoV for pop operation.
uint32_t McFifoFree | ( | McFifoCtrl_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to FIFO control structure |
This function returns the number of data elements which can be stored inside the FIFO defined by ptsFifoV.
void McFifoIncIn | ( | McFifoCtrl_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to FIFO control structure |
This function increments the pointer for the input data element (push operation) inside the FIFO defined by ptsFifoV. This operation is done after McFifoDataInPtr() has been called.
void McFifoIncOut | ( | McFifoCtrl_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to FIFO control structure |
This function decrements the pointer for the output data element (pop operation) inside the FIFO defined by ptsFifoV. This operation is done after McFifoDataOutPtr() has been called.
void McFifoInit | ( | McFifoCtrl_ts * | ptsFifoV, |
void * | pvdDataV, | ||
uint32_t | ulDataSizeV, | ||
uint32_t | ulFifoSizeV | ||
) |
[in] | ptsFifoV | Pointer to FIFO control structure |
[in] | pvdDataV | Pointer to array of data elements |
[in] | ulDataSizeV | Size of one single data element in bytes |
[in] | ulFifoSizeV | Maximum number of data elements in FIFO |
This function initialises a FIFO defined by the control structure ptsFifoV with a maximum size of ulFifoSizeV data elements. The application must guarantee that the pointer pvdDataV points to an array of ulFifoSizeV data elements. The size in bytes of the arbitrary data element is defined by ulDataSizeV.
Here is an example for initialisation of a FIFO:
bool_t McFifoIsEmpty | ( | McFifoCtrl_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to FIFO control structure |
The function returns true if the FIFO is empty, otherwise it will return false.
bool_t McFifoIsFull | ( | McFifoCtrl_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to FIFO control structure |
The function returns true if the FIFO is full, otherwise it will return false.
uint32_t McFifoPending | ( | McFifoCtrl_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to FIFO control structure |
The function returns the number of data elements which are stored inside the FIFO defined by ptsFifoV.