Enum stm32_hal2::gpio::PinMode

source ·
#[repr(u8)]
pub enum PinMode {
    Input,
    Output,
    Alt(u8),
    Analog,
}
Expand description

Values for GPIOx_MODER. Sets pin to input, output, and other functionality.

Variants

Input

An input pin; read by firmware; set by something connected to the pin.

Output

An input pin; set by firmware; read by something connected to the pin.

Alt(u8)

An alternate function, as defined in the MCU’s user manual. Used for various onboard peripherals like buses, timers etc.

Analog

For use with the onboard ADC and DAC. Prevent parasitic power loss on the pin

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

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.