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
I'm using the spidriver to interface with a PN532 NFC module. The former uses most-significant bit (MSB) first shifting while the latter uses least-significant bit (LSB) first shifting on the SPI bus.
It seems from the datasheet for the spidrivers microcontroller, the hardware SPI shift order can be configured, and would be a nice feature to have.
Unfortunately, I don't know Forth to implement a PR. Instead, I've modified the spicli tool [1] to add "lsb" and "msb" commands to reverse the bits in bytes before transmitting and after receiving, and it works well enough that writing shell scripts against spicli remains clean and readable.
Having this functionality in SPIDriver would be useful to eme as well, but for now I'm following boxorox' approach of reversing the bits in my Python program.
I'm using the spidriver to interface with a PN532 NFC module. The former uses most-significant bit (MSB) first shifting while the latter uses least-significant bit (LSB) first shifting on the SPI bus.
It seems from the datasheet for the spidrivers microcontroller, the hardware SPI shift order can be configured, and would be a nice feature to have.
Unfortunately, I don't know Forth to implement a PR. Instead, I've modified the
spicli
tool [1] to add "lsb" and "msb" commands to reverse the bits in bytes before transmitting and after receiving, and it works well enough that writing shell scripts againstspicli
remains clean and readable.[1]: https://github.com/boxofrox/spidriver/tree/feature/bit-shift-order
The text was updated successfully, but these errors were encountered: