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
66
77<!-- next-header -->
88## [ Unreleased] - ReleaseDate
9+ ### Added
10+ * Add a ` current_standby() ` method to check if the driver is currently in standby mode.
11+
912### Changed
1013
1114* ` Motor::new() ` and ` Driver::new() ` methods now set the outputs upon their
Original file line number Diff line number Diff line change 2222
2323#[ cfg( feature = "defmt" ) ]
2424use defmt:: Format ;
25- use embedded_hal:: digital:: OutputPin ;
25+ use embedded_hal:: digital:: { OutputPin , StatefulOutputPin } ;
2626use embedded_hal:: pwm:: SetDutyCycle ;
2727
2828/// Defines errors which can happen when calling [`Motor::drive()`].
@@ -197,6 +197,16 @@ where
197197 pub fn disable_standby ( & mut self ) -> Result < ( ) , STBY :: Error > {
198198 self . standby . set_high ( )
199199 }
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+ }
200210}
201211
202212/// 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