pub struct AsyncInput { /* private fields */ }Expand description
Async wrapper around a GPIO input pin.
Methods take &'static self because the C-side ove_gpio_irq_register
callback retains a pointer to the internal state.
Implementations§
Source§impl AsyncInput
impl AsyncInput
Sourcepub fn arm(&'static self, mode: GpioIrqMode) -> Result<()>
pub fn arm(&'static self, mode: GpioIrqMode) -> Result<()>
Register the IRQ trampoline and enable interrupts for mode
(rising / falling / both). Must be called exactly once.
Sourcepub async fn wait_for_event(&'static self)
pub async fn wait_for_event(&'static self)
Await the next edge event. Returns immediately if an edge has fired since the last call to this function.
pub fn pin(&self) -> GpioPin
Trait Implementations§
impl Send for AsyncInput
impl Sync for AsyncInput
Auto Trait Implementations§
impl !Freeze for AsyncInput
impl !RefUnwindSafe for AsyncInput
impl Unpin for AsyncInput
impl UnsafeUnpin for AsyncInput
impl UnwindSafe for AsyncInput
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