pub struct InputPinAsync { /* private fields */ }Expand description
Input pin which has additional asynchronous support.
Implementations§
Source§impl InputPinAsync
impl InputPinAsync
Sourcepub fn new(pin: Input, irq_config: InterruptConfig) -> Self
pub fn new(pin: Input, irq_config: InterruptConfig) -> 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).