pub struct InputPinAsync { /* private fields */ }Implementations§
Source§impl InputPinAsync
impl InputPinAsync
Sourcepub fn new(pin: Input, irq: Interrupt) -> Self
pub fn new(pin: Input, irq: Interrupt) -> Self
Create a new asynchronous input pin from an Input pin. The interrupt ID to be used must be passed as well and is used to route and enable the interrupt.
Please note that the interrupt handler itself must be provided by the user and the generic on_interrupt_for_async_gpio_for_port function must be called inside that function for the asynchronous functionality to work.
Sourcepub async fn wait_for_high(&mut self)
pub async fn wait_for_high(&mut self)
Asynchronously wait until the pin is high.
This returns immediately if the pin is already high.
Sourcepub async fn wait_for_low(&mut self)
pub async fn wait_for_low(&mut self)
Asynchronously wait until the pin is low.
This returns immediately if the pin is already high.
Sourcepub async fn wait_for_falling_edge(&mut self)
pub async fn wait_for_falling_edge(&mut self)
Asynchronously wait until the pin sees a falling edge.
Sourcepub async fn wait_for_rising_edge(&mut self)
pub async fn wait_for_rising_edge(&mut self)
Asynchronously wait until the pin sees a rising edge.
Sourcepub async fn wait_for_any_edge(&mut self)
pub async fn wait_for_any_edge(&mut self)
Asynchronously wait until the pin sees any edge (either rising or falling).
pub fn release(self) -> Input
Trait Implementations§
Source§impl ErrorType for InputPinAsync
impl ErrorType for InputPinAsync
Source§type Error = Infallible
type Error = Infallible
Error type
Source§impl Wait for InputPinAsync
impl Wait for InputPinAsync
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 Freeze for InputPinAsync
impl RefUnwindSafe for InputPinAsync
impl Send for InputPinAsync
impl !Sync for InputPinAsync
impl Unpin for InputPinAsync
impl UnwindSafe for InputPinAsync
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