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

spi: Add new embedded-hal 1.0 interface #141

Merged
merged 18 commits into from
Jan 13, 2025
Merged

spi: Add new embedded-hal 1.0 interface #141

merged 18 commits into from
Jan 13, 2025

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Jan 5, 2025

SPI was the only peripheral that was stuck on embedded-hal 0.2 because there were major changes in the HAL, and because I had no test application.

So far, this is lacking:

  • addressing the FIXME regarding the bus-as-a-whole devices
  • tests (in particular on the non-in-place transfer, because that is complex and not used by my application test code)

@chrysn chrysn mentioned this pull request Jan 5, 2025
@chrysn chrysn force-pushed the spi-embedded-hal-1 branch from 8320451 to 95aeedf Compare January 5, 2025 21:23
@chrysn chrysn marked this pull request as ready for review January 5, 2025 21:24
@chrysn
Copy link
Member Author

chrysn commented Jan 5, 2025

Both open points are addressed; implementing SpiBus was a bit of a backwards exercise, but in the interest of keeping things easy to maintain and efficient for the case where it matters, I think it's a sensible choice to effectively route everything through an implementation that primarily caters for SpiDevice use cases.

The test is more than a build test but less than a functional test (I don't even have the wires with me to loopback MISO and MOSI), but given that the one thing that went wrong earlier was misconfiguring the SPI device in a way that would indefinitely block any transaction, I think that's good enough.

@chrysn chrysn force-pushed the spi-embedded-hal-1 branch from 95aeedf to 2ad598a Compare January 5, 2025 21:29
@chrysn chrysn requested a review from Teufelchen1 January 5, 2025 22:06
@chrysn
Copy link
Member Author

chrysn commented Jan 5, 2025

(ad review request: Yeah I know I have pending reviews myself on the UART side; got that branch open again already!)

src/spi/for_embedded_hal_1.rs Outdated Show resolved Hide resolved
src/spi/for_embedded_hal_1.rs Outdated Show resolved Hide resolved
src/spi/for_embedded_hal_1.rs Show resolved Hide resolved
src/spi/for_embedded_hal_1.rs Outdated Show resolved Hide resolved
src/spi/for_embedded_hal_1.rs Outdated Show resolved Hide resolved
src/spi/for_embedded_hal_1.rs Show resolved Hide resolved
src/spi/for_embedded_hal_1.rs Outdated Show resolved Hide resolved
src/spi/for_embedded_hal_1.rs Outdated Show resolved Hide resolved
src/spi/for_embedded_hal_1.rs Show resolved Hide resolved
tests/spi/src/lib.rs Outdated Show resolved Hide resolved
@chrysn
Copy link
Member Author

chrysn commented Jan 6, 2025

I think I have addressed all comments. In particular, you may want to have a look at fc0914f.

@chrysn
Copy link
Member Author

chrysn commented Jan 6, 2025

Many kudos for reviewing this! That helped a lot both in making the API better and gaining confidence in riot-wrappers as a whole.

@chrysn
Copy link
Member Author

chrysn commented Jan 7, 2025

I think all comments are addressed (one by an elaboration, one by 481c6b3); another commit (cd40adb) fixes build issues.

@chrysn chrysn merged commit 3e82a20 into main Jan 13, 2025
85 checks passed
@chrysn chrysn deleted the spi-embedded-hal-1 branch January 13, 2025 11:24
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