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

Make Spi::free also free up the pins #719

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

SCingolani
Copy link

In the case where the pins are shared with some other function, one should be able to free them up from the Spi instance. Also useful if the SPI0 will be switched between two configurations, therefore calling Spi::new and Spi::free back and forth.

Example use case is Pololu's 3Pi+ Robot which reuses SPI0 configured with different pins.
Reference C support: https://github.com/pololu/pololu-3pi-2040-robot/tree/master/c/pololu_3pi_2040_robot
WIP Rust support in rp-hal-boards: https://github.com/SCingolani/rp-hal-boards/tree/pololu-threepi-plus-2040

Copy link
Member

@jannic jannic left a comment

Choose a reason for hiding this comment

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

Looks like an obvious improvement, thank you!

@ithinuel ithinuel merged commit aecf366 into rp-rs:main Nov 17, 2023
8 checks passed
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.

3 participants