pub struct ExtiInput<'d> { /* private fields */ }
Expand description
EXTI input driver.
This driver augments a GPIO Input
with EXTI functionality. EXTI is not
built into Input
itself because it needs to take ownership of the corresponding
EXTI channel, which is a limited resource.
Pins PA5, PB5, PC5… all use EXTI channel 5, so you can’t use EXTI on, say, PA5 and PC5 at the same time.
Implementations§
source§impl<'d> ExtiInput<'d>
impl<'d> ExtiInput<'d>
sourcepub fn new<T: GpioPin>(
pin: impl Peripheral<P = T> + 'd,
ch: impl Peripheral<P = T::ExtiChannel> + 'd,
pull: Pull,
) -> Self
pub fn new<T: GpioPin>( pin: impl Peripheral<P = T> + 'd, ch: impl Peripheral<P = T::ExtiChannel> + 'd, pull: Pull, ) -> Self
Create an EXTI input.
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 low.
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.
If the pin is already high, it will wait for it to go low then back 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.
If the pin is already low, it will wait for it to go high then back low.
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).