rust-embedded-community / tm4c-hal

An Embedded HAL and general chip support for the TM4C123/LM4F120. Replaces the old lm4f120 crate.
Apache License 2.0
40 stars 26 forks source link

Implement embedded_hal::Pwm for TIMER0..=5 #28

Closed mokomull closed 3 years ago

mokomull commented 4 years ago

This is modeled by the serial module, and takes ownership of timer peripherals and the appropriate GPIO pins to implement the Pwm trait. It is slightly unfortunate that it takes ownership of the entire timer peripheral rather than allowing the user to call .into_even() and use timer B for other things (or vice-versa).

This has been tested by porting the examples in the stellaris-launchpad crate and running them on the EK-LM4F120XL LaunchPad.