Functions
Port Configuration
Peripheral Driver » LL Driver » GPIO » Functions

## Functions
__STATIC_INLINE void | ll_gpio_set_pin_mode (gpio_regs_t *GPIOx, uint32_t pin_mask, uint32_t mode)
| Set several pins to input/output mode on dedicated port. More...
__STATIC_INLINE uint32_t | ll_gpio_get_pin_mode (gpio_regs_t *GPIOx, uint32_t pin)
| Return gpio mode for a dedicated pin on dedicated port. More...
__STATIC_INLINE void | ll_gpio_set_pin_input_type (gpio_regs_t *GPIOx, uint32_t pin_mask, uint32_t type)
| Set several pins input type on dedicated port. More...
__STATIC_INLINE uint32_t | ll_gpio_get_pin_input_type (gpio_regs_t *GPIOx, uint32_t pin)
| Return gpio input type for a dedicated pin on dedicated port. More...
__STATIC_INLINE void | ll_gpio_set_pin_pull (gpio_regs_t *GPIOx, uint32_t pin_mask, uint32_t pull)
| Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port. More...
__STATIC_INLINE uint32_t | ll_gpio_get_pin_pull (gpio_regs_t *GPIOx, uint32_t pin)
| Return gpio pull-up or pull-down for a dedicated pin on a dedicated port. More...
__STATIC_INLINE void | ll_gpio_set_pin_mux (gpio_regs_t *GPIOx, uint32_t pin, uint32_t mux)
| Configure gpio pinmux number of a dedicated pin from 0 to 15 for a dedicated port. More...
__STATIC_INLINE uint32_t | ll_gpio_get_pin_mux (gpio_regs_t *GPIOx, uint32_t pin)
| Return gpio alternate function of a dedicated pin from 0 to 15 for a dedicated port. More...
__STATIC_INLINE void | ll_gpio_set_pin_speed (gpio_regs_t *GPIOx, uint32_t pin_mask, uint32_t speed)
| Configure gpio speed for a dedicated pin on a dedicated port. More...
__STATIC_INLINE uint32_t | ll_gpio_get_pin_speed (gpio_regs_t *GPIOx, uint32_t pin_mask)
| Return gpio speed for a dedicated pin on a dedicated port. More...
__STATIC_INLINE void | ll_gpio_set_pin_strength (gpio_regs_t *GPIOx, uint32_t pin_mask, uint32_t strength)
| Configure gpio output drive strength for a dedicated pin on a dedicated port. More...
__STATIC_INLINE uint32_t | ll_gpio_get_pin_strength (gpio_regs_t *GPIOx, uint32_t pin_mask)
| Return gpio output drive strength for a dedicated pin on a dedicated port. More...

## Detailed Description

## Function Documentation

## ◆ ll_gpio_get_pin_input_type()

__STATIC_INLINE uint32_t ll_gpio_get_pin_input_type | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin
| ) |  |

Return gpio input type for a dedicated pin on dedicated port.

Note
  I/O mode can be Input mode, General purpose output.
  Warning: only one pin can be passed as parameter.

Register|BitsName --------|-------- OUTENSET | OUTENSET

Parameters

  GPIOx | GPIO Port
  pin | This parameter can be one of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13

Return values

  Returned | value can be one of the following values: LL_GPIO_INPUT_TYPE_CMOS LL_GPIO_INPUT_TYPE_SCHMITT

Definition at line 513 of file ll_gpio.h.

References LL_GPIO_INPUT_TYPE_CMOS, and LL_GPIO_INPUT_TYPE_SCHMITT.

## ◆ ll_gpio_get_pin_mode()

__STATIC_INLINE uint32_t ll_gpio_get_pin_mode | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin
| ) |  |

Return gpio mode for a dedicated pin on dedicated port.

Note
  I/O mode can be Input mode, General purpose output.
  Warning: only one pin can be passed as parameter.

Register|BitsName --------|-------- OUTENSET | OUTENSET

Parameters

  GPIOx | GPIO Port
  pin | This parameter can be one of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13

Return values

  Returned | value can be one of the following values: LL_GPIO_MODE_NONE LL_GPIO_MODE_INPUT LL_GPIO_MODE_OUTPUT LL_GPIO_MODE_INOUT

