User manual
mikroC PRO for dsPIC
MikroElektronika
337
Copy Code To Clipboard
const unsigned int
_ECAN_RX_FILTER_BITS = 0x000F, // Use this to access lter bits
_ECAN_RX_FILTER_0 = 0x00, // lter0 match
_ECAN_RX_FILTER_1 = 0x01, // lter1 match
_ECAN_RX_FILTER_2 = 0x02, // ...
_ECAN_RX_FILTER_3 = 0x03,
_ECAN_RX_FILTER_4 = 0x04,
_ECAN_RX_FILTER_5 = 0x05,
_ECAN_RX_FILTER_6 = 0x06,
_ECAN_RX_FILTER_7 = 0x07,
_ECAN_RX_FILTER_8 = 0x08,
_ECAN_RX_FILTER_9 = 0x09,
_ECAN_RX_FILTER_10 = 0x0A,
_ECAN_RX_FILTER_11 = 0x0B,
_ECAN_RX_FILTER_12 = 0x0C,
_ECAN_RX_FILTER_13 = 0x0D,
_ECAN_RX_FILTER_14 = 0x0E, // ...
_ECAN_RX_FILTER_15 = 0x0F, // lter15 match
_ECAN_RX_OVERFLOW = 0x10, // Set if Overowed else cleared
_ECAN_RX_INVALID_MSG = 0x20, // Set if invalid else cleared
_ECAN_RX_XTD_FRAME = 0x40, // Set if XTD message else cleared
_ECAN_RX_RTR_FRAME = 0x80; // Set if RTR message else cleared
You may use bitwise AND (&) to extract received message status. For example:
Copy Code To Clipboard
if (MsgFlag & _ECAN_RX_OVERFLOW != 0) {
...
// Receiver overow has occurred.
// We have lost our previous message.
}
ECAN_MASK Constants
The ECAN_MASK constants dene mask codes. The routine ECANxSetMask expect one of these as their argument:
Copy Code To Clipboard
const unsigned int
_ECAN_MASK_0 = 0,
_ECAN_MASK_1 = 1,
_ECAN_MASK_2 = 2;
ECAN_FILTER Constants
The ECAN_FILTER constants dene lter codes. The routine ECANxSetFilter expect one of these as their argument: