How seeed-studio/seeed_arduino_can works
Seeed Arduino CAN is a hardware-facing library for sending and receiving CAN and CAN-FD frames through MCP2515 or MCP2518FD controllers. An Arduino sketch configures a controller through the shared CAN API, then uses it to transmit or receive frames on the bus; sketches can also use the LAWICEL-style serial command interface. The source excerpts show controller setup, frame handling, and SPI access, while the README documents both shield families. Wiring among unsampled features is kept conservative.
Main entry points: mcp_can.h Shared CAN API · mcp2515_can.cpp MCP2515 driver · mcp2518fd_can.cpp MCP2518FD driver · can-serial.cpp LAWICEL serial
Components 14
CAN API
- Shared CAN API
src/mcp_can.h - API base setup
src/mcp_can.cpp
Controller Drivers
- MCP2515 driver
src/mcp2515_can.cpp - MCP2518FD driver
src/mcp2518fd_can.cpp - MCP2515 definitions
src/mcp2515_can_dfs.h - FD register definitions
src/mcp2518fd_can_dfs.h
Device Interfaces
- LAWICEL serial
src/can-serial.cpp - Serial protocol API
src/can-serial.h
Other components
- Arduino sketch
- SPI interface
- MCP2515 controller
- MCP2518FD controller
- CAN network
- Usage examples
examples
Connections 16
- Arduino sketch → Shared CAN API: calls
- Shared CAN API → API base setup: initializes
- Shared CAN API → MCP2515 driver: implemented by
- Shared CAN API → MCP2518FD driver: implemented by
- MCP2515 driver → MCP2515 definitions: uses definitions
- MCP2518FD driver → FD register definitions: uses definitions
- MCP2515 driver → SPI interface: transfers over
- MCP2518FD driver → SPI interface: transfers over
- SPI interface → MCP2515 controller: accesses
- SPI interface → MCP2518FD controller: accesses
- MCP2515 controller → CAN network: exchanges frames
- MCP2518FD controller → CAN network: exchanges frames
- Arduino sketch → Serial protocol API: uses optionally
- Serial protocol API → LAWICEL serial: declares protocol
- LAWICEL serial → Shared CAN API: sends and reads
- Usage examples → Shared CAN API: demonstrates