22
22
/// let max_duty = pwm.try_get_max_duty().unwrap();
23
23
///
24
24
/// // brightest LED
25
- /// pwm.try_set_duty(Channel::_1, max_duty).unwrap();
25
+ /// pwm.try_set_duty(& Channel::_1, max_duty).unwrap();
26
26
///
27
27
/// // dimmer LED
28
- /// pwm.try_set_duty(Channel::_2, max_duty / 4).unwrap();
28
+ /// pwm.try_set_duty(& Channel::_2, max_duty / 4).unwrap();
29
29
/// }
30
30
///
31
31
/// # use core::convert::Infallible;
39
39
/// # type Channel = Channel;
40
40
/// # type Time = KiloHertz;
41
41
/// # type Duty = u16;
42
- /// # fn try_disable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
43
- /// # fn try_enable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
44
- /// # fn try_get_duty(&self, _: Channel) -> Result<u16, Self::Error> { unimplemented!() }
42
+ /// # fn try_disable(&mut self, _: & Channel) -> Result<(), Self::Error> { unimplemented!() }
43
+ /// # fn try_enable(&mut self, _: & Channel) -> Result<(), Self::Error> { unimplemented!() }
44
+ /// # fn try_get_duty(&self, _: & Channel) -> Result<u16, Self::Error> { unimplemented!() }
45
45
/// # fn try_get_max_duty(&self) -> Result<u16, Self::Error> { Ok(0) }
46
- /// # fn try_set_duty(&mut self, _: Channel, _: u16) -> Result<(), Self::Error> { Ok(()) }
46
+ /// # fn try_set_duty(&mut self, _: & Channel, _: u16) -> Result<(), Self::Error> { Ok(()) }
47
47
/// # fn try_get_period(&self) -> Result<KiloHertz, Self::Error> { unimplemented!() }
48
48
/// # fn try_set_period<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<KiloHertz> { Ok(()) }
49
49
/// # }
@@ -70,22 +70,22 @@ pub trait Pwm {
70
70
type Duty ;
71
71
72
72
/// Disables a PWM `channel`
73
- fn try_disable ( & mut self , channel : Self :: Channel ) -> Result < ( ) , Self :: Error > ;
73
+ fn try_disable ( & mut self , channel : & Self :: Channel ) -> Result < ( ) , Self :: Error > ;
74
74
75
75
/// Enables a PWM `channel`
76
- fn try_enable ( & mut self , channel : Self :: Channel ) -> Result < ( ) , Self :: Error > ;
76
+ fn try_enable ( & mut self , channel : & Self :: Channel ) -> Result < ( ) , Self :: Error > ;
77
77
78
78
/// Returns the current PWM period
79
79
fn try_get_period ( & self ) -> Result < Self :: Time , Self :: Error > ;
80
80
81
81
/// Returns the current duty cycle
82
- fn try_get_duty ( & self , channel : Self :: Channel ) -> Result < Self :: Duty , Self :: Error > ;
82
+ fn try_get_duty ( & self , channel : & Self :: Channel ) -> Result < Self :: Duty , Self :: Error > ;
83
83
84
84
/// Returns the maximum duty cycle value
85
85
fn try_get_max_duty ( & self ) -> Result < Self :: Duty , Self :: Error > ;
86
86
87
87
/// Sets a new duty cycle
88
- fn try_set_duty ( & mut self , channel : Self :: Channel , duty : Self :: Duty )
88
+ fn try_set_duty ( & mut self , channel : & Self :: Channel , duty : Self :: Duty )
89
89
-> Result < ( ) , Self :: Error > ;
90
90
91
91
/// Sets a new PWM period
0 commit comments