Make Spi::free
also free up the pins
#719
Merged
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.
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
andSpi::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