pub struct OutputOpenDrain<'d> { /* private fields */ }
Expand description
GPIO output open-drain driver.
Note that pins will return to their floating state when OutputOpenDrain
is dropped.
If pins should retain their state indefinitely, either keep ownership of the
OutputOpenDrain
, or pass it to core::mem::forget
.
Implementations§
Source§impl<'d> OutputOpenDrain<'d>
impl<'d> OutputOpenDrain<'d>
Sourcepub fn is_set_high(&self) -> bool
pub fn is_set_high(&self) -> bool
Get whether the output level is set to high.
Sourcepub fn is_set_low(&self) -> bool
pub fn is_set_low(&self) -> bool
Get whether the output level is set to low.
Sourcepub fn get_output_level(&self) -> Level
pub fn get_output_level(&self) -> Level
Get the current output level.
Sourcepub fn set_inversion(&mut self, invert: bool)
pub fn set_inversion(&mut self, invert: bool)
Configure the logic inversion of this pin.
Logic inversion applies to the input path of this pin.
Sourcepub async fn wait_for_high(&mut self)
pub async fn wait_for_high(&mut self)
Wait until the pin is high. If it is already high, return immediately.
Sourcepub async fn wait_for_low(&mut self)
pub async fn wait_for_low(&mut self)
Wait until the pin is low. If it is already low, return immediately.
Sourcepub async fn wait_for_rising_edge(&mut self)
pub async fn wait_for_rising_edge(&mut self)
Wait for the pin to undergo a transition from low to high.
Sourcepub async fn wait_for_falling_edge(&mut self)
pub async fn wait_for_falling_edge(&mut self)
Wait for the pin to undergo a transition from high to low.
Sourcepub async fn wait_for_any_edge(&mut self)
pub async fn wait_for_any_edge(&mut self)
Wait for the pin to undergo any transition, i.e low to high OR high to low.