File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
<!-- next-header -->
8
8
## [ Unreleased] - ReleaseDate
9
+ ### Added
10
+ * Add a ` current_standby() ` method to check if the driver is currently in standby mode.
11
+
9
12
### Changed
10
13
11
14
* ` Motor::new() ` and ` Driver::new() ` methods now set the outputs upon their
Original file line number Diff line number Diff line change 22
22
23
23
#[ cfg( feature = "defmt" ) ]
24
24
use defmt:: Format ;
25
- use embedded_hal:: digital:: OutputPin ;
25
+ use embedded_hal:: digital:: { OutputPin , StatefulOutputPin } ;
26
26
use embedded_hal:: pwm:: SetDutyCycle ;
27
27
28
28
/// Defines errors which can happen when calling [`Motor::drive()`].
@@ -197,6 +197,16 @@ where
197
197
pub fn disable_standby ( & mut self ) -> Result < ( ) , STBY :: Error > {
198
198
self . standby . set_high ( )
199
199
}
200
+
201
+ /// Returns whether the standby mode is enabled.
202
+ ///
203
+ /// *NOTE* this does *not* read the electrical state of the pin, see [`StatefulOutputPin`]
204
+ pub fn current_standby ( & mut self ) -> Result < bool , STBY :: Error >
205
+ where
206
+ STBY : StatefulOutputPin ,
207
+ {
208
+ self . standby . is_set_high ( )
209
+ }
200
210
}
201
211
202
212
/// Represents a single motor (either motor A or motor B) hooked up to a TB6612FNG controller.
You can’t perform that action at this time.
0 commit comments