File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,25 @@ pub trait OutputPin {
11
11
12
12
/// Output pin that can read its output state
13
13
#[ cfg( feature = "unproven" ) ]
14
- trait StatefulOutputPin : OutputPin {
14
+ trait StatefulOutputPin {
15
15
/// Is the pin set to high?
16
16
fn is_set_high ( & self ) -> bool ;
17
17
18
18
/// Is the pin set to low?
19
19
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
+ }
20
28
29
+ /// If you can read *and* write, a pin is toggleable by software. You
30
+ /// may override the `toggle()` method with a hardware implementation.
31
+ #[ cfg( feature = "unproven" ) ]
32
+ impl < PIN : OutputPin + StatefulOutputPin > ToggleableOutputPin for PIN {
21
33
/// Toggle pin output
22
34
fn toggle ( & mut self ) {
23
35
if self . is_set_low ( ) {
You can’t perform that action at this time.
0 commit comments