Skip to main content

StatefulOutputPin

Trait StatefulOutputPin 

pub trait StatefulOutputPin: OutputPin {
    // Required methods
    fn is_set_high(&mut self) -> Result<bool, Self::Error>;
    fn is_set_low(&mut self) -> Result<bool, Self::Error>;

    // Provided method
    fn toggle(&mut self) -> Result<(), Self::Error> { ... }
}
Expand description

Push-pull output pin that can read its output state.

Required Methods§

fn is_set_high(&mut self) -> Result<bool, Self::Error>

Is the pin in drive high mode?

NOTE this does not read the electrical state of the pin.

fn is_set_low(&mut self) -> Result<bool, Self::Error>

Is the pin in drive low mode?

NOTE this does not read the electrical state of the pin.

Provided Methods§

fn toggle(&mut self) -> Result<(), Self::Error>

Toggle pin output.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl<T> StatefulOutputPin for &mut T

§

fn is_set_high(&mut self) -> Result<bool, <&mut T as ErrorType>::Error>

§

fn is_set_low(&mut self) -> Result<bool, <&mut T as ErrorType>::Error>

§

fn toggle(&mut self) -> Result<(), <&mut T as ErrorType>::Error>

Implementors§