The Arduino implementation of SPI supports transactions, facilitating the connection of multiple devices with different SPI characteristics. Is it worth considering this for the Pyboard? The first reference has a good explanation of it (step 3).
http://www.dorkbotpdx.org/blog/paul/bet ... in_3_steps
http://www.arduino.cc/en/Tutorial/SPITransaction
SPI bus transactions
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
SPI bus transactions
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: SPI bus transactions
As far as I can tell from reading the Arduino docs it seems that beginTransaction is just a shorthand for setting the clock divider, the clock phase and polarity, and the bit order (so saves you calling 3 separate functions). In uPy you can do this using spi.init.