mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 04:51:31 +11:00
Add methods to set and clear the PWM Interrupt force register.
This commit is contained in:
parent
b1dc9aec8c
commit
fb69308058
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue