#include <can.h>
The used CAN-chip MCP2515 has two receive buffers, two acceptance masks (one for each receive buffer) and 6 acceptance filters
filter/mask truth table (x = don't care)
========================================
0 1 1 1 1 mask bit n (0 => ALWAYS accepted bit)
x 0 0 1 1 filter bit n
x 0 1 0 1 msg identifer bit
x x . . x accept
. . x x . reject
ATTENTION: when receiving standard data frames (11-bit identifiers) the MCP2515 automatically applies 16 bits of masks and filters normally associated with extended identifier to the first 16 bits of the datafield (datapayload bytes zero and one).
Public Attributes | |
unsigned long | filter_eid [6] |
lowest 18-bit in case of EID, set to 0 if using SID-filter only (or data bytes will also be filtered as mentioned above)!! | |
unsigned char | filter_frame [6] |
Set type of frame to filter. | |
unsigned char | filter_mode [2] |
determines the used filter mode. | |
unsigned long | filter_sid [6] |
11-bit ID for normal message (highest 11-bit in case of EID, 29-bit) | |
unsigned long | mask_eid [2] |
determine which bits in the eid identifier are examined (lowest 18 bit, highest 11 bit are used from mask_sid!!) | |
unsigned long | mask_sid [2] |
determine which bits in the sid identifier are examined (highest 11 bit) | |
unsigned char | rollover |
Determines whether messages can be put into the other CAN chip's receive buffer. |
unsigned long mcp2515_filter_t::filter_eid[6] |
lowest 18-bit in case of EID, set to 0 if using SID-filter only (or data bytes will also be filtered as mentioned above)!!
unsigned char mcp2515_filter_t::filter_frame[6] |
Set type of frame to filter.
unsigned char mcp2515_filter_t::filter_mode[2] |
determines the used filter mode.
unsigned long mcp2515_filter_t::filter_sid[6] |
11-bit ID for normal message (highest 11-bit in case of EID, 29-bit)
unsigned long mcp2515_filter_t::mask_eid[2] |
determine which bits in the eid identifier are examined (lowest 18 bit, highest 11 bit are used from mask_sid!!)
unsigned long mcp2515_filter_t::mask_sid[2] |
determine which bits in the sid identifier are examined (highest 11 bit)
unsigned char mcp2515_filter_t::rollover |
Determines whether messages can be put into the other CAN chip's receive buffer.