pub struct Input<'d, M: Mode = Blocking> { /* private fields */ }Expand description
GPIO input driver.
Implementations§
Source§impl<'d> Input<'d, Async>
impl<'d> Input<'d, Async>
Sourcepub fn new_async<T: GpiotePin>(
pin: Peri<'d, T>,
irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
pull: Pull,
) -> Self
pub fn new_async<T: GpiotePin>( pin: Peri<'d, T>, irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, pull: Pull, ) -> Self
Create an async GPIO input driver for a Pin with the provided Pull configuration.
The pin’s GPIOTE interrupt must be bound to InterruptHandler for this pin.
Sourcepub async fn wait_for_high(&mut self)
pub async fn wait_for_high(&mut self)
Wait until the pin is high. If it is already high, return immediately.
Sourcepub async fn wait_for_low(&mut self)
pub async fn wait_for_low(&mut self)
Wait until the pin is low. If it is already low, return immediately.
Sourcepub async fn wait_for_rising_edge(&mut self)
pub async fn wait_for_rising_edge(&mut self)
Wait for the pin to undergo a transition from low to high.
Sourcepub async fn wait_for_falling_edge(&mut self)
pub async fn wait_for_falling_edge(&mut self)
Wait for the pin to undergo a transition from high to low.
Sourcepub async fn wait_for_any_edge(&mut self)
pub async fn wait_for_any_edge(&mut self)
Wait for the pin to undergo any transition, i.e low to high OR high to low.
Trait Implementations§
Source§impl<'d> Wait for Input<'d, Async>
impl<'d> Wait for Input<'d, Async>
Source§async fn wait_for_high(&mut self) -> Result<(), Self::Error>
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>
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>
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
Auto Trait Implementations§
impl<'d, M = Blocking> !UnwindSafe for Input<'d, M>
impl<'d, M> Freeze for Input<'d, M>
impl<'d, M> RefUnwindSafe for Input<'d, M>where
Flex<'d, M>: RefUnwindSafe,
impl<'d, M> Send for Input<'d, M>
impl<'d, M> Sync for Input<'d, M>
impl<'d, M> Unpin for Input<'d, M>
impl<'d, M> UnsafeUnpin for Input<'d, M>where
Flex<'d, M>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more