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.
This is currently not intended to get merged - at least not as is. It's just here to sketch some ideas.
That's why it's not targeting the
esp-hal
repoBasically, this adds a new module
wrappers
which contains wrappers and helpers for GPIO pins.InterconnectPin
e.g. the
spi_loopback_dma
example could be changed like thisThen MISO reads MOSI without physically connecting the pins.
VirtualInputPin
e.g. the
spi_loopback_dma
example could be changed like thisThis will make it read MISO from a toggling virtual pin. Probably not a very good example since it's pretty much impossible to match SCLK but for other things it might be more useful (e.g. controlling an enable pin)
InvertedOutputPin
e.g. the
spi_loopback_dma
example could be changed like thisThis will invert the output of the CS pin.
Unfortunately, it's quite a lot of code. But at least it's living in its own module could be moved out of
gpio.rs
.