User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
277
CANSPISetFilter
Prototype
void CANSPISetFilter(unsigned short CANSPI_FILTER, long value, unsigned
short CANSPI_CONFIG_FLAGS);
Description Congures message lter. The parameter value is bit-adjusted to the appropriate lter registers.
Parameters - CANSPI_FILTER: CAN module lter number. Valid values: CANSPI_FILTER constants. See
CANSPI_FILTER constants.
- val: lter register value. This value is bit-adjusted to appropriate lter registers
- CANSPI_CONFIG_FLAGS: selects type of message to lter. Valid values: _CANSPI_CONFIG_STD_
MSG and _CANSPI_CONFIG_XTD_MSG. See CANSPI_CONFIG_FLAGS constants.
Returns Nothing.
Requires The CANSPI module must be in Cong mode, otherwise the function will be ignored. See
CANSPISetOperationMode.
The CANSPI routines are supported only by MCUs with the SPI module.
MCU has to be properly connected to mikroElektronika’s CANSPI Extra Board or similar hardware.
See connection example at the bottom of this page.
Example
// set the appropriate lter value and message type
CANSPISetOperationMode(_CANSPI_MODE_CONFIG,0xFF); // set CONFIGURATION
mode (CANSPI module must be in cong mode for lter settings)
// Set id of lter B1_F1 to 3 :
CANSPISetFilter(_CANSPI_FILTER_B1_F1, 3, _CANSPI_CONFIG_XTD_MSG);
Notes None.