pub struct Flags(/* private fields */);
Expand description
Flags to be used when registering IRQ handlers.
Flags can be used to request specific behaviors when registering an IRQ
handler, and can be combined using the |
, &
, and !
operators to
further control the system’s behavior.
A common use case is to register a shared interrupt, as sharing the line
between devices is increasingly common in modern systems and is even
required for some buses. This requires setting Flags::SHARED
when
requesting the interrupt. Other use cases include setting the trigger type
through Flags::TRIGGER_*
, which determines when the interrupt fires, or
controlling whether the interrupt is masked after the handler runs by using
Flags::ONESHOT
.
If an invalid combination of flags is provided, the system will refuse to
register the handler, and lower layers will enforce certain flags when
necessary. This means, for example, that all the
crate::irq::Registration
for a shared interrupt have to agree on
Flags::SHARED
and on the same trigger type, if set.
Implementations§
Source§impl Flags
impl Flags
Sourcepub const TRIGGER_NONE: Flags
pub const TRIGGER_NONE: Flags
Use the interrupt line as already configured.
Sourcepub const TRIGGER_RISING: Flags
pub const TRIGGER_RISING: Flags
The interrupt is triggered when the signal goes from low to high.
Sourcepub const TRIGGER_FALLING: Flags
pub const TRIGGER_FALLING: Flags
The interrupt is triggered when the signal goes from high to low.
Sourcepub const TRIGGER_HIGH: Flags
pub const TRIGGER_HIGH: Flags
The interrupt is triggered while the signal is held high.
Sourcepub const TRIGGER_LOW: Flags
pub const TRIGGER_LOW: Flags
The interrupt is triggered while the signal is held low.
Sourcepub const PROBE_SHARED: Flags
pub const PROBE_SHARED: Flags
Set by callers when they expect sharing mismatches to occur.
Sourcepub const NOBALANCING: Flags
pub const NOBALANCING: Flags
Flag to exclude this interrupt from irq balancing.
Sourcepub const IRQPOLL: Flags
pub const IRQPOLL: Flags
Interrupt is used for polling (only the interrupt that is registered first in a shared interrupt is considered for performance reasons).
Sourcepub const ONESHOT: Flags
pub const ONESHOT: Flags
Interrupt is not re-enabled after the hardirq handler finished. Used by threaded interrupts which need to keep the irq line disabled until the threaded handler has been run.
Sourcepub const NO_SUSPEND: Flags
pub const NO_SUSPEND: Flags
Do not disable this IRQ during suspend. Does not guarantee that this interrupt will wake the system from a suspended state.
Sourcepub const FORCE_RESUME: Flags
pub const FORCE_RESUME: Flags
Force enable it on resume even if Flags::NO_SUSPEND
is set.
Sourcepub const EARLY_RESUME: Flags
pub const EARLY_RESUME: Flags
Resume IRQ early during syscore instead of at device resume time.
Sourcepub const COND_SUSPEND: Flags
pub const COND_SUSPEND: Flags
If the IRQ is shared with a Flags::NO_SUSPEND
user, execute this
interrupt handler after suspending interrupts. For system wakeup devices
users need to implement wakeup detection in their interrupt handlers.
Trait Implementations§
impl Copy for Flags
impl Eq for Flags
impl StructuralPartialEq for Flags
Auto Trait Implementations§
impl Freeze for Flags
impl RefUnwindSafe for Flags
impl Send for Flags
impl Sync for Flags
impl Unpin for Flags
impl UnwindSafe for Flags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot
. Read more