User`s manual

mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
You need to be familiar with constants that are provided for use with CAN library
routines. See how to form values (from constants) that will be passed to or from
routines in the example at the end of the chapter. All of the constants are prede-
fined in CAN library.
These constant values define CAN module operation mode.
CANSetOperationMode() routine requires this code. These values must be used by
itself, i.e. they cannot be ANDed to form multiple values.
const CAN_MODE_BITS = $E0
' Use these to access opmode bits
const CAN_MODE_NORMAL = 0
const CAN_MODE_SLEEP = $20
const CAN_MODE_LOOP = $40
const CAN_MODE_LISTEN = $60
const CAN_MODE_CONFIG = $80
These constant values define flags related to transmission of a CAN message.
There could be more than one this flag ANDed together to form multiple flags.
const CAN_TX_PRIORITY_BITS = $03
const CAN_TX_PRIORITY_0 = $FC
' XXXXXX00
const CAN_TX_PRIORITY_1 = $FD
' XXXXXX01
const CAN_TX_PRIORITY_2 = $FE
' XXXXXX10
const CAN_TX_PRIORITY_3 = $FF
' XXXXXX11
const CAN_TX_FRAME_BIT = $08
const CAN_TX_STD_FRAME = $FF
' XXXXX1XX
const CAN_TX_XTD_FRAME = $F7
' XXXXX0XX
const CAN_TX_RTR_BIT = $40
const CAN_TX_NO_RTR_FRAME = $FF
' X1XXXXXX
const CAN_TX_RTR_FRAME = $BF
' X0XXXXXX
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
119
page
CAN Library Constants
CAN_OP_MODE
CAN_TX_MSG_FLAGS