Definition at line 438 of file ll_gpio.h.

References LL_GPIO_MODE_INPUT_POS, and LL_GPIO_MODE_OUTPUT_POS.

## ◆ ll_gpio_get_pin_mux()

__STATIC_INLINE uint32_t ll_gpio_get_pin_mux | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin
| ) |  |

Return gpio alternate function of a dedicated pin from 0 to 15 for a dedicated port.

Note
  Possible values are from AF0 to AF15 depending on target.

Register|BitsName --------|-------- DPAD_MUX | DPAD_MUX

Parameters

  GPIOx | GPIO Port
  pin | This parameter can be one of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13

Return values

  Returned | value can be one of the following values: IO_MUX_GPIO define

Definition at line 668 of file ll_gpio.h.

## ◆ ll_gpio_get_pin_pull()

__STATIC_INLINE uint32_t ll_gpio_get_pin_pull | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin
| ) |  |

Return gpio pull-up or pull-down for a dedicated pin on a dedicated port.

Note
  Warning: only one pin can be passed as parameter.

Register|BitsName --------|-------- DPAD_PE_BUS | PE DPAD_PS_BUS | PS

Parameters

  GPIOx | GPIO Port
  pin | This parameter can be one of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13

Return values

  Returned | value can be one of the following values: LL_GPIO_PULL_NO LL_GPIO_PULL_UP LL_GPIO_PULL_DOWN

Definition at line 586 of file ll_gpio.h.

References LL_GPIO_PULL_DOWN, LL_GPIO_PULL_NO, and LL_GPIO_PULL_UP.

## ◆ ll_gpio_get_pin_speed()

__STATIC_INLINE uint32_t ll_gpio_get_pin_speed | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin_mask
| ) |  |

Return gpio speed for a dedicated pin on a dedicated port.

Note
  Warning: only one pin can be passed as parameter.

Register|BitsName --------|-------- MCU_PAD | DPAD_SR_BUS MCU_PAD | DPAD_SR_BUS

Parameters

  GPIOx | GPIO Port
  pin_mask | This parameter can be one of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13

Return values

  Returned | value can be one of the following values: LL_GPIO_SPEED_MEDIUM LL_GPIO_SPEED_HIGH

Definition at line 758 of file ll_gpio.h.

## ◆ ll_gpio_get_pin_strength()

__STATIC_INLINE uint32_t ll_gpio_get_pin_strength | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin_mask
| ) |  |

Return gpio output drive strength for a dedicated pin on a dedicated port.

Note
  Warning: only one pin can be passed as parameter.

Register|BitsName --------|-------- MCU_PAD | DPAD_DS0_BUS MCU_PAD | DPAD_DS1_BUS

Parameters

  GPIOx | GPIO Port
  pin_mask | This parameter can be one of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13

Return values

  Returned | value can be one of the following values: LL_GPIO_STRENGTH_LOW LL_GPIO_STRENGTH_MEDIUM LL_GPIO_STRENGTH_HIGH LL_GPIO_STRENGTH_ULTRA

Definition at line 849 of file ll_gpio.h.

References LL_GPIO_STRENGTH_DS0_POS, and LL_GPIO_STRENGTH_DS1_POS.

## ◆ ll_gpio_set_pin_input_type()

__STATIC_INLINE void ll_gpio_set_pin_input_type | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin_mask,
|  | uint32_t | type
| ) |  |

Set several pins input type on dedicated port.

Register|BitsName --------|-------- OUTENSET | OUTENSET OUTENCLR | OUTENCLR

Parameters

  GPIOx | GPIO Port
  pin_mask | This parameter can be a combination of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13 LL_GPIO_PIN_ALL
  type | This parameter can be one of the following values: LL_GPIO_INPUT_TYPE_CMOS LL_GPIO_INPUT_TYPE_SCHMITT

Return values

  None |

Definition at line 478 of file ll_gpio.h.

References LL_GPIO_INPUT_TYPE_SCHMITT.

## ◆ ll_gpio_set_pin_mode()

__STATIC_INLINE void ll_gpio_set_pin_mode | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin_mask,
|  | uint32_t | mode
| ) |  |

Set several pins to input/output mode on dedicated port.

Register|BitsName --------|-------- OUTENSET | OUTENSET OUTENCLR | OUTENCLR

