Interrupt

Struct Interrupt 

Source
pub struct Interrupt<I, P, State> { /* private fields */ }
Expand description

API for controlling pin interrupts

Implementations§

Source§

impl<I, OldPin, State> Interrupt<I, OldPin, State>
where I: Trait,

Source

pub fn select<P>( self, interrupt_pin: &P, _: &mut Handle, ) -> Interrupt<I, P, State>
where P: Trait,

Select a pin as the source of this interrupt

Please be aware that this method allows you to do things that might or might not be valid things to do:

  • You can select any pin, regardless of its current state.
  • You can select the same pin for multiple interrupts.

The documentation isn’t totally clear about whether these are allowed, and no research has been done to verify it one way or the other. Please be careful, and make sure to open an issue, if you discover that this API allows you to do something that is not correct.

Please also be aware that the interrupt handler for various pin interrupts is reused for other purposes.

Source§

impl<I, P> Interrupt<I, P, Enabled>
where I: Trait, P: Trait,

Source

pub fn clear_rising_edge_flag(&mut self) -> bool

Returns whether a rising edge has been detected and clears the flag

This method will work regardless of whether rising edge interrupts have been enabled or not.

You must call this handle while handling a rising edge interrupt. Otherwise, the interrupt will be fired again immediately, after the interrupt handler exits.

Source

pub fn enable_rising_edge(&mut self)

Fire interrupt on rising edge

Source

pub fn disable_rising_edge(&mut self)

Don’t fire interrupt on rising edge

Source

pub fn clear_falling_edge_flag(&mut self) -> bool

Returns whether a falling edge has been detected and clears the flag

This method will work regardless of whether falling edge interrupts have been enabled or not.

You must call this handle while handling a falling edge interrupt. Otherwise, the interrupt will be fired again immediately, after the interrupt handler exits.

Source

pub fn enable_falling_edge(&mut self)

Fire interrupt on falling edge

Source

pub fn disable_falling_edge(&mut self)

Don’t fire interrupt on falling edge

Auto Trait Implementations§

§

impl<I, P, State> Freeze for Interrupt<I, P, State>

§

impl<I, P, State> RefUnwindSafe for Interrupt<I, P, State>

§

impl<I, P, State> Send for Interrupt<I, P, State>
where I: Send, P: Send, State: Send,

§

impl<I, P, State> Sync for Interrupt<I, P, State>
where I: Sync, P: Sync, State: Sync,

§

impl<I, P, State> Unpin for Interrupt<I, P, State>
where I: Unpin, P: Unpin, State: Unpin,

§

impl<I, P, State> UnwindSafe for Interrupt<I, P, State>
where I: UnwindSafe, P: UnwindSafe, State: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.