Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

SPI: Support configuring LSB first transfers #96

Open
johkra opened this issue Sep 29, 2018 · 0 comments
Open

SPI: Support configuring LSB first transfers #96

johkra opened this issue Sep 29, 2018 · 0 comments

Comments

@johkra
Copy link

johkra commented Sep 29, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant