User manual
mikroC PRO for dsPIC
MikroElektronika
285
CAN_RX_MSG_FLAGS Constants
CAN_RX_MSG_FLAGS are ags related to reception of CAN message. If a particular bit is set; corresponding meaning
is TRUE or else it will be FALSE.
Copy Code To Clipboard
const unsigned int
_CAN_RX_FILTER_BITS = 0x07, // Use this to access lter bits
_CAN_RX_FILTER_1 = 0x00,
_CAN_RX_FILTER_2 = 0x01,
_CAN_RX_FILTER_3 = 0x02,
_CAN_RX_FILTER_4 = 0x03,
_CAN_RX_FILTER_5 = 0x04,
_CAN_RX_FILTER_6 = 0x05,
_CAN_RX_OVERFLOW = 0x08, // Set if Overowed else cleared
_CAN_RX_INVALID_MSG = 0x10, // Set if invalid else cleared
_CAN_RX_XTD_FRAME = 0x20, // Set if XTD message else cleared
_CAN_RX_RTR_FRAME = 0x40, // Set if RTR message else cleared
_CAN_RX_DBL_BUFFERED = 0x80; // Set if this message was hardware double-buffered
You may use bitwise AND (&) to adjust the appropriate ags. For example:
Copy Code To Clipboard
if (MsgFlag & _CAN_RX_OVERFLOW != 0) {
...
// Receiver overow has occurred.
// We have lost our previous message.
}
CAN_MASK Constants
CAN_MASK constants dene mask codes. Function CANxSetMask expects one of these as its argument:
Copy Code To Clipboard
const unsigned int
_CAN_MASK_B1 = 0,
_CAN_MASK_B2 = 1;