The new SpiManager: supporting NRF+CMT+HUAWEI/Meanwell+CAN Battery #1309
Replies: 2 comments 3 replies
-
My first version of a mcp2515_can library which supports the SpiManager is uploaded. Please find here https://github.com/skippermeister/MCP2515-CAN-Bus-Library-with-Shared-SPI An example (sorry not working because it needs the SpiManager library from the project OpenDTU-onBattery) is for illustrating the usage of my library. The new library replaces the mcp_can library https://github.com/coryjfowler/MCP_CAN_lib currently used in OpenDTU-onBattery. In my fork https://github.com/skippermeister/OpenDTU-OnBattery the new library is under test. |
Beta Was this translation helpful? Give feedback.
-
@skippermeister I just had a quick glimpse at the new library and have a few remarks:
@schlimmchen Before this new library starts being used in OpenDTU OnBattery, auto spi_bus = SpiManagerInst.claim_bus_arduino();
if (!spi_bus)
return false;
SPI = new SPIClass(*spi_bus); It will not share the SPI bus with other device then, but at least the MCP2515 can be used with the nRF or CMT for the time being. |
Beta Was this translation helpful? Give feedback.
-
As @schlimmchen mentioned, there are bittersweet news regarding the PR/feature upstream implementation of the SpiManager
The problem is that the MCP2515 CAN library, like the NRF24 library, is not based on shared SPI access, but uses the Arduino-compatible implementation and need "direct SPI access".
I think the idea of the new Spi Manager is very good and we should do everything we can to port all SPI devices to this SpiManager.
I recognized this early on and am already developing an MCP2515 CAN driver, which uses the shared SPI from the SpiManager. This then replaces the mcp_can library.
I develop the whole thing in my fork.
I will upload a first version of my development in the next few days.
So we shouldn't go back to the SpiPortManager developed by me @skippermeister and @AndreasBoehm
Beta Was this translation helpful? Give feedback.
All reactions