User manual

310
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
You may use bitwise and to form cong word out of these values. For example:
Copy Code To Clipboard
init := _ECAN_CONFIG_SAMPLE_THRICE and
_ECAN_CONFIG_PHSEG2_PRG_ON and
_ECAN_CONFIG_STD_MSG and
_ECAN_CONFIG_MATCH_MSG_TYPE and
_ECAN_CONFIG_LINE_FILTER_OFF;
...
ECAN1Initialize(1, 1, 3, 3, 1, init); // initialize ECAN1
ECAN_TX_MSG_FLAGS Constants
ECAN_TX_MSG_FLAGS are ags related to transmission of ECAN message. The routine ECANxWrite expect one of
these (or a bitwise combination) as their argument:
const
_ECAN_TX_PRIORITY_BITS : word = 0x03;
_ECAN_TX_PRIORITY_0 : word = 0xFC; // XXXXXX00
_ECAN_TX_PRIORITY_1 : word = 0xFD; // XXXXXX01
_ECAN_TX_PRIORITY_2 : word = 0xFE; // XXXXXX10
_ECAN_TX_PRIORITY_3 : word = 0xFF; // XXXXXX11
_ECAN_TX_FRAME_BIT : word = 0x08;
_ECAN_TX_STD_FRAME : word = 0xFF; // XXXXX1XX
_ECAN_TX_XTD_FRAME : word = 0xF7; // XXXXX0XX
_ECAN_TX_RTR_BIT : word = 0x40;
_ECAN_TX_NO_RTR_FRAME : word = 0xFF; // X1XXXXXX
_ECAN_TX_RTR_FRAME : word = 0xBF; // X0XXXXXX
You may use bitwise and to adjust the appropriate ags. For example:
Copy Code To Clipboard
(* form value to be used with CANSendMessage: *)
send_cong := _ECAN_TX_PRIORITY_0 and
_ECAN_TX_XTD_FRAME and
_ECAN_TX_NO_RTR_FRAME;
...
ECAN1SendMessage(id, data, 1, send_cong);
ECAN_RX_MSG_FLAGS Constants
ECAN_RX_MSG_FLAGS are ags related to reception of ECAN message. If a particular bit is set then corresponding
meaning is TRUE or else it will be FALSE.