Trait IrqIf

Source
pub trait IrqIf {
    // Required methods
    fn set_enable(irq: usize, enabled: bool);
    fn register(irq: usize, handler: IrqHandler) -> bool;
    fn unregister(irq: usize) -> Option<IrqHandler>;
    fn handle(irq: usize);
}
Expand description

IRQ management interface.

Required Methods§

Source

fn set_enable(irq: usize, enabled: bool)

Enables or disables the given IRQ.

Source

fn register(irq: usize, handler: IrqHandler) -> bool

Registers an IRQ handler for the given IRQ.

It also enables the IRQ if the registration succeeds. It returns false if the registration failed.

Source

fn unregister(irq: usize) -> Option<IrqHandler>

Unregisters the IRQ handler for the given IRQ.

It also disables the IRQ if the unregistration succeeds. It returns the existing handler if it is registered, None otherwise.

Source

fn handle(irq: usize)

Handles the IRQ.

It is called by the common interrupt handler. It should look up in the IRQ handler table and calls the corresponding handler. If necessary, it also acknowledges the interrupt controller after handling.

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.

Implementors§