User manual
336
mikoC PRO for dsPIC
MikroElektronika
You may use bitwise AND (&) to form cong word out of these values. For example:
Copy Code To Clipboard
init = _ECAN_CONFIG_SAMPLE_THRICE &
_ECAN_CONFIG_PHSEG2_PRG_ON &
_ECAN_CONFIG_STD_MSG &
_ECAN_CONFIG_MATCH_MSG_TYPE &
_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:
Copy Code To Clipboard
const unsigned int
_ECAN_TX_PRIORITY_BITS = 0x03,
_ECAN_TX_PRIORITY_0 = 0xFC, // XXXXXX00
_ECAN_TX_PRIORITY_1 = 0xFD, // XXXXXX01
_ECAN_TX_PRIORITY_2 = 0xFE, // XXXXXX10
_ECAN_TX_PRIORITY_3 = 0xFF, // XXXXXX11
_ECAN_TX_FRAME_BIT = 0x08,
_ECAN_TX_STD_FRAME = 0xFF, // XXXXX1XX
_ECAN_TX_XTD_FRAME = 0xF7, // XXXXX0XX
_ECAN_TX_RTR_BIT = 0x40,
_ECAN_TX_NO_RTR_FRAME = 0xFF, // X1XXXXXX
_ECAN_TX_RTR_FRAME = 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_cong = _ECAN_TX_PRIORITY_0 &
_ECAN_TX_XTD_FRAME &
_ECAN_TX_NO_RTR_FRAME;
...
ECAN1SendMessage(id, data, 1, send_cong);
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.