aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/timer/pwm_input.rs
diff options
context:
space:
mode:
authorFabian Wolter <[email protected]>2025-07-21 07:57:49 +0200
committerDario Nieuwenhuis <[email protected]>2025-09-05 21:15:46 +0200
commita6562c4f033432e40970aafe82f33c5138adf84e (patch)
treeb0f9e6e624af1708ffe1b865a3db205979fe5200 /embassy-stm32/src/timer/pwm_input.rs
parent0407f7ebe8fabeb81b8a77811ec5dda0fee0b44b (diff)
Add STM32F1 AFIO remap
Diffstat (limited to 'embassy-stm32/src/timer/pwm_input.rs')
-rw-r--r--embassy-stm32/src/timer/pwm_input.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/embassy-stm32/src/timer/pwm_input.rs b/embassy-stm32/src/timer/pwm_input.rs
index 1e55f2919..c537e5268 100644
--- a/embassy-stm32/src/timer/pwm_input.rs
+++ b/embassy-stm32/src/timer/pwm_input.rs
@@ -20,6 +20,8 @@ impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T> {
20 /// Create a new PWM input driver. 20 /// Create a new PWM input driver.
21 pub fn new_ch1(tim: Peri<'d, T>, pin: Peri<'d, impl TimerPin<T, Ch1>>, pull: Pull, freq: Hertz) -> Self { 21 pub fn new_ch1(tim: Peri<'d, T>, pin: Peri<'d, impl TimerPin<T, Ch1>>, pull: Pull, freq: Hertz) -> Self {
22 pin.set_as_af(pin.af_num(), AfType::input(pull)); 22 pin.set_as_af(pin.af_num(), AfType::input(pull));
23 #[cfg(afio)]
24 super::set_afio::<T>(&[Some(pin.into())]);
23 25
24 Self::new_inner(tim, freq, Channel::Ch1, Channel::Ch2) 26 Self::new_inner(tim, freq, Channel::Ch1, Channel::Ch2)
25 } 27 }
@@ -27,6 +29,8 @@ impl<'d, T: GeneralInstance4Channel> PwmInput<'d, T> {
27 /// Create a new PWM input driver. 29 /// Create a new PWM input driver.
28 pub fn new_ch2(tim: Peri<'d, T>, pin: Peri<'d, impl TimerPin<T, Ch2>>, pull: Pull, freq: Hertz) -> Self { 30 pub fn new_ch2(tim: Peri<'d, T>, pin: Peri<'d, impl TimerPin<T, Ch2>>, pull: Pull, freq: Hertz) -> Self {
29 pin.set_as_af(pin.af_num(), AfType::input(pull)); 31 pin.set_as_af(pin.af_num(), AfType::input(pull));
32 #[cfg(afio)]
33 super::set_afio::<T>(&[Some(pin.into())]);
30 34
31 Self::new_inner(tim, freq, Channel::Ch2, Channel::Ch1) 35 Self::new_inner(tim, freq, Channel::Ch2, Channel::Ch1)
32 } 36 }