Split Spidev into device and bus structs#100
Merged
eldruin merged 4 commits intorust-embedded:masterfrom Nov 10, 2023
Merged
Conversation
eldruin
reviewed
Oct 8, 2023
Member
eldruin
left a comment
There was a problem hiding this comment.
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.
Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
Member
Author
|
No problem, thanks for the review comments! I've updated the changelog. |
eldruin
reviewed
Nov 10, 2023
Member
eldruin
left a comment
There was a problem hiding this comment.
Thank you! Sorry this fell off my radar.
eldruin
approved these changes
Nov 10, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #99, split
SpidevintoSpidevDeviceandSpidevBus, 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).