pub struct OutputOpenDrain<'d, M: Mode = Blocking> { /* private fields */ }Expand description
GPIO output open-drain.
Implementations§
Source§impl<'d> OutputOpenDrain<'d, Blocking>
impl<'d> OutputOpenDrain<'d, Blocking>
Source§impl<'d> OutputOpenDrain<'d, Async>
impl<'d> OutputOpenDrain<'d, Async>
Sourcepub fn new_async<T: Pin>(
pin: Peri<'d, T>,
irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
initial_output: Level,
) -> Self
pub fn new_async<T: Pin>( pin: Peri<'d, T>, irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, initial_output: Level, ) -> Self
Create an async GPIO output driver for a Pin in open drain mode with the provided Level.
The pin’s interrupt must be bound to InterruptHandler for 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.
Source§impl<'d, M: Mode> OutputOpenDrain<'d, M>
impl<'d, M: Mode> OutputOpenDrain<'d, M>
Sourcepub fn set_pullup(&mut self, enable: bool)
pub fn set_pullup(&mut self, enable: bool)
Set the pin’s pull-up.
Sourcepub fn set_drive_strength(&mut self, strength: Drive)
pub fn set_drive_strength(&mut self, strength: Drive)
Set the pin’s drive strength.
Sourcepub fn set_slew_rate(&mut self, slew_rate: SlewRate)
pub fn set_slew_rate(&mut self, slew_rate: SlewRate)
Set the pin’s slew rate.
Sourcepub fn is_set_high(&self) -> bool
pub fn is_set_high(&self) -> bool
Is the output level high?
Sourcepub fn is_set_low(&self) -> bool
pub fn is_set_low(&self) -> bool
Is the output level low?
Sourcepub fn output_level(&self) -> Level
pub fn output_level(&self) -> Level
What level output is set to
Trait Implementations§
Source§impl<'d, M: Mode> Format for OutputOpenDrain<'d, M>
impl<'d, M: Mode> Format for OutputOpenDrain<'d, M>
Source§impl<'d, M: Mode> InputPin for OutputOpenDrain<'d, M>
impl<'d, M: Mode> InputPin for OutputOpenDrain<'d, M>
Source§impl<'d, M: Mode> InputPin for OutputOpenDrain<'d, M>
impl<'d, M: Mode> InputPin for OutputOpenDrain<'d, M>
Source§impl<'d, M: Mode> OutputPin for OutputOpenDrain<'d, M>
impl<'d, M: Mode> OutputPin for OutputOpenDrain<'d, M>
Source§impl<'d, M: Mode> OutputPin for OutputOpenDrain<'d, M>
impl<'d, M: Mode> OutputPin for OutputOpenDrain<'d, M>
Source§impl<'d, M: Mode> StatefulOutputPin for OutputOpenDrain<'d, M>
impl<'d, M: Mode> StatefulOutputPin for OutputOpenDrain<'d, M>
Source§impl<'d, M: Mode> StatefulOutputPin for OutputOpenDrain<'d, M>
impl<'d, M: Mode> StatefulOutputPin for OutputOpenDrain<'d, M>
Source§impl<'d, M: Mode> ToggleableOutputPin for OutputOpenDrain<'d, M>
impl<'d, M: Mode> ToggleableOutputPin for OutputOpenDrain<'d, M>
Source§impl<'d> Wait for OutputOpenDrain<'d, Async>
impl<'d> Wait for OutputOpenDrain<'d, Async>
Source§async fn wait_for_high(&mut self) -> Result<(), Self::Error>
async fn wait_for_high(&mut self) -> Result<(), Self::Error>
Wait until the pin is high. If it is already high, return immediately. Read more
Source§async fn wait_for_low(&mut self) -> Result<(), Self::Error>
async fn wait_for_low(&mut self) -> Result<(), Self::Error>
Wait until the pin is low. If it is already low, return immediately. Read more
Source§async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error>
async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error>
Wait for the pin to undergo a transition from low to high. Read more
Auto Trait Implementations§
impl<'d, M = Blocking> !UnwindSafe for OutputOpenDrain<'d, M>
impl<'d, M> Forget for OutputOpenDrain<'d, M>
impl<'d, M> Freeze for OutputOpenDrain<'d, M>
impl<'d, M> Move for OutputOpenDrain<'d, M>
impl<'d, M> RefUnwindSafe for OutputOpenDrain<'d, M>where
Flex<'d, M>: RefUnwindSafe,
impl<'d, M> Send for OutputOpenDrain<'d, M>
impl<'d, M> Sync for OutputOpenDrain<'d, M>
impl<'d, M> Unpin for OutputOpenDrain<'d, M>
impl<'d, M> UnsafeUnpin for OutputOpenDrain<'d, M>where
Flex<'d, M>: UnsafeUnpin,
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