Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Spidev into device and bus structs #100

Merged
merged 4 commits into from
Nov 10, 2023

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.

src/spi.rs Outdated Show resolved Hide resolved
src/spi.rs Outdated Show resolved Hide resolved
src/spi.rs Outdated Show resolved Hide resolved
src/spi.rs Outdated Show resolved Hide resolved
src/spi.rs Outdated Show resolved Hide resolved
src/spi.rs Outdated Show resolved Hide resolved
src/spi.rs Outdated Show resolved Hide resolved
@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.

CHANGELOG.md Outdated Show resolved Hide resolved
@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
8 checks passed
@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