diff --git a/rp2040-hal/src/pwm/mod.rs b/rp2040-hal/src/pwm/mod.rs index a206e01..6690a66 100644 --- a/rp2040-hal/src/pwm/mod.rs +++ b/rp2040-hal/src/pwm/mod.rs @@ -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 {