[][src]Trait kernel::hil::gpio::InterruptWithValue

pub trait InterruptWithValue<'a>: Input {
    fn set_client(&self, client: &'a dyn ClientWithValue);
fn enable_interrupts(&self, mode: InterruptEdge) -> ReturnCode;
fn disable_interrupts(&self);
fn is_pending(&self) -> bool;
fn set_value(&self, value: u32);
fn value(&self) -> u32; }

Interface that wraps an interrupt to pass a value when it triggers. The standard use case for this trait is when several interrupts call the same callback function and it needs to distinguish which one is calling it by giving each one a unique value.

Required methods

fn set_client(&self, client: &'a dyn ClientWithValue)

Set the client for interrupt events.

fn enable_interrupts(&self, mode: InterruptEdge) -> ReturnCode

Enable an interrupt on the GPIO pin. This does not configure the pin except to enable an interrupt: it should be separately configured as an input, etc. Returns: SUCCESS - the interrupt was set up properly FAIL - the interrupt was not set up properly; this is due to not having an underlying interrupt source yet, i.e. the struct is not yet fully initialized.

fn disable_interrupts(&self)

Disable interrupts for the GPIO pin.

fn is_pending(&self) -> bool

Return whether this interrupt is pending

fn set_value(&self, value: u32)

Set the value that will be passed to clients on an interrupt.

fn value(&self) -> u32

Return the value that is passed to clients on an interrupt.

Loading content...


impl<'a, IP: InterruptPin<'a>> InterruptWithValue<'a> for InterruptValueWrapper<'a, IP>[src]

Loading content...