User manual

256
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
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
_CAN_RX_FILTER_BITS : word = 0x07; // Use this to access lter bits
_CAN_RX_FILTER_1 : word = 0x00;
_CAN_RX_FILTER_2 : word = 0x01;
_CAN_RX_FILTER_3 : word = 0x02;
_CAN_RX_FILTER_4 : word = 0x03;
_CAN_RX_FILTER_5 : word = 0x04;
_CAN_RX_FILTER_6 : word = 0x05;
_CAN_RX_OVERFLOW : word = 0x08; // Set if Overowed else cleared
_CAN_RX_INVALID_MSG : word = 0x10; // Set if invalid else cleared
_CAN_RX_XTD_FRAME : word = 0x20; // Set if XTD message else cleared
_CAN_RX_RTR_FRAME : word = 0x40; // Set if RTR message else cleared
_CAN_RX_DBL_BUFFERED : word = 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 and _CAN_RX_OVERFLOW) <> 0 then
begin
...
// Receiver overow has occurred.
// We have lost our previous message.
end
CAN_MASK Constants
CAN_MASK constants dene mask codes. Function CANxSetMask expects one of these as its argument:
Copy Code To Clipboard
const
_CAN_MASK_B1 : word = 0;
_CAN_MASK_B2 : word = 1;