Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI1 #52

Open
wangnick opened this issue Jan 6, 2021 · 2 comments
Open

SPI1 #52

wangnick opened this issue Jan 6, 2021 · 2 comments

Comments

@wangnick
Copy link

wangnick commented Jan 6, 2021

Hi Watterott folks,

why is there SPI1.h and SPI1.cpp implementing new classes SPI1Class and SPI1Settings, and then one new extern instance SPI1?

Why not rather redesigned SPI.h and SPI.cpp implementing SPIClass and SPISettings such that two extern instances SPI and SPI1 are supported as members of class SPIClass and thus acceptable to every other library out there, similar to what was done with Serial1, Serial2 etc ???

I'm trying to use the Atmega328PB board together with an MCP2515 CAN bus module AND two UARTs AND I need two ICPs, so I need to evade to SPI1 for the MCP2515 connection. I managed to adapt my CAN bus boot loader, but now I struggle with my application and with the ACAN2515 library of Pierre Molinaro and the stuff I added on top ...

Kind regards,
Sebastian (Wangnick)

@awatterott
Copy link
Member

Sure, that is possible and we are open for improvements. Its also the same on the Wire library.

@wangnick
Copy link
Author

wangnick commented Jan 7, 2021

Hi Andreas,

I've changed SPI.h and SPI.cpp as indicated above, see at https://github.com/wangnick/ATmega328PB-Testing. No fancy template programming, so I had to introduce some member variables and I had to make the methods non-static ...

Kind regards,
Sebastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants