[Discussion] Read
and Ignore
traits for blocking SPI operations
#52
Labels
Read
and Ignore
traits for blocking SPI operations
#52
Currently, there are the
blocking::spi::Transfer
andblocking::spi::Write
traits. However, there times when one might want to read data out of a slave, without caring about what gets transmitted -- ablocking::spi::Read
This could be done with the
blocking::spi::Transfer
trait, but a separate trait provides two advantages:words
blocking::spi::Read
could allow the MOSI pin to be optionalGoing even further, there are times when a driver simply requires some clock cycles on the bus -- but will not be shifting meaningful data either in or out. This may seem like a corner case, but I've encountered this exact situation when configuring an ice40 FPGA. For reference, see page 19 of the programming and configuration manual. It's also a requirement for some commodity SPI flash devices.
This could be served by a
blocking::spi::Ignore
trait, which just takes a number of bytes to ignore.The text was updated successfully, but these errors were encountered: