Struct ExtInt

Source
pub struct ExtInt<P, Id, F = NoneT>
where P: EicPin, Id: ChId,
{ /* private fields */ }
Expand description

A numbered external interrupt, which can be used to sense state changes on its pin.

Implementations§

Source§

impl<P, Id> ExtInt<P, Id, EicFuture>
where P: EicPin, Id: ChId, Self: InputPin<Error = Infallible>,

Source

pub async fn wait(&mut self, sense: Sense)

Source§

impl<P, Id, F> ExtInt<P, Id, F>
where P: EicPin, Id: ChId,

Source

pub fn enable_event(&mut self)

Enables the event output of the channel for the event system.

Note that whilst this function is executed, the EIC peripheral is disabled in order to write to the evctrl register

Source

pub fn enable_interrupt(&mut self)

Source

pub fn enable_interrupt_wake(&mut self)

Source

pub fn disable_interrupt(&mut self)

Source

pub fn is_interrupt(&mut self) -> bool

Source

pub fn clear_interrupt(&mut self)

Source

pub fn sense(&mut self, sense: Sense)

Source

pub fn filter(&mut self, filter: bool)

Source§

impl<P, Id, F> ExtInt<P, Id, F>
where P: EicPin, Id: ChId,

Source

pub fn free(self) -> (Pin<P::Id, P::Mode>, Channel<Id, F>)

Release the underlying resources: Pin and Channel.

Source

pub fn into_future(self)

This method is not present with the selected feature set, defined for documentation only

Trait Implementations§

Source§

impl<P, Id, F> ErrorType for ExtInt<P, Id, F>
where P: EicPin, Id: ChId,

Source§

type Error = Infallible

Error type
Source§

impl<P, C, Id, F> InputPin for ExtInt<P, Id, F>
where P: EicPin + AnyPin<Mode = Interrupt<C>>, Id: ChId, C: InterruptConfig,

Source§

type Error = Infallible

Error type
Source§

fn is_high(&self) -> Result<bool, Self::Error>

Is the input pin high?
Source§

fn is_low(&self) -> Result<bool, Self::Error>

Is the input pin low?
Source§

impl<P, Id, F> InputPin for ExtInt<P, Id, F>
where Self: ErrorType, P: EicPin, Id: ChId,

Source§

fn is_high(&mut self) -> Result<bool, Self::Error>

Is the input pin high?
Source§

fn is_low(&mut self) -> Result<bool, Self::Error>

Is the input pin low?
Source§

impl<P, Id> Wait for ExtInt<P, Id, EicFuture>
where P: EicPin, Id: ChId, Self: InputPin<Error = Infallible>,

Source§

async fn wait_for_high(&mut self) -> Result<(), Self::Error>

Wait until the pin is high. If it is already high, return immediately. Read more
Source§

async fn wait_for_low(&mut self) -> Result<(), Self::Error>

Wait until the pin is low. If it is already low, return immediately. Read more
Source§

async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error>

Wait for the pin to undergo a transition from low to high. Read more
Source§

async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error>

Wait for the pin to undergo a transition from high to low. Read more
Source§

async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error>

Wait for the pin to undergo any transition, i.e low to high OR high to low.

Auto Trait Implementations§

§

impl<P, Id, F> Freeze for ExtInt<P, Id, F>

§

impl<P, Id, F> RefUnwindSafe for ExtInt<P, Id, F>

§

impl<P, Id, F> Send for ExtInt<P, Id, F>
where Id: Send, F: Send, <P as AnyPin>::Mode: Send, <P as AnyPin>::Id: Send,

§

impl<P, Id, F = NoneT> !Sync for ExtInt<P, Id, F>

§

impl<P, Id, F> Unpin for ExtInt<P, Id, F>
where Id: Unpin, F: Unpin, <P as AnyPin>::Mode: Unpin, <P as AnyPin>::Id: Unpin,

§

impl<P, Id, F> UnwindSafe for ExtInt<P, Id, F>
where Id: UnwindSafe, F: UnwindSafe, <P as AnyPin>::Mode: UnwindSafe, <P as AnyPin>::Id: 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> Same for T

Source§

type Output = T

Should always be Self
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.