pub struct DynPin { /* fields omitted */ }
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

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

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

Performs the conversion.

Performs the conversion.

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.