atsamx7x-rust
atsamx7x-rust copied to clipboard
PIO: open-drain/multi-driver support
Copied from an internal Gitlab instance. By @axel-grepit:
This patch implements the open drain ("multi-driver") mode with pull-up and pull-down for each pin.
I could not find any information indicating that the modes are not supported for any specific pins and have as such followed the same patterns of implementation as for the other pin modes.
Additionally, the
InputPin
andOutputPin
traits are implemented forOpenDrain
pins. This permits using crates likeonewire
to quickly implement software 1-wire support for Dallas-style sensors (ds18b20 for instance).
WIP: InputPin/OutputPin needs additional testing before merging. Feel free to split the MR and commit the relevant OD-parts if that is needed before the relevant tests may be carried out.