hsk-libs-dev  270
High Speed Karlsruhe XC878 library collection
Macros
CAN Node Status Fields

This group of defines specifies status fields that can be queried from hsk_can_status(). More...

Macros

#define CAN_STATUS_LEC   0
 The Last Error Code field provides the error triggered by the last message on the bus. More...
 
#define CAN_STATUS_TXOK   1
 Message Transmitted Successfully. More...
 
#define CAN_STATUS_RXOK   2
 Message Received Successfully. More...
 
#define CAN_STATUS_ALERT   3
 Alert Warning. More...
 
#define CAN_STATUS_EWRN   4
 Error Warning Status. More...
 
#define CAN_STATUS_BOFF   5
 Bus-off Status. More...
 

Detailed Description

This group of defines specifies status fields that can be queried from hsk_can_status().

Macro Definition Documentation

§ CAN_STATUS_ALERT

#define CAN_STATUS_ALERT   3

Alert Warning.

Return values
0No warnings
1One of the following error conditions applies: CAN_STATUS_EWRN; CAN_STATUS_BOFF

§ CAN_STATUS_BOFF

#define CAN_STATUS_BOFF   5

Bus-off Status.

Return values
0The bus is not off
1The bus is turned off due to an error counter exceeding 256

§ CAN_STATUS_EWRN

#define CAN_STATUS_EWRN   4

Error Warning Status.

Return values
0No error warnings exceeded
1An error counter has exceeded the warning level of 96

§ CAN_STATUS_LEC

#define CAN_STATUS_LEC   0

The Last Error Code field provides the error triggered by the last message on the bus.

For details check table 16-8 from the User Manual 1.1.

Return values
0No Error
1Stuff Error, 5 consecutive bits of the same value are stuffed, this error is triggered when the stuff bit is missing
2Form Error, the frame format was violated
3Ack Error, the message was not acknowledged, maybe nobody else is on the bus
4Bit1 Error, a recessive (1) bit was sent out of sync
5Bit0 Error, a recessive (1) bit won against a dominant (0) bit
6CRC Error, wrong checksum for a received message

§ CAN_STATUS_RXOK

#define CAN_STATUS_RXOK   2

Message Received Successfully.

Return values
0No successful receptions since the last time this field was queried
1A message was received successfully

§ CAN_STATUS_TXOK

#define CAN_STATUS_TXOK   1

Message Transmitted Successfully.

Return values
0No successful transmission since TXOK was queried last time
1A message was transmitted and acknowledged successfully