atsams-rs / atsamx7x-rust

Rust HAL, PACs, and examples for the Microship SAM E70/S70/V70/V71
Apache License 2.0
24 stars 11 forks source link

PIO: open-drain/multi-driver support #32

Open tmplt opened 1 year ago

tmplt commented 1 year ago

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 and OutputPin traits are implemented for OpenDrain pins. This permits using crates like onewire 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.

michalfita commented 11 months ago

@tmplt this PR is a draft that doesn't even pass CI. Any chance this could be finished?

tmplt commented 11 months ago

I'll see about alloting some time for a fixup the coming weeks.

tmplt commented 11 months ago

CI passes, but I don't have hardware access at the moment for a test, at the time.

tmplt commented 11 months ago

Commits cleaned up.

tmplt commented 9 months ago

@martinmortsell, are you able to test this? If not, objections to merging as-is to evade eventual stagnation? CC @michalfita

sundbom-grepit commented 9 months ago

IIRC: this didn't work as expected when we started trying it out, so you definitely want to test/fix this before merging.