File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -897,26 +897,29 @@ pub trait Pwm {
897
897
///
898
898
/// See `Pwm` for details
899
899
pub trait PwmPin {
900
+ /// Enumeration of `PwmPin` errors
901
+ type Error ;
902
+
900
903
/// Type for the `duty` methods
901
904
///
902
905
/// The implementer is free to choose a float / percentage representation
903
906
/// (e.g. `0.0 .. 1.0`) or an integer representation (e.g. `0 .. 65535`)
904
907
type Duty ;
905
908
906
909
/// Disables a PWM `channel`
907
- fn disable ( & mut self ) ;
910
+ fn try_disable ( & mut self ) -> Result < ( ) , Self :: Error > ;
908
911
909
912
/// Enables a PWM `channel`
910
- fn enable ( & mut self ) ;
913
+ fn try_enable ( & mut self ) -> Result < ( ) , Self :: Error > ;
911
914
912
915
/// Returns the current duty cycle
913
- fn get_duty ( & self ) -> Self :: Duty ;
916
+ fn try_get_duty ( & self ) -> Result < Self :: Duty , Self :: Error > ;
914
917
915
918
/// Returns the maximum duty cycle value
916
- fn get_max_duty ( & self ) -> Self :: Duty ;
919
+ fn try_get_max_duty ( & self ) -> Result < Self :: Duty , Self :: Error > ;
917
920
918
921
/// Sets a new duty cycle
919
- fn set_duty ( & mut self , duty : Self :: Duty ) ;
922
+ fn try_set_duty ( & mut self , duty : Self :: Duty ) -> Result < ( ) , Self :: Error > ;
920
923
}
921
924
922
925
/// Quadrature encoder interface
You can’t perform that action at this time.
0 commit comments