How codeljo/aa_mcp2515 works
AA_MCP2515 is an Arduino library for configuring MCP2510/MCP2515 CAN controllers and sending and receiving CAN frames. The principal workflow is application code configuring bitrate and SPI/pins, initializing the controller, then transmitting frames or receiving them through polling or interrupt callbacks. The controller also provides operating modes, receive filters, and error status. The sampled implementation shows the controller delegating register transfers to a SPI adapter and interrupt routing to a dispatcher; README capabilities not visible in sampled internals are retained as documented API responsibilities.
Main entry points: CANController.cpp CAN controller · CANIO.cpp SPI register I/O · CANConfig.h Bus configuration · CANFrame.cpp Frame codec
Components 12
Configuration
- Bitrate presets
src/CANBitrate.h - Bus configuration
src/CANConfig.h
CAN operations
- Library entry
src/AA_MCP2515.h - CAN controller
src/CANController.cpp - Frame codec
src/CANFrame.cpp - Receive filters
src/CANController.cpp
Hardware access
- SPI register I/O
src/CANIO.cpp - MCP registers
src/CANRegisters.h
Interrupt handling
- Interrupt dispatcher
src/CANInterruptHandler.cpp
Other components
- Arduino application
- Arduino SPI
- MCP2510/2515
Connections 15
- Arduino application → Library entry: includes
README.md - Arduino application → Bus configuration: configures
README.md - Arduino application → CAN controller: initializes
README.md - Bitrate presets → Bus configuration: supplies timing
src/CANConfig.h - CAN controller → Bus configuration: uses settings
src/CANController.cpp - CAN controller → SPI register I/O: transfers registers
src/CANController.cpp - CAN controller → Frame codec: reads and writes
src/CANController.cpp - CAN controller → Receive filters: configures filters
src/CANController.cpp - CAN controller → Interrupt dispatcher: registers handler
src/CANController.cpp - Frame codec → MCP registers: encodes fields
src/CANFrame.cpp - SPI register I/O → MCP registers: uses commands
src/CANIO.cpp - SPI register I/O → Arduino SPI: transfers bytes
src/CANIO.cpp - SPI register I/O → MCP2510/2515: accesses controller
README.md - Interrupt dispatcher → CAN controller: dispatches interrupt
src/CANInterruptHandler.cpp - Arduino application → CAN controller: polls or registers callbacks
README.md