pub trait Interrupt: Sealed {
const IRQ: Interrupt;
// Provided methods
unsafe fn enable() { ... }
fn disable() { ... }
fn is_enabled() -> bool { ... }
fn is_pending() -> bool { ... }
fn pend() { ... }
fn unpend() { ... }
fn get_priority() -> Priority { ... }
fn set_priority(prio: Priority) { ... }
fn set_priority_with_cs(cs: CriticalSection<'_>, prio: Priority) { ... }
}
Expand description
Type-level interrupt.
This trait is implemented for all typelevel single interrupt types defined in this module. May not be implemented outside of this HAL.
Required Associated Constants§
Sourceconst IRQ: Interrupt
const IRQ: Interrupt
Interrupt enum variant.
This allows going from typelevel interrupts (one type per interrupt,
defined in this module
) to non-typelevel interrupts (a
single Interrupt
enum type, with one
variant per interrupt).
Provided Methods§
Sourcefn is_enabled() -> bool
fn is_enabled() -> bool
Check if interrupt is enabled.
Sourcefn is_pending() -> bool
fn is_pending() -> bool
Check if interrupt is pending.
Sourcefn get_priority() -> Priority
fn get_priority() -> Priority
Get the priority of the interrupt.
Sourcefn set_priority(prio: Priority)
fn set_priority(prio: Priority)
Set the interrupt priority.
Sourcefn set_priority_with_cs(cs: CriticalSection<'_>, prio: Priority)
fn set_priority_with_cs(cs: CriticalSection<'_>, prio: Priority)
Set the interrupt priority with an already-acquired critical section.
Equivalent to set_priority
, except you pass a
[CriticalSection
] to prove you’ve already acquired a critical
section. This prevents acquiring another one, which saves code size.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.