mikroElektronika PIC Microcontrollers PIC12 User Manual page 157

Mikroc user's manual
Table of Contents

Advertisement

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

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents