embedded-hal-mock icon indicating copy to clipboard operation
embedded-hal-mock copied to clipboard

StatefulOutputPin and ToggleableOutputPin

Open rubberduck203 opened this issue 4 years ago • 2 comments

Would you be interested in a PR that implements ToggleableOutputPin?

If I understand things correctly, the Transaction already knows it's state

https://github.com/dbrgn/embedded-hal-mock/blob/master/src/pin.rs#L51

so it should be relatively easy to implement StatefulOutputPin, which in turn would in turn make implementing toggleable relatively trivial.

rubberduck203 avatar Feb 04 '20 08:02 rubberduck203

This turned out to be more difficult than I had originally thought. I ended up implementing a simple fake instead.

https://github.com/rubberduck203/switch-hal/blob/61fbb12e13e7cff732e3f2e17015c32c8e76cd57/src/mock.rs

I'm still interesting in solving this, but am currently unsure of how to merge the two different implementations into a coherent design.

rubberduck203 avatar Feb 06 '20 00:02 rubberduck203

+1, Support for StatefulOutputPin would be awesome

ostenning avatar Dec 30 '23 05:12 ostenning