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 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.
Auto Trait Implementations§
impl<'d> Freeze for OutputOpenDrain<'d>
impl<'d> RefUnwindSafe for OutputOpenDrain<'d>
impl<'d> Send for OutputOpenDrain<'d>
impl<'d> Sync for OutputOpenDrain<'d>
impl<'d> Unpin for OutputOpenDrain<'d>
impl<'d> !UnwindSafe for OutputOpenDrain<'d>
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