File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use crate::{
4
4
timer:: { General , Timer } ,
5
5
} ;
6
6
use cast:: u16;
7
- use core:: { marker:: PhantomData , mem:: MaybeUninit } ;
7
+ use core:: { convert :: Infallible , marker:: PhantomData , mem:: MaybeUninit } ;
8
8
9
9
pub trait Pins < TIM , P > {
10
10
const C1 : bool = false ;
@@ -123,6 +123,27 @@ macro_rules! pwm_pin {
123
123
self . set_duty( duty)
124
124
}
125
125
}
126
+
127
+ impl embedded_hal_one:: pwm:: blocking:: PwmPin for PwmChannel <$TIMX, $C> {
128
+ type Error = Infallible ;
129
+ type Duty = u16 ;
130
+
131
+ fn disable( & mut self ) -> Result <( ) , Self :: Error > {
132
+ Ok ( self . disable( ) )
133
+ }
134
+ fn enable( & mut self ) -> Result <( ) , Self :: Error > {
135
+ Ok ( self . enable( ) )
136
+ }
137
+ fn get_duty( & self ) -> Result <Self :: Duty , Self :: Error > {
138
+ Ok ( self . get_duty( ) )
139
+ }
140
+ fn get_max_duty( & self ) -> Result <Self :: Duty , Self :: Error > {
141
+ Ok ( self . get_max_duty( ) )
142
+ }
143
+ fn set_duty( & mut self , duty: Self :: Duty ) -> Result <( ) , Self :: Error > {
144
+ Ok ( self . set_duty( duty) )
145
+ }
146
+ }
126
147
} ;
127
148
}
128
149
You can’t perform that action at this time.
0 commit comments