Add methods to set and clear the PWM Interrupt force register.

This commit is contained in:
contradict 2021-10-27 08:25:47 -07:00 committed by 9names
parent b1dc9aec8c
commit fb69308058

View file

@ -412,6 +412,28 @@ where
pub fn clear_interrupt(&mut self) {
unsafe { (*pac::PWM::ptr()).intr.write(|w| w.bits(self.bitmask())) };
}
/// Force the interrupt. This bit is not cleared by hardware and must be manually cleared to
/// stop the interrupt from continuing to be asserted.
#[inline]
pub fn force_interrupt(&mut self) {
unsafe {
let pwm = &(*pac::PWM::ptr());
let reg = (&pwm.intf).as_ptr();
write_bitmask_set(reg, self.bitmask());
}
}
/// Clear force interrupt. This bit is not cleared by hardware and must be manually cleared to
/// stop the interrupt from continuing to be asserted.
#[inline]
pub fn clear_force_interrupt(&mut self) {
unsafe {
let pwm = &(*pac::PWM::ptr());
let reg = (&pwm.intf).as_ptr();
write_bitmask_clear(reg, self.bitmask());
}
}
}
macro_rules! pwm {