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 new(
pin: impl Peripheral<P = impl Pin> + 'd,
initial_output: Level,
speed: Speed,
) -> Self
pub fn new( pin: impl Peripheral<P = impl Pin> + 'd, initial_output: Level, speed: Speed, ) -> Self
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.
Trait Implementations§
source§impl<'d> ErrorType for OutputOpenDrain<'d>
impl<'d> ErrorType for OutputOpenDrain<'d>
source§type Error = Infallible
type Error = Infallible
Error type
source§impl<'d> InputPin for OutputOpenDrain<'d>
impl<'d> InputPin for OutputOpenDrain<'d>
source§impl<'d> InputPin for OutputOpenDrain<'d>
impl<'d> InputPin for OutputOpenDrain<'d>
source§impl<'d> OutputPin for OutputOpenDrain<'d>
impl<'d> OutputPin for OutputOpenDrain<'d>
source§type Error = Infallible
type Error = Infallible
Error type
source§impl<'d> OutputPin for OutputOpenDrain<'d>
impl<'d> OutputPin for OutputOpenDrain<'d>
source§impl<'d> StatefulOutputPin for OutputOpenDrain<'d>
impl<'d> StatefulOutputPin for OutputOpenDrain<'d>
source§impl<'d> StatefulOutputPin for OutputOpenDrain<'d>
impl<'d> StatefulOutputPin for OutputOpenDrain<'d>
source§impl<'d> ToggleableOutputPin for OutputOpenDrain<'d>
impl<'d> ToggleableOutputPin for OutputOpenDrain<'d>
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