expose enabling and disabling irq for triggers

This commit is contained in:
Ulf Lilleengen 2024-07-01 10:22:39 +02:00
parent 2a38787a83
commit 0b8a8e54dc

View File

@ -77,6 +77,24 @@ impl<'d, T: Instance> Trigger<'d, T> {
let regs = T::regs();
Event::from_reg(&regs.events_triggered[nr])
}
/// Enable interrupts for this trigger
pub fn enable_interrupt(&mut self) {
let regs = T::regs();
unsafe {
regs.intenset
.modify(|r, w| w.bits(r.bits() | (1 << self.number as usize)))
};
}
/// Enable interrupts for this trigger
pub fn disable_interrupt(&mut self) {
let regs = T::regs();
unsafe {
regs.intenclr
.modify(|r, w| w.bits(r.bits() | (1 << self.number as usize)))
};
}
}
/// Represents a trigger within an EGU.