Instructions
242Libraries
© 2013 Conrad Electronic
Returns information about the number of received CAN messages and CAN transmission errors.
Parameter
infotype selected CAN Bus information
Return Parameter
CAN Library information
infotype parameter:
Value
Definition
Meaning
1
CAN_MSGS
Number of already received CAN messages in the FIFO
2
CAN_ERR_RECV
Number of CAN receive errors (max. 255)
3
CAN_ERR_TRAN
Number of CAN send errors (max. 255)
5.5.4 CAN_Init
CAN Bus Functions
Syntax
void CAN_Init(byte speed, byte fifo_len, byte fifo_addr[]);
Sub CAN_Init(speed As Byte, fifo_len As Byte, ByRef fifo_addr As Byte);
Description
Initializes the CAN functions. During initialization the user provides a RAM buffer for the reception of CAN
messages. Inside this buffer a total of fifo_len messages can be stored. The RAM area must have the size
fifo_len * 14 bytes. If the FIFO is full, incoming CAN messages are not stored.
The user-provided RAM buffer must remain reserved during the use of the CAN interface. Since local
variables will be released after leaving the function, it usually makes sense to declare the buffer as a
global variable.
Parameter
speed CAN Bus transmission speed
fifo_len Number of entries in the receive FIFO
fifo_addr RAM address of the reception buffer
speed parameter:
Value
Definition
CAN Baudrate