Parameters

  GPIOx | GPIO Port
  pin_mask | This parameter can be a combination of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13 LL_GPIO_PIN_ALL
  mode | This parameter can be one of the following values: LL_GPIO_MODE_NONE LL_GPIO_MODE_INPUT LL_GPIO_MODE_OUTPUT LL_GPIO_MODE_INOUT

Return values

  None |

Definition at line 396 of file ll_gpio.h.

References LL_GPIO_MODE_INOUT, LL_GPIO_MODE_INPUT, and LL_GPIO_MODE_OUTPUT.

## ◆ ll_gpio_set_pin_mux()

__STATIC_INLINE void ll_gpio_set_pin_mux | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin,
|  | uint32_t | mux
| ) |  |

Configure gpio pinmux number of a dedicated pin from 0 to 15 for a dedicated port.

Note
  Possible values are from AF0 to AF15 depending on target.
  Warning: only one pin can be passed as parameter.

Register|BitsName --------|-------- DPAD_MUX | DPAD_MUX

Parameters

  GPIOx | GPIO Port
  pin | This parameter can be one of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13
  mux | This parameter can be one of the following values: IO_MUX_GPIO define

Return values

  None |

Definition at line 621 of file ll_gpio.h.

## ◆ ll_gpio_set_pin_pull()

__STATIC_INLINE void ll_gpio_set_pin_pull | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin_mask,
|  | uint32_t | pull
| ) |  |

Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port.

Register|BitsName --------|-------- DPAD_PE_BUS | PE DPAD_PS_BUS | PS

Parameters

  GPIOx | GPIO Port
  pin_mask | This parameter can be a combination of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13
  pull | This parameter can be one of the following values: LL_GPIO_PULL_NO LL_GPIO_PULL_UP LL_GPIO_PULL_DOWN

Return values

  None |

Definition at line 550 of file ll_gpio.h.

References LL_GPIO_PULL_NO, and LL_GPIO_PULL_UP.

## ◆ ll_gpio_set_pin_speed()

__STATIC_INLINE void ll_gpio_set_pin_speed | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin_mask,
|  | uint32_t | speed
| ) |  |

Configure gpio speed for a dedicated pin on a dedicated port.

Register|BitsName --------|-------- MCU_PAD | DPAD_SR_BUS MCU_PAD | DPAD_SR_BUS

Parameters

  GPIOx | GPIO Port
  pin_mask | This parameter can be a combination of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13
  speed | This parameter can be one of the following values: LL_GPIO_SPEED_MEDIUM LL_GPIO_SPEED_HIGH

Return values

  None |

Definition at line 717 of file ll_gpio.h.

## ◆ ll_gpio_set_pin_strength()

__STATIC_INLINE void ll_gpio_set_pin_strength | ( | gpio_regs_t * | GPIOx,
|  | uint32_t | pin_mask,
|  | uint32_t | strength
| ) |  |

Configure gpio output drive strength for a dedicated pin on a dedicated port.

Register|BitsName --------|-------- MCU_PAD | DPAD_DS0_BUS MCU_PAD | DPAD_DS1_BUS

Parameters

  GPIOx | GPIO Port
  pin_mask | This parameter can be a combination of the following values: LL_GPIO_PIN_0 LL_GPIO_PIN_1 LL_GPIO_PIN_2 LL_GPIO_PIN_3 LL_GPIO_PIN_4 LL_GPIO_PIN_5 LL_GPIO_PIN_6 LL_GPIO_PIN_7 LL_GPIO_PIN_8 LL_GPIO_PIN_9 LL_GPIO_PIN_10 LL_GPIO_PIN_11 LL_GPIO_PIN_12 LL_GPIO_PIN_13
  strength | This parameter can be one of the following values: LL_GPIO_STRENGTH_LOW LL_GPIO_STRENGTH_MEDIUM LL_GPIO_STRENGTH_HIGH LL_GPIO_STRENGTH_ULTRA

Return values

  None |

Definition at line 796 of file ll_gpio.h.

References LL_GPIO_STRENGTH_DS0_MASK, LL_GPIO_STRENGTH_DS0_POS, LL_GPIO_STRENGTH_DS1_MASK, and LL_GPIO_STRENGTH_DS1_POS.