restore example and add set_time_stretch api

This commit is contained in:
Jacob Rosenthal
2021-11-03 15:26:44 -07:00
parent 682274870f
commit 44375b427c
3 changed files with 138 additions and 29 deletions

View File

@ -423,6 +423,12 @@ impl<'d, T: Instance> Pwm<'d, T> {
.write(|w| unsafe { w.countertop().bits(duty.min(32767u16)) });
}
/// Additional number of PWM periods spent on each duty cycle value.
#[inline(always)]
pub fn set_time_stretch(&self, refresh: u32) {
T::regs().seq0.refresh.write(|w| unsafe { w.bits(refresh) });
}
/// Returns the maximum duty cycle value.
#[inline(always)]
pub fn max_duty(&self) -> u16 {