stepper icon indicating copy to clipboard operation
stepper copied to clipboard

Add support for EN/FAULT pin

Open hannobraun opened this issue 5 years ago • 3 comments

The driver API does not have support for controlling the power stage or reading a fault. There's a bit of a difficulty here, since the same pin is used for both, and I don't believe there are traits in embedded-hal that could be used for both setting output and reading input on the same pin.

hannobraun avatar Oct 19 '20 13:10 hannobraun

To further complicate things, drivers such as the DRV8825 have separate Enable and Fault lines.

jessebraham avatar Nov 08 '20 17:11 jessebraham

The driver API does not have support for controlling the power stage or reading a fault. There's a bit of a difficulty here, since the same pin is used for both, and I don't believe there are traits in embedded-hal that could be used for both setting output and reading input on the same pin.

Looks like embedded-hal supports it now. They added IoPin which can toggle between input and output. See the bottom of https://github.com/rust-embedded/embedded-hal/blob/master/src/blocking/digital.rs

Alibirb avatar Jul 30 '21 12:07 Alibirb

Nice, thanks for the note, @WriterOfAlicrow!

hannobraun avatar Jul 30 '21 17:07 hannobraun