#include #include #include #include "can.h" prog_uint8_t can_filter[] = { // Group 0 MCP2515_FILTER(0), MCP2515_FILTER(0), // Group 1 MCP2515_FILTER_EXTENDED(0), MCP2515_FILTER_EXTENDED(0), MCP2515_FILTER_EXTENDED(0), MCP2515_FILTER_EXTENDED(0), MCP2515_FILTER(0), MCP2515_FILTER_EXTENDED(0), }; int main(void) { can_init(BITRATE_125_KBPS); can_static_filter(can_filter); can_t msg; msg.id = 0x123456; msg.flags.rtr = 0; msg.flags.extended = 1; msg.length = 4; msg.data[0] = 0xde; msg.data[1] = 0xad; msg.data[2] = 0xbe; msg.data[3] = 0xef; while(1) { can_send_message(&msg); _delay_ms(3000); } }