stm32f103xx-hal
stm32f103xx-hal copied to clipboard
SPI: Support configuring LSB first transfers
trafficstars
Currently the SPI code hard configures MSB first transfers.
stm32f103xx-hal/src/spi.rs@83574bc starting at line 135:
// mstr: master configuration
// lsbfirst: MSB first
[…]
spi.cr1.write(|w| {
w.cpha()
[…]
.lsbfirst()
.clear_bit()
I'm interacting with a device which expects data LSB first and I have to reverse the bits in a byte before sending data with the SPI code. Could you please make MSB/LSB first configurable?
If you briefly describe how you'd like to see this implemented, I'll prepare a patch.