Skip to content

Commit f35313d

Browse files
author
JD
committed
TIM2 PWM outputs implemented
1 parent 8eda864 commit f35313d

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/pwm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ macro_rules! pwm_1_channel_with_complementary_outputs {
906906

907907
use crate::pac::*;
908908

909+
pwm_4_channels!(TIM2: (tim2, tim2en, tim2rst, apb1enr, apb1rstr),);
909910
pwm_4_channels!(TIM3: (tim3, tim3en, tim3rst, apb1enr, apb1rstr),);
910911

911912
pwm_4_channels_with_3_complementary_outputs!(TIM1: (tim1, tim1en, tim1rst, apb2enr, apb2rstr),);

src/timers.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,26 @@ channel_impl!(
353353
TIM15, PinC2, PB15, Alternate<AF1>;
354354
);
355355

356+
#[cfg(any(
357+
feature = "stm32f031",
358+
feature = "stm32f038",
359+
feature = "stm32f042",
360+
feature = "stm32f048",
361+
feature = "stm32f051",
362+
feature = "stm32f058",
363+
feature = "stm32f071",
364+
feature = "stm32f072",
365+
feature = "stm32f078",
366+
feature = "stm32f091",
367+
feature = "stm32f098",
368+
))]
369+
channel_impl!(
370+
TIM2, PinC1, PA0, Alternate<AF2>;
371+
TIM2, PinC2, PA1, Alternate<AF2>;
372+
TIM2, PinC3, PA2, Alternate<AF2>;
373+
TIM2, PinC4, PA3, Alternate<AF2>;
374+
);
375+
356376
#[cfg(any(
357377
feature = "stm32f030",
358378
feature = "stm32f051",

0 commit comments

Comments
 (0)