You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.
Good question--I made the bit bang SPI and spidev SPI implementation have the same functions like set_clock_hz, set_mode, read, write, transfer, etc. so it should be possible to swap code that uses one interface to use the other. There are a few small differences in functionality, like the bitbang interface ignoring clock speed and also being a little more flexible (i.e. can choose to assert or deassert CS on SPI read/write/transfer) but my goal was to not make any major differences that would preclude changing out one implementation for the other (other than the fact that software SPI is really slow).
I didn't make them inherit from a common base class just because it seemed like a little overkill and I didn't think there would be a ton of other implementations. I'm not against having them inherit from a common base though.
Does that help answer your question? Thanks for checking out the library BTW. I'm open for feedback on extending it for more folks to use. I'm hoping to add more functionality like I2C, support for other boards GPIO, etc. over time.
Are you planning wrapping the SPI interfaces into some high level one so that it would be easier to switch between backends?
Like when I swapped Raspberry SPI to pyMCU SPI in max7219 library: riklaunim/max7219@0aa4c47#diff-0ba4e19a70b47820e42736807850fdf9 there weren't any bigger changes so it ought to be doable in some cases.
The text was updated successfully, but these errors were encountered: