STM32L4xx_HAL_Driver  1.14.0

Functions

__STATIC_INLINE void LL_GPIO_SetPinMode (GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
 Configure gpio mode for a dedicated pin on dedicated port. More...
 
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio mode for a dedicated pin on dedicated port. More...
 
__STATIC_INLINE void LL_GPIO_SetPinOutputType (GPIO_TypeDef *GPIOx, uint32_t PinMask, uint32_t OutputType)
 Configure gpio output type for several pins on dedicated port. More...
 
__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio output type for several pins on dedicated port. More...
 
__STATIC_INLINE void LL_GPIO_SetPinSpeed (GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed)
 Configure gpio speed for a dedicated pin on dedicated port. More...
 
__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio speed for a dedicated pin on dedicated port. More...
 
__STATIC_INLINE void LL_GPIO_SetPinPull (GPIO_TypeDef *GPIOx, uint32_t Pin, 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_GetPinPull (GPIO_TypeDef *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_SetAFPin_0_7 (GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
 Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port. More...
 
__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_0_7 (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port. AFRL AFSELy LL_GPIO_GetAFPin_0_7. More...
 
__STATIC_INLINE void LL_GPIO_SetAFPin_8_15 (GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
 Configure gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port. More...
 
__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_8_15 (GPIO_TypeDef *GPIOx, uint32_t Pin)
 Return gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port. More...
 
__STATIC_INLINE void LL_GPIO_EnablePinAnalogControl (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Connect analog switch to ADC input of several pins for a dedicated port. More...
 
__STATIC_INLINE void LL_GPIO_DisablePinAnalogControl (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Disconnect analog switch to ADC input of several pins for a dedicated port. ASCR ASCy LL_GPIO_DisablePinAnalogControl. More...
 
__STATIC_INLINE void LL_GPIO_LockPin (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Lock configuration of several pins for a dedicated port. More...
 
__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked (GPIO_TypeDef *GPIOx, uint32_t PinMask)
 Return 1 if all pins passed as parameter, of a dedicated port, are locked. else Return 0. LCKR LCKy LL_GPIO_IsPinLocked. More...
 
__STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked (GPIO_TypeDef *GPIOx)
 Return 1 if one of the pin of a dedicated port is locked. else return 0. LCKR LCKK LL_GPIO_IsAnyPinLocked. More...
 

Detailed Description

Function Documentation

◆ LL_GPIO_DisablePinAnalogControl()

__STATIC_INLINE void LL_GPIO_DisablePinAnalogControl ( GPIO_TypeDef *  GPIOx,
uint32_t  PinMask 
)

Disconnect analog switch to ADC input of several pins for a dedicated port. ASCR ASCy LL_GPIO_DisablePinAnalogControl.

Parameters
GPIOxGPIO Port
PinMaskThis 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_14
  • LL_GPIO_PIN_15
  • LL_GPIO_PIN_ALL
Return values
None

Definition at line 747 of file stm32l4xx_ll_gpio.h.

748 {
749  CLEAR_BIT(GPIOx->ASCR, PinMask);
750 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_GPIO_EnablePinAnalogControl()

__STATIC_INLINE void LL_GPIO_EnablePinAnalogControl ( GPIO_TypeDef *  GPIOx,
uint32_t  PinMask 
)

Connect analog switch to ADC input of several pins for a dedicated port.

Note
This bit must be set prior to the ADC conversion. Only the IO which connected to the ADC input are effective. Other IO must be kept reset value ASCR ASCy LL_GPIO_EnablePinAnalogControl
Parameters
GPIOxGPIO Port
PinMaskThis 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_14
  • LL_GPIO_PIN_15
  • LL_GPIO_PIN_ALL
Return values
None

Definition at line 718 of file stm32l4xx_ll_gpio.h.

719 {
720  SET_BIT(GPIOx->ASCR, PinMask);
721 }

◆ LL_GPIO_GetAFPin_0_7()

__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_0_7 ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin 
)

Return gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port. AFRL AFSELy LL_GPIO_GetAFPin_0_7.

Parameters
GPIOxGPIO Port
PinThis 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
Return values
Returnedvalue can be one of the following values:
  • LL_GPIO_AF_0
  • LL_GPIO_AF_1
  • LL_GPIO_AF_2
  • LL_GPIO_AF_3
  • LL_GPIO_AF_4
  • LL_GPIO_AF_5
  • LL_GPIO_AF_6
  • LL_GPIO_AF_7
  • LL_GPIO_AF_8
  • LL_GPIO_AF_9
  • LL_GPIO_AF_10
  • LL_GPIO_AF_11
  • LL_GPIO_AF_12
  • LL_GPIO_AF_13
  • LL_GPIO_AF_14
  • LL_GPIO_AF_15

Definition at line 606 of file stm32l4xx_ll_gpio.h.

607 {
608  return (uint32_t)(READ_BIT(GPIOx->AFR[0],
609  (GPIO_AFRL_AFSEL0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
610 }

◆ LL_GPIO_GetAFPin_8_15()

__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_8_15 ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin 
)

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

Note
Possible values are from AF0 to AF15 depending on target. AFRH AFSELy LL_GPIO_GetAFPin_8_15
Parameters
GPIOxGPIO Port
PinThis parameter can be one of the following values:
  • 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_14
  • LL_GPIO_PIN_15
Return values
Returnedvalue can be one of the following values:
  • LL_GPIO_AF_0
  • LL_GPIO_AF_1
  • LL_GPIO_AF_2
  • LL_GPIO_AF_3
  • LL_GPIO_AF_4
  • LL_GPIO_AF_5
  • LL_GPIO_AF_6
  • LL_GPIO_AF_7
  • LL_GPIO_AF_8
  • LL_GPIO_AF_9
  • LL_GPIO_AF_10
  • LL_GPIO_AF_11
  • LL_GPIO_AF_12
  • LL_GPIO_AF_13
  • LL_GPIO_AF_14
  • LL_GPIO_AF_15

Definition at line 684 of file stm32l4xx_ll_gpio.h.

685 {
686  return (uint32_t)(READ_BIT(GPIOx->AFR[1],
687  (GPIO_AFRH_AFSEL8 << (POSITION_VAL(Pin >> 8U) * 4U))) >> (POSITION_VAL(Pin >> 8U) * 4U));
688 }

◆ LL_GPIO_GetPinMode()

__STATIC_INLINE uint32_t LL_GPIO_GetPinMode ( GPIO_TypeDef *  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, Alternate function mode or Analog.
Warning: only one pin can be passed as parameter. MODER MODEy LL_GPIO_GetPinMode
Parameters
GPIOxGPIO Port
PinThis 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
  • LL_GPIO_PIN_14
  • LL_GPIO_PIN_15
Return values
Returnedvalue can be one of the following values:
  • LL_GPIO_MODE_INPUT
  • LL_GPIO_MODE_OUTPUT
  • LL_GPIO_MODE_ALTERNATE
  • LL_GPIO_MODE_ANALOG

Definition at line 320 of file stm32l4xx_ll_gpio.h.

321 {
322  return (uint32_t)(READ_BIT(GPIOx->MODER,
323  (GPIO_MODER_MODE0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
324 }

◆ LL_GPIO_GetPinOutputType()

__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin 
)

Return gpio output type for several pins on dedicated port.

Note
Output type as to be set when gpio pin is in output or alternate modes. Possible type are Push-pull or Open-drain.
Warning: only one pin can be passed as parameter. OTYPER OTy LL_GPIO_GetPinOutputType
Parameters
GPIOxGPIO Port
PinThis 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
  • LL_GPIO_PIN_14
  • LL_GPIO_PIN_15
  • LL_GPIO_PIN_ALL
Return values
Returnedvalue can be one of the following values:
  • LL_GPIO_OUTPUT_PUSHPULL
  • LL_GPIO_OUTPUT_OPENDRAIN

Definition at line 389 of file stm32l4xx_ll_gpio.h.

390 {
391  return (uint32_t)(READ_BIT(GPIOx->OTYPER, Pin) >> POSITION_VAL(Pin));
392 }

◆ LL_GPIO_GetPinPull()

__STATIC_INLINE uint32_t LL_GPIO_GetPinPull ( GPIO_TypeDef *  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. PUPDR PUPDy LL_GPIO_GetPinPull
Parameters
GPIOxGPIO Port
PinThis 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
  • LL_GPIO_PIN_14
  • LL_GPIO_PIN_15
Return values
Returnedvalue can be one of the following values:
  • LL_GPIO_PULL_NO
  • LL_GPIO_PULL_UP
  • LL_GPIO_PULL_DOWN

Definition at line 529 of file stm32l4xx_ll_gpio.h.

530 {
531  return (uint32_t)(READ_BIT(GPIOx->PUPDR,
532  (GPIO_PUPDR_PUPD0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
533 }

◆ LL_GPIO_GetPinSpeed()

__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin 
)

Return gpio speed for a dedicated pin on dedicated port.

Note
I/O speed can be Low, Medium, Fast or High speed.
Warning: only one pin can be passed as parameter.
Refer to datasheet for frequency specifications and the power supply and load conditions for each speed. OSPEEDR OSPEEDy LL_GPIO_GetPinSpeed
Parameters
GPIOxGPIO Port
PinThis 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
  • LL_GPIO_PIN_14
  • LL_GPIO_PIN_15
Return values
Returnedvalue can be one of the following values:
  • LL_GPIO_SPEED_FREQ_LOW
  • LL_GPIO_SPEED_FREQ_MEDIUM
  • LL_GPIO_SPEED_FREQ_HIGH
  • LL_GPIO_SPEED_FREQ_VERY_HIGH

Definition at line 463 of file stm32l4xx_ll_gpio.h.

464 {
465  return (uint32_t)(READ_BIT(GPIOx->OSPEEDR,
466  (GPIO_OSPEEDR_OSPEED0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
467 }

◆ LL_GPIO_IsAnyPinLocked()

__STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked ( GPIO_TypeDef *  GPIOx)

Return 1 if one of the pin of a dedicated port is locked. else return 0. LCKR LCKK LL_GPIO_IsAnyPinLocked.

Parameters
GPIOxGPIO Port
Return values
Stateof bit (1 or 0).

Definition at line 828 of file stm32l4xx_ll_gpio.h.

829 {
830  return ((READ_BIT(GPIOx->LCKR, GPIO_LCKR_LCKK) == (GPIO_LCKR_LCKK)) ? 1UL : 0UL);
831 }

◆ LL_GPIO_IsPinLocked()

__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked ( GPIO_TypeDef *  GPIOx,
uint32_t  PinMask 
)

Return 1 if all pins passed as parameter, of a dedicated port, are locked. else Return 0. LCKR LCKy LL_GPIO_IsPinLocked.

Parameters
GPIOxGPIO Port
PinMaskThis 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_14
  • LL_GPIO_PIN_15
  • LL_GPIO_PIN_ALL
Return values
Stateof bit (1 or 0).

Definition at line 817 of file stm32l4xx_ll_gpio.h.

818 {
819  return ((READ_BIT(GPIOx->LCKR, PinMask) == (PinMask)) ? 1UL : 0UL);
820 }

◆ LL_GPIO_LockPin()

__STATIC_INLINE void LL_GPIO_LockPin ( GPIO_TypeDef *  GPIOx,
uint32_t  PinMask 
)

Lock configuration of several pins for a dedicated port.

Note
When the lock sequence has been applied on a port bit, the value of this port bit can no longer be modified until the next reset.
Each lock bit freezes a specific configuration register (control and alternate function registers). LCKR LCKK LL_GPIO_LockPin
Parameters
GPIOxGPIO Port
PinMaskThis 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_14
  • LL_GPIO_PIN_15
  • LL_GPIO_PIN_ALL
Return values
None

Definition at line 782 of file stm32l4xx_ll_gpio.h.

783 {
784  __IO uint32_t temp;
785  WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask);
786  WRITE_REG(GPIOx->LCKR, PinMask);
787  WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask);
788  /* Read LCKK register. This read is mandatory to complete key lock sequence */
789  temp = READ_REG(GPIOx->LCKR);
790  (void) temp;
791 }

◆ LL_GPIO_SetAFPin_0_7()

__STATIC_INLINE void LL_GPIO_SetAFPin_0_7 ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin,
uint32_t  Alternate 
)

Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port.

Note
Possible values are from AF0 to AF15 depending on target.
Warning: only one pin can be passed as parameter. AFRL AFSELy LL_GPIO_SetAFPin_0_7
Parameters
GPIOxGPIO Port
PinThis 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
AlternateThis parameter can be one of the following values:
  • LL_GPIO_AF_0
  • LL_GPIO_AF_1
  • LL_GPIO_AF_2
  • LL_GPIO_AF_3
  • LL_GPIO_AF_4
  • LL_GPIO_AF_5
  • LL_GPIO_AF_6
  • LL_GPIO_AF_7
  • LL_GPIO_AF_8
  • LL_GPIO_AF_9
  • LL_GPIO_AF_10
  • LL_GPIO_AF_11
  • LL_GPIO_AF_12
  • LL_GPIO_AF_13
  • LL_GPIO_AF_14
  • LL_GPIO_AF_15
Return values
None

Definition at line 569 of file stm32l4xx_ll_gpio.h.

570 {
571  MODIFY_REG(GPIOx->AFR[0], (GPIO_AFRL_AFSEL0 << (POSITION_VAL(Pin) * 4U)),
572  (Alternate << (POSITION_VAL(Pin) * 4U)));
573 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_GPIO_SetAFPin_8_15()

__STATIC_INLINE void LL_GPIO_SetAFPin_8_15 ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin,
uint32_t  Alternate 
)

Configure gpio alternate function of a dedicated pin from 8 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. AFRH AFSELy LL_GPIO_SetAFPin_8_15
Parameters
GPIOxGPIO Port
PinThis parameter can be one of the following values:
  • 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_14
  • LL_GPIO_PIN_15
AlternateThis parameter can be one of the following values:
  • LL_GPIO_AF_0
  • LL_GPIO_AF_1
  • LL_GPIO_AF_2
  • LL_GPIO_AF_3
  • LL_GPIO_AF_4
  • LL_GPIO_AF_5
  • LL_GPIO_AF_6
  • LL_GPIO_AF_7
  • LL_GPIO_AF_8
  • LL_GPIO_AF_9
  • LL_GPIO_AF_10
  • LL_GPIO_AF_11
  • LL_GPIO_AF_12
  • LL_GPIO_AF_13
  • LL_GPIO_AF_14
  • LL_GPIO_AF_15
Return values
None

Definition at line 646 of file stm32l4xx_ll_gpio.h.

647 {
648  MODIFY_REG(GPIOx->AFR[1], (GPIO_AFRH_AFSEL8 << (POSITION_VAL(Pin >> 8U) * 4U)),
649  (Alternate << (POSITION_VAL(Pin >> 8U) * 4U)));
650 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_GPIO_SetPinMode()

__STATIC_INLINE void LL_GPIO_SetPinMode ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin,
uint32_t  Mode 
)

Configure gpio mode for a dedicated pin on dedicated port.

Note
I/O mode can be Input mode, General purpose output, Alternate function mode or Analog.
Warning: only one pin can be passed as parameter. MODER MODEy LL_GPIO_SetPinMode
Parameters
GPIOxGPIO Port
PinThis 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
  • LL_GPIO_PIN_14
  • LL_GPIO_PIN_15
ModeThis parameter can be one of the following values:
  • LL_GPIO_MODE_INPUT
  • LL_GPIO_MODE_OUTPUT
  • LL_GPIO_MODE_ALTERNATE
  • LL_GPIO_MODE_ANALOG
Return values
None

Definition at line 286 of file stm32l4xx_ll_gpio.h.

287 {
288  MODIFY_REG(GPIOx->MODER, (GPIO_MODER_MODE0 << (POSITION_VAL(Pin) * 2U)), (Mode << (POSITION_VAL(Pin) * 2U)));
289 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_GPIO_SetPinOutputType()

__STATIC_INLINE void LL_GPIO_SetPinOutputType ( GPIO_TypeDef *  GPIOx,
uint32_t  PinMask,
uint32_t  OutputType 
)

Configure gpio output type for several pins on dedicated port.

Note
Output type as to be set when gpio pin is in output or alternate modes. Possible type are Push-pull or Open-drain. OTYPER OTy LL_GPIO_SetPinOutputType
Parameters
GPIOxGPIO Port
PinMaskThis 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_14
  • LL_GPIO_PIN_15
  • LL_GPIO_PIN_ALL
OutputTypeThis parameter can be one of the following values:
  • LL_GPIO_OUTPUT_PUSHPULL
  • LL_GPIO_OUTPUT_OPENDRAIN
Return values
None

Definition at line 355 of file stm32l4xx_ll_gpio.h.

356 {
357  MODIFY_REG(GPIOx->OTYPER, PinMask, (PinMask * OutputType));
358 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_GPIO_SetPinPull()

__STATIC_INLINE void LL_GPIO_SetPinPull ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin,
uint32_t  Pull 
)

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

Note
Warning: only one pin can be passed as parameter. PUPDR PUPDy LL_GPIO_SetPinPull
Parameters
GPIOxGPIO Port
PinThis 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
  • LL_GPIO_PIN_14
  • LL_GPIO_PIN_15
PullThis 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 497 of file stm32l4xx_ll_gpio.h.

498 {
499  MODIFY_REG(GPIOx->PUPDR, (GPIO_PUPDR_PUPD0 << (POSITION_VAL(Pin) * 2U)), (Pull << (POSITION_VAL(Pin) * 2U)));
500 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_GPIO_SetPinSpeed()

__STATIC_INLINE void LL_GPIO_SetPinSpeed ( GPIO_TypeDef *  GPIOx,
uint32_t  Pin,
uint32_t  Speed 
)

Configure gpio speed for a dedicated pin on dedicated port.

Note
I/O speed can be Low, Medium, Fast or High speed.
Warning: only one pin can be passed as parameter.
Refer to datasheet for frequency specifications and the power supply and load conditions for each speed. OSPEEDR OSPEEDy LL_GPIO_SetPinSpeed
Parameters
GPIOxGPIO Port
PinThis 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
  • LL_GPIO_PIN_14
  • LL_GPIO_PIN_15
SpeedThis parameter can be one of the following values:
  • LL_GPIO_SPEED_FREQ_LOW
  • LL_GPIO_SPEED_FREQ_MEDIUM
  • LL_GPIO_SPEED_FREQ_HIGH
  • LL_GPIO_SPEED_FREQ_VERY_HIGH
Return values
None

Definition at line 426 of file stm32l4xx_ll_gpio.h.

427 {
428  MODIFY_REG(GPIOx->OSPEEDR, (GPIO_OSPEEDR_OSPEED0 << (POSITION_VAL(Pin) * 2U)),
429  (Speed << (POSITION_VAL(Pin) * 2U)));
430 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)