Datasheet
CANSPI_RX_MSG_FLAGS
CANSPI_RX_MSG_FLAGS are flags related to reception of CAN message. If a par-
ticular bit is set then corresponding meaning is TRUE or else it will be FALSE.
const char
CANSPI_RX_FILTER_BITS = 0x07,// Use this to access filter bits
CANSPI_RX_FILTER_1 = 0x00,
CANSPI_RX_FILTER_2 = 0x01,
CANSPI_RX_FILTER_3 = 0x02,
CANSPI_RX_FILTER_4 = 0x03,
CANSPI_RX_FILTER_5 = 0x04,
CANSPI_RX_FILTER_6 = 0x05,
CANSPI_RX_OVERFLOW = 0x08,// Set if Overflowed else cleared
CANSPI_RX_INVALID_MSG = 0x10, // Set if invalid else cleared
CANSPI_RX_XTD_FRAME = 0x20,//Set if XTD message else cleared
CANSPI_RX_RTR_FRAME = 0x40,//Set if RTR message else cleared
CANSPI_RX_DBL_BUFFERED = 0x80; // Set if this message was
hardware double-buffered
You may use bitwise AND (&) to adjust the appropriate flags. For example:
if (MsgFlag & CANSPI_RX_OVERFLOW != 0) {
...
// Receiver overflow has occurred.
// We have lost our previous message.
}
CANSPI_MASK
The CANSPI_MASK constants define mask codes. Function CANSPISetMask
expects one of these as it's argument:
const char
CANSPI_MASK_B1 = 0,
CANSPI_MASK_B2 = 1;
246
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6