Skip to content

spi: Add new embedded-hal 1.0 interface#141

Merged
chrysn merged 18 commits intomainfrom
spi-embedded-hal-1
Jan 13, 2025
Merged

spi: Add new embedded-hal 1.0 interface#141
chrysn merged 18 commits intomainfrom
spi-embedded-hal-1

Conversation

@chrysn
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!)

Comment thread src/spi/for_embedded_hal_1.rs Outdated
Comment thread src/spi/for_embedded_hal_1.rs Outdated
Comment thread src/spi/for_embedded_hal_1.rs
Comment thread src/spi/for_embedded_hal_1.rs Outdated
Comment thread src/spi/for_embedded_hal_1.rs Outdated
Comment thread src/spi/for_embedded_hal_1.rs
Comment thread src/spi/for_embedded_hal_1.rs
Comment thread src/spi/for_embedded_hal_1.rs Outdated
Comment thread src/spi/for_embedded_hal_1.rs
Comment thread tests/spi/src/lib.rs Outdated
@chrysn
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

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