CANopen Slave Documentation
Version 6.16.04
|
A CAN message FIFO can be assigned to every message message buffer by calling CpCoreFifoConfig(). This file defines the structure of a CAN message FIFO (CpFifo_s) and inline functions to access the FIFO.
Data Structures | |
struct | CpFifo_s |
Functions | |
void | CpFifoClear (CpFifo_ts *ptsFifoV) |
bool_t | CpFifoCopy (CpFifo_ts *ptsDestFifoV, CpFifo_ts *ptsSrcFifoV) |
CpCanMsg_ts * | CpFifoDataInPtr (CpFifo_ts *ptsFifoV) |
CpCanMsg_ts * | CpFifoDataOutPtr (CpFifo_ts *ptsFifoV) |
uint32_t | CpFifoFree (CpFifo_ts *ptsFifoV) |
void | CpFifoIncIn (CpFifo_ts *ptsFifoV) |
void | CpFifoIncOut (CpFifo_ts *ptsFifoV) |
void | CpFifoInit (CpFifo_ts *ptsFifoV, CpCanMsg_ts *ptsCanMsgV, uint32_t ulSizeV) |
bool_t | CpFifoIsEmpty (CpFifo_ts *ptsFifoV) |
bool_t | CpFifoIsFull (CpFifo_ts *ptsFifoV) |
uint32_t | CpFifoPending (CpFifo_ts *ptsFifoV) |
void CpFifoClear | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | Pointer to CAN message FIFO |
This function clears all entries inside the FIFO.
[in] | ptsDestFifoV | Pointer to CAN message FIFO destination |
[in] | ptsSrcFifoV | Pointer to CAN message FIFO source |
true
if FIFO contents has been copied, otherwise false
This function copies the contents from ptsSrcFifoV to ptsDestFifoV. The function checks if the destination FIFO has the same size as the source FIFO. Both FIFOs have to be initialised by CpFifoInit() in advance.
CpCanMsg_ts * CpFifoDataInPtr | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
This function returns a pointer to the next free CAN message entry inside the FIFO. Please make sure to call CpFifoIsFull() in advance. After writing to the FIFO the index has to adjusted by calling CpFifoIncIn(), like shown in this code example:
CpCanMsg_ts * CpFifoDataOutPtr | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
This function returns a pointer to the first CAN message entry inside the FIFO. Please make sure to call CpFifoIsEmpty() in advance. After reading from the FIFO the index has to adjusted by calling CpFifoIncOut(), like shown in this code example:
uint32_t CpFifoFree | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
The function returns the number of free elements inside the FIFO given by pointer ptsFifoV.
void CpFifoIncIn | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
This function increments the CpFifo_ts::ulIndexIn element of the CAN message FIFO.
void CpFifoIncOut | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
This function increments the CpFifo_ts::ulIndexOut element of the CAN message FIFO.
void CpFifoInit | ( | CpFifo_ts * | ptsFifoV, |
CpCanMsg_ts * | ptsCanMsgV, | ||
uint32_t | ulSizeV | ||
) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
[in] | ptsCanMsgV | - Pointer to array of CAN messages |
[in] | ulSizeV | - Size if CAN message array |
This function initialises a CAN message FIFO. The paramter ptsCanMsgV points to an array of CpCanMsg_ts elements. The number of messages which can be stored inside the array is determined by the paramter ulSizeV.
Here is an example for initialisation of a CAN message FIFO:
bool_t CpFifoIsEmpty | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
The function returns true if the FIFO is empty, otherwise it will return false.
bool_t CpFifoIsFull | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
The function returns true if the FIFO is full, otherwise it will return false.
uint32_t CpFifoPending | ( | CpFifo_ts * | ptsFifoV | ) |
[in] | ptsFifoV | - Pointer to CAN message FIFO |
The function returns the number of pending elements inside the FIFO given by ptsFifoV.