// SPDX-FileCopyrightText: 2024 Kent Gibson // // SPDX-License-Identifier: Apache-2.0 OR MIT // Example of asynchronously waiting for edges on a single line using async_io. use anyhow::Context; use embedded_hal_async::digital::Wait; use gpiocdev_embedded_hal::async_io::InputPin; fn main() -> Result<(), Box> { let mut pin = InputPin::new("/dev/gpiochip0", 23).context("Failed to request line")?; async_io::block_on(async { loop { let _ = pin.wait_for_any_edge().await; println!("got edge"); } }); Ok(()) }