pub struct InputChannel<'d, M: Mode = Blocking> { /* private fields */ }Expand description
GPIOTE channel driver in input mode
Implementations§
Source§impl<M: Mode> InputChannel<'static, M>
impl<M: Mode> InputChannel<'static, M>
Sourcepub fn persist(self)
pub fn persist(self)
Persist the channel’s configuration for the rest of the program’s lifetime. This method
should be preferred over core::mem::forget() because the 'static bound prevents
accidental reuse of the underlying peripheral.
Source§impl<'d> InputChannel<'d, Blocking>
impl<'d> InputChannel<'d, Blocking>
Source§impl<'d> InputChannel<'d, Async>
impl<'d> InputChannel<'d, Async>
Sourcepub fn new_async<C: Channel, T: GpioPin>(
ch: Peri<'d, C>,
pin: Peri<'d, T>,
_irq: impl Binding<C::Interrupt, InterruptHandler<C>> + 'd,
pull: Pull,
polarity: InputChannelPolarity,
) -> Self
pub fn new_async<C: Channel, T: GpioPin>( ch: Peri<'d, C>, pin: Peri<'d, T>, _irq: impl Binding<C::Interrupt, InterruptHandler<C>> + 'd, pull: Pull, polarity: InputChannelPolarity, ) -> Self
Create a new async GPIOTE input channel driver.
The channel’s GPIOTE interrupt must be bound to InterruptHandler for this channel.
Sourcepub fn wait(&mut self) -> impl Future<Output = ()>
pub fn wait(&mut self) -> impl Future<Output = ()>
Asynchronously wait for an event in this channel.
It is possible to call this function and await the returned future later. If an even occurs in the mean time, the future will immediately report ready.
Sourcepub fn wait_for_high(&mut self) -> impl Future<Output = ()>
pub fn wait_for_high(&mut self) -> impl Future<Output = ()>
Asynchronously wait for the pin to become high.
The channel must be configured with InputChannelPolarity::LoToHi or InputChannelPolarity::Toggle.
If the channel is not configured to detect rising edges, it is unspecified when the returned future completes.
It is possible to call this function and await the returned future later. If an even occurs in the mean time, the future will immediately report ready.
Sourcepub fn wait_for_low(&mut self) -> impl Future<Output = ()>
pub fn wait_for_low(&mut self) -> impl Future<Output = ()>
Asynchronously wait for the pin to become low.
The channel must be configured with InputChannelPolarity::HiToLo or InputChannelPolarity::Toggle.
If the channel is not configured to detect falling edges, it is unspecified when the returned future completes.
It is possible to call this function and await the returned future later. If an even occurs in the mean time, the future will immediately report ready.