mikroC
making it simple...
CANSetMask
Prototype
void CANSetMask(char CAN_MASK, long value, char CAN_CONFIG_FLAGS);
Description
Function sets mask for advanced filtering of messages. Given value is bit adjusted to
appropriate buffer mask registers.
Parameters:
value
either
Requires
CAN must be in Config mode; otherwise the function will be ignored.
Example
// Set all mask bits to 1, i.e. all filtered bits are relevant:
CANSetMask(CAN_MASK_B1, -1, CAN_CONFIG_XTD_MSG);
/* Note that -1 is just a cheaper way to write 0xFFFFFFFF.
CANSetFilter
Prototype
void CANSetFilter(char CAN_FILTER, long value,
char CAN_CONFIG_FLAGS);
Description
Function sets mask for advanced filtering of messages. Given value is bit adjusted to
appropriate buffer mask registers.
Parameters:
value
either
Requires
CAN must be in Config mode; otherwise the function will be ignored.
Example
/* Set id of filter B1_F1 to 3: */
CANSetFilter(CAN_FILTER_B1_F1, 3, CAN_CONFIG_XTD_MSG);
MikroElektronika: Development tools - Books - Compilers
is one of predefined constant values (see CAN constants);
CAN_MASK
is the mask register value;
CAN_CONFIG_XTD_MSG
Complement will do the trick and fill it up with ones. */
is one of predefined constant values (see CAN constants);
CAN_MASK
is the filter register value;
CAN_CONFIG_XTD_MSG
mikroC - C Compiler for Microchip PIC microcontrollers
CAN_CONFIG_FLAGS
or
CAN_CONFIG_STD_MSG
CAN_CONFIG_FLAGS
or
CAN_CONFIG_STD_MSG
selects type of message to filter,
.
selects type of message to filter,
.
page
145
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?