Struct stm32_hal2::gpio::Pin [−][src]
Expand description
Represents a single GPIO pin. Allows configuration, and reading/setting state.
Fields
port: Port
pin: u8
Implementations
Create a new pin, with a specific mode. Enables the RCC peripheral clock to the port, if not already enabled.
Set pin mode. Eg, Output, Input, Analog, or Alt. Sets the MODER
register.
Set output type. Sets the OTYPER
register.
Set output speed to Low, Medium, or High. Sets the OSPEEDR
register.
Set internal pull resistor: Pull up, pull down, or floating. Sets the PUPDR
register.
Lock or unlock a port configuration. Sets the LCKR
register.
Read the input data register. Eg determine if the pin is high or low. See also is_high()
and is_low()
. Reads from the IDR
register.
Set a pin state (ie set high or low output voltage level). See also set_high()
and
set_low()
. Sets the BSRR
register. Atomic.
Configure this pin as an interrupt source. Set the edge as Rising or Falling.
Check if the pin’s input voltage is high. Reads from the IDR
register.
Check if the pin’s input voltage is low. Reads from the IDR
register.
Set the pin’s output voltage to high. Sets the BSRR
register. Atomic.