mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
expose enabling and disabling irq for triggers
This commit is contained in:
parent
2a38787a83
commit
0b8a8e54dc
@ -77,6 +77,24 @@ impl<'d, T: Instance> Trigger<'d, T> {
|
||||
let regs = T::regs();
|
||||
Event::from_reg(®s.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.
|
||||
|
Loading…
Reference in New Issue
Block a user