pub struct DynPin { /* private fields */ }
Expand description

A value-level pin, parameterized by DynPinId and DynPinMode

This type acts as a type-erased version of Pin. Every pin is represented by the same type, and pins are tracked and distinguished at run-time.

Implementations

Return a copy of the pin ID

Return a copy of the pin mode

Convert the pin to the requested DynPinMode

Disable the pin and set it to float

Disable the pin and set it to pull down

Disable the pin and set it to pull up

Configure the pin to operate as a floating input

Configure the pin to operate as a pulled down input

Configure the pin to operate as a pulled up input

Configure the pin to operate as a floating interrupt

Configure the pin to operate as a pulled down interrupt

Configure the pin to operate as a pulled up interrupt

Configure the pin to operate as a push-pull output

Configure the pin to operate as a readable push pull output

Configure the pin to operate as the corresponding peripheral function.

The config argument indicates the desired peripheral function.

Read the current drive strength of the pin.

The drive strength is reset to normal on every change in pin mode.

Set the drive strength for the pin.

The drive strength is reset to normal on every change in pin mode.

Trait Implementations

Erase the type-level information in a Pin and return a value-level DynPin

Error type
Is the input pin high?
Is the input pin low?
Error type
Drives the pin high Read more
Drives the pin low 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.

Try to recreate a type-level Pin from a value-level DynPin

There is no way for the compiler to know if the conversion will be successful at compile-time. We must verify the conversion at run-time or refuse to perform it.

The type returned in the event of a conversion error.

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.

Should always be Self
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.