mikroC
making it simple...
CAN_RX_MSG_FLAGS
mikroC - C Compiler for Microchip PIC microcontrollers
CAN_RX_MSG_FLAGS are flags related to reception of CAN message. If a particular bit is set; corresponding meaning is TRUE or else it will be FALSE.
#define CAN_RX_FILTER_BITS | 0x07 |
#define CAN_RX_FILTER_1 | 0x00 |
#define CAN_RX_FILTER_2 | 0x01 |
#define CAN_RX_FILTER_3 | 0x02 |
#define CAN_RX_FILTER_4 | 0x03 |
#define CAN_RX_FILTER_5 | 0x04 |
#define CAN_RX_FILTER_6 | 0x05 |
#define CAN_RX_OVERFLOW | 0x08 |
#define CAN_RX_INVALID_MSG | 0x10 |
#define CAN_RX_XTD_FRAME | 0x20 |
#define CAN_RX_RTR_FRAME | 0x40 |
#define CAN_RX_DBL_BUFFERED 0x80
// Use it to access filter bits
//Set if Overflowed; else clear
//Set if invalid; else clear
//Set if XTD msg; else clear
//Set if RTR msg; else clear
//Set if msg was
//hardware
You may use bitwise AND (&) to adjust the appropriate flags. For example:
if (MsgFlag & CAN_RX_OVERFLOW != 0) {
... // Receiver overflow has occurred; previous message is lost.
}
CAN_MASK
CAN_MASK constants define mask codes. Function CANSetMask expects one of these as its argument:
#define CAN_MASK_B1 0 #define CAN_MASK_B2 1
CAN_FILTER
CAN_FILTER constants define filter codes. Function CANSetFilter expects one of these as its argument:
#define CAN_FILTER_B1_F1 0 #define CAN_FILTER_B1_F2 1 #define CAN_FILTER_B2_F1 2 #define CAN_FILTER_B2_F2 3 #define CAN_FILTER_B2_F3 4 #define CAN_FILTER_B2_F4 5
|
| page |
|
MikroElektronika: Development tools - Books - Compilers | 149 | ||
|
|