Struct stm32f4xx_hal::gpio::Pin[][src]

pub struct Pin<MODE, const P: char, const N: u8> { /* fields omitted */ }
Expand description

Generic pin type

  • MODE is one of the pin modes (see Modes section).
  • P is port name: A for GPIOA, B for GPIOB, etc.
  • N is pin number: from 0 to 15.

Implementations

Configures the pin to operate alternate mode

Configures the pin to operate in alternate open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF0 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF1 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF2 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF3 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF4 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF5 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF6 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF7 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF8 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF9 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF10 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF11 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF12 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF13 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF14 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF15 mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF0 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF1 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF2 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF3 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF4 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF5 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF6 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF7 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF8 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF9 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF10 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF11 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF12 open drain mode

Configures the pin to operate in AF13 open drain modev

👎 Deprecated since 0.10.0

Configures the pin to operate in AF14 open drain mode

👎 Deprecated since 0.10.0

Configures the pin to operate in AF15 open drain mode

Configures the pin to operate as a floating input pin

Configures the pin to operate as a pulled down input pin

Configures the pin to operate as a pulled up input pin

Configures the pin to operate as an open drain output pin Initial state will be low.

Configures the pin to operate as an open-drain output pin. initial_state specifies whether the pin should be initially high or low.

Configures the pin to operate as an push pull output pin Initial state will be low.

Configures the pin to operate as an push-pull output pin. initial_state specifies whether the pin should be initially high or low.

Configures the pin to operate as an analog input pin

Temporarily configures this pin as a floating input.

The closure f is called with the reconfigured pin. After it returns, the pin will be configured back.

Temporarily configures this pin as a pulled-down input.

The closure f is called with the reconfigured pin. After it returns, the pin will be configured back.

Temporarily configures this pin as a pulled-up input.

The closure f is called with the reconfigured pin. After it returns, the pin will be configured back.

Temporarily configures this pin as an analog pin.

The closure f is called with the reconfigured pin. After it returns, the pin will be configured back.

Temporarily configures this pin as an open drain output.

The closure f is called with the reconfigured pin. After it returns, the pin will be configured back. The value of the pin after conversion is undefined. If you want to control it, use with_open_drain_output_in_state

Temporarily configures this pin as an open drain output .

The closure f is called with the reconfigured pin. After it returns, the pin will be configured back. Note that the new state is set slightly before conversion happens. This can cause a short output glitch if switching between output modes

Temporarily configures this pin as a push-pull output.

The closure f is called with the reconfigured pin. After it returns, the pin will be configured back. The value of the pin after conversion is undefined. If you want to control it, use with_push_pull_output_in_state

Temporarily configures this pin as a push-pull output.

The closure f is called with the reconfigured pin. After it returns, the pin will be configured back. Note that the new state is set slightly before conversion happens. This can cause a short output glitch if switching between output modes

Set pin speed

Enables / disables the internal pull up

Set pin speed

Enables / disables the internal pull up

Turns pin alternate configuration pin into open drain

Erases the pin number from the type

This is useful when you want to collect the pins into an array where you need all the elements to have the same type

👎 Deprecated since 0.10.0:

Please use erase_number instead

Erases the pin number and the port from the type

This is useful when you want to collect the pins into an array where you need all the elements to have the same type

👎 Deprecated since 0.10.0:

Please use erase instead

Trait Implementations

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Error type

Is the input pin high?

Is the input pin low?

Error type

Is the input pin high?

Is the input pin low?

Error type.

Tries to convert this pin to input mode. Read more

Tries to convert this pin to output mode with the given initial state. Read more

Error type.

Tries to convert this pin to input mode. Read more

Tries to convert this pin to output mode with the given initial state. Read more

Error type.

Tries to convert this pin to input mode. Read more

Tries to convert this pin to output mode with the given initial state. Read more

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

Return pin number

Return port number

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

Performs the conversion.

Performs the conversion.

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.