Skip to content

Split Spidev into device and bus structs#100

Merged
eldruin merged 4 commits intorust-embedded:masterfrom
adamgreig:split-spi
Nov 10, 2023
Merged

Split Spidev into device and bus structs#100
eldruin merged 4 commits intorust-embedded:masterfrom
adamgreig:split-spi

Conversation

@adamgreig
Copy link
Member

As discussed in #99, split Spidev into SpidevDevice and SpidevBus, each implementing the respective embedded-hal trait.

Compared to the original plan, it seems easier to just let the CS pin be driven normally, and say users can configure SPI_NO_CS if required. I couldn't spot any good way for us to change the configuration to just set this flag without overriding whatever existing mode configuration the user had, and since it should always be a dummy pin anyway, it shouldn't usually matter if it gets toggled.

In the end therefore there's no change to the implementations, just splitting which struct each trait is implemented for (and duplicating the various helper impls).

@adamgreig adamgreig requested a review from a team as a code owner October 8, 2023 00:22
Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you! Thank you for looking into the details as well.
Also, great documentation I must say!
Just added a couple of formatting nitpicks.
Could you also add an entry to the changelog?
If it is not too much to ask, would you be able to bump the version to -alpha.4 and add the corresponding section to the changelog? Then I could directly release this. I know of several people waiting on a release using e-h -rc.1.

adamgreig and others added 2 commits October 8, 2023 21:10
Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
@adamgreig
Copy link
Member Author

No problem, thanks for the review comments! I've updated the changelog.

Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Sorry this fell off my radar.

@eldruin eldruin enabled auto-merge November 10, 2023 08:32
@eldruin eldruin added this pull request to the merge queue Nov 10, 2023
Merged via the queue into rust-embedded:master with commit c9b9809 Nov 10, 2023
@adamgreig adamgreig deleted the split-spi branch November 14, 2023 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants