Skip to content

Commit acd3247

Browse files
authored
Add support for PWM (taken from stm32h7xx-hal). (#29)
This commit requires a recent git version of stm32g4 to compile, as the last released version specifies some wrong register sizes and types. The changes to the code include: - stm32g4xx-hal uses a different API for clock gating/reset. - stm32g4 is missing many bit/field names, so the code often uses .bits() or .set_bit()/.clear_bit() instead. - The advanced-control timers of the STM32G4 MCUs provide four complementary outputs.
1 parent d94905c commit acd3247

File tree

5 files changed

+1907
-164
lines changed

5 files changed

+1907
-164
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub mod gpio;
7373
pub mod i2c;
7474
pub mod opamp;
7575
pub mod prelude;
76-
// pub mod pwm;
76+
pub mod pwm;
7777
// pub mod qei;
7878
pub mod rcc;
7979
// pub mod rng;

src/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub use crate::serial::SerialExt as _;
3535
pub use crate::spi::SpiExt as _;
3636
pub use crate::time::U32Ext as _;
3737
// pub use crate::timer::opm::OpmExt as _;
38-
// pub use crate::timer::pwm::PwmExt as _;
38+
pub use crate::pwm::PwmExt as _;
3939
// pub use crate::timer::qei::QeiExt as _;
4040
// pub use crate::timer::stopwatch::StopwatchExt as _;
4141
// pub use crate::timer::TimerExt as _;

0 commit comments

Comments
 (0)