pub struct Pin<'a, MODE, MUTEX> { /* private fields */ }
Expand description

Representation of a port-expander pin.

Pin is not constructed directly, this type is created by instanciating a port-expander and then getting access to all its pins using the .split() method.

Implementations

Configure this pin as an input.

The exact electrical details depend on the port-expander device which is used.

Configure this pin as an output with an initial LOW state.

The LOW state is, as long as he port-expander chip allows this, entered without any electrical glitch.

Configure this pin as an output with an initial HIGH state.

The HIGH state is, as long as he port-expander chip allows this, entered without any electrical glitch.

Turn on hardware polarity inversion for this pin.

Set hardware polarity inversion for this pin.

Read the pin’s input state and return true if it is HIGH.

Read the pin’s input state and return true if it is LOW.

Set the pin’s output state to HIGH.

Note that this can have different electrical meanings depending on the port-expander chip.

Set the pin’s output state to LOW.

Note that this can have different electrical meanings depending on the port-expander chip.

Return true if the pin’s output state is HIGH.

This method does not read the pin’s electrical state.

Return true if the pin’s output state is LOW.

This method does not read the pin’s electrical state.

Toggle the pin’s output state.

Trait Implementations

Error type

Is the input pin high?

Is the input pin low?

Error type

Drives the pin low Read more

Drives the pin high Read more

Drives the pin high or low depending on the provided value Read more

Is the pin in drive high mode? Read more

Is the pin in drive low mode? Read more

Error type

Toggle pin output.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.