pub struct ThreadedRegistration<H: ThreadedHandler>(_);
Expand description

The registration of a threaded interrupt handler.

Examples

The following is an example of a threaded handler with a ref-counted u32 as data:

use kernel::{
    irq,
    sync::{Ref, RefBorrow},
};

struct Example;

impl irq::ThreadedHandler for Example {
    type Data = Ref<u32>;

    fn handle_threaded_irq(_data: RefBorrow<'_, u32>) -> irq::Return {
        irq::Return::None
    }
}

fn request_irq(irq: u32, data: Ref<u32>) -> Result<irq::ThreadedRegistration<Example>> {
    irq::ThreadedRegistration::try_new(irq, data, irq::flags::SHARED, fmt!("example_{irq}"))
}

Implementations

Registers a new threaded irq handler.

The valid values of flags come from the flags module.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.