File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
pub mod adc_trigger;
2
+ pub mod capture;
2
3
pub mod compare_register;
3
4
pub mod control;
4
5
pub mod deadtime;
Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ use super::{
8
8
event:: {
9
9
TimerAResetEventSource , TimerBResetEventSource , TimerCResetEventSource ,
10
10
TimerDResetEventSource , TimerEResetEventSource , TimerFResetEventSource ,
11
- } ,
11
+ } , capture :: { HrCapt , self } ,
12
12
} ;
13
13
14
14
pub struct HrTim < TIM , PSCL > {
15
15
_timer : PhantomData < TIM > ,
16
16
_prescaler : PhantomData < PSCL > ,
17
+ capture_ch1 : HrCapt < TIM , PSCL , capture:: Ch1 > ,
18
+ capture_ch2 : HrCapt < TIM , PSCL , capture:: Ch2 > ,
17
19
}
18
20
19
21
pub trait HrTimer < TIM , PSCL > : Sized {
@@ -159,6 +161,14 @@ macro_rules! hrtim_timer {
159
161
160
162
tim. $icr. write( |w| w. $repc( ) . set_bit( ) ) ;
161
163
}
164
+
165
+ pub fn capture_ch1( & mut self ) -> & mut HrCapt <$TIMX, PSCL , capture:: Ch1 > {
166
+ & mut self . capture_ch1
167
+ }
168
+
169
+ pub fn capture_ch2( & mut self ) -> & mut HrCapt <$TIMX, PSCL , capture:: Ch2 > {
170
+ & mut self . capture_ch2
171
+ }
162
172
}
163
173
164
174
$(
You can’t perform that action at this time.
0 commit comments