embedded-hal-mock
embedded-hal-mock copied to clipboard
StatefulOutputPin and ToggleableOutputPin
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.
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.
+1, Support for StatefulOutputPin
would be awesome