pub struct InputChannel<'d> { /* private fields */ }Expand description
GPIOTE channel driver in input mode
Implementations§
Source§impl InputChannel<'static>
impl InputChannel<'static>
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>
impl<'d> InputChannel<'d>
Sourcepub fn new<C: Channel, T: GpioPin>(
ch: Peri<'d, C>,
pin: Peri<'d, T>,
pull: Pull,
polarity: InputChannelPolarity,
) -> Self
pub fn new<C: Channel, T: GpioPin>( ch: Peri<'d, C>, pin: Peri<'d, T>, pull: Pull, polarity: InputChannelPolarity, ) -> Self
Create a new GPIOTE output channel driver.
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.