diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-11-27 03:04:50 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-11-27 03:04:50 +0100 |
| commit | 22fad1e7bc19ddcc5a8e09d4fbd9aa66c28f24bf (patch) | |
| tree | ed9f166a5f28cbd522cbb2e5fe79d0504f4a4535 | |
| parent | 8211d58ee29362edc7f210e6b6d692881254f6da (diff) | |
stm32/pwm: impl instance/pin for all chips
| -rw-r--r-- | embassy-stm32/src/pwm/mod.rs | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/embassy-stm32/src/pwm/mod.rs b/embassy-stm32/src/pwm/mod.rs index f1ef1f1dd..398c5ce75 100644 --- a/embassy-stm32/src/pwm/mod.rs +++ b/embassy-stm32/src/pwm/mod.rs | |||
| @@ -179,17 +179,21 @@ macro_rules! impl_pwm_pin { | |||
| 179 | }; | 179 | }; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | #[cfg(rcc_g0)] | 182 | crate::pac::peripherals!( |
| 183 | mod impls { | 183 | (timer, $inst:ident) => { impl_timer!($inst); }; |
| 184 | crate::pac::peripherals!( | 184 | ); |
| 185 | (timer, TIM2) => { impl_timer!(TIM2); }; | 185 | |
| 186 | (timer, TIM3) => { impl_timer!(TIM3); }; | 186 | crate::pac::peripheral_pins!( |
| 187 | (timer, TIM4) => { impl_timer!(TIM4); }; | 187 | ($inst:ident, timer,TIM_GP16, $pin:ident, CH1, $af:expr) => { |
| 188 | (timer, TIM5) => { impl_timer!(TIM5); }; | 188 | impl_pwm_pin!($inst, Ch1, $pin, $af); |
| 189 | ); | 189 | }; |
| 190 | 190 | ($inst:ident, timer,TIM_GP16, $pin:ident, CH2, $af:expr) => { | |
| 191 | impl_pwm_pin!(TIM2, Ch1, PA0, 2); | 191 | impl_pwm_pin!($inst, Ch2, $pin, $af); |
| 192 | impl_pwm_pin!(TIM2, Ch2, PA1, 2); | 192 | }; |
| 193 | impl_pwm_pin!(TIM2, Ch3, PA2, 2); | 193 | ($inst:ident, timer,TIM_GP16, $pin:ident, CH3, $af:expr) => { |
| 194 | impl_pwm_pin!(TIM2, Ch4, PA3, 2); | 194 | impl_pwm_pin!($inst, Ch3, $pin, $af); |
| 195 | } | 195 | }; |
| 196 | ($inst:ident, timer,TIM_GP16, $pin:ident, CH4, $af:expr) => { | ||
| 197 | impl_pwm_pin!($inst, Ch4, $pin, $af); | ||
| 198 | }; | ||
| 199 | ); | ||
