File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,26 @@ pub trait OutputPin {
1111
1212/// Output pin that can read its output state
1313#[ cfg( feature = "unproven" ) ]
14- trait StatefulOutputPin : OutputPin {
14+ trait StatefulOutputPin {
1515 /// Is the pin set to high?
1616 fn is_set_high ( & self ) -> bool ;
1717
1818 /// Is the pin set to low?
1919 fn is_set_low ( & self ) -> bool ;
20+ }
21+
22+ /// Output pin that can be toggled
23+ #[ cfg( feature = "unproven" ) ]
24+ trait ToggleableOutputPin {
25+ /// Toggle pin output
26+ fn toggle ( & mut self ) ;
27+ }
2028
29+ /// If you can read **and** write the output state, a pin is
30+ /// toggleable by software. You may override the `toggle()` method
31+ /// with a hardware implementation.
32+ #[ cfg( feature = "unproven" ) ]
33+ impl < PIN : OutputPin + StatefulOutputPin > ToggleableOutputPin for PIN {
2134 /// Toggle pin output
2235 fn toggle ( & mut self ) {
2336 if self . is_set_low ( ) {
You can’t perform that action at this time.
0 commit comments