-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MCP2515 constructor now has an optional SPIClass pointer as its
last parameter to allow selecting a different SPI peripheral. Fully backward compatible. All the code that works so far will continue to work correctly without any changes. - If no argument is passed during construction (defaults to nullptr), the Arduino default "SPI" will be used and initialized with begin(). - If a SPIClass to use is specified, then it is the library user responsibility to initialize that SPI ( other_spi.begin()) with the proper settings outside of the library (I.E. in void setup()). In this way one can use different SPI pins in boards that support it (ESP32, some STM32). Thanks to @morcibacsi and @FStefanni for the suggestions. Tested on ESP32 HSPI and VSPI with default and custom pins. It should also work with all boards featuring multiple SPI peripherals (SPI1, SPI2, etc.).
- Loading branch information
1 parent
4d0982e
commit 8c75166
Showing
2 changed files
with
31 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters