Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added

- PWM output on TIM2 channels.
- Provide getters to serial status flags idle/txe/rxne/tc.
- Provide ability to reset timer UIF interrupt flag
- PWM complementary output capability for TIM1 with new example to demonstrate
Expand Down
15 changes: 15 additions & 0 deletions src/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,21 @@ macro_rules! pwm_1_channel_with_complementary_outputs {

use crate::pac::*;

#[cfg(any(
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f071",
feature = "stm32f072",
feature = "stm32f078",
feature = "stm32f091",
feature = "stm32f098",
))]
pwm_4_channels!(TIM2: (tim2, tim2en, tim2rst, apb1enr, apb1rstr),);

pwm_4_channels!(TIM3: (tim3, tim3en, tim3rst, apb1enr, apb1rstr),);

pwm_4_channels_with_3_complementary_outputs!(TIM1: (tim1, tim1en, tim1rst, apb2enr, apb2rstr),);
Expand Down
20 changes: 20 additions & 0 deletions src/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,26 @@ channel_impl!(
TIM15, PinC2, PB15, Alternate<AF1>;
);

#[cfg(any(
feature = "stm32f031",
feature = "stm32f038",
feature = "stm32f042",
feature = "stm32f048",
feature = "stm32f051",
feature = "stm32f058",
feature = "stm32f071",
feature = "stm32f072",
feature = "stm32f078",
feature = "stm32f091",
feature = "stm32f098",
))]
channel_impl!(
TIM2, PinC1, PA0, Alternate<AF2>;
TIM2, PinC2, PA1, Alternate<AF2>;
TIM2, PinC3, PA2, Alternate<AF2>;
TIM2, PinC4, PA3, Alternate<AF2>;
);

#[cfg(any(
feature = "stm32f030",
feature = "stm32f051",
Expand Down
Loading