stm32f103xx-hal icon indicating copy to clipboard operation
stm32f103xx-hal copied to clipboard

SPI: Support configuring LSB first transfers

Open johkra opened this issue 7 years ago • 0 comments
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.

johkra avatar Sep 29 '18 16:09 johkra