STM32L4xx_HAL_Driver  1.14.0

Functions

__STATIC_INLINE void LL_LPTIM_SetEncoderMode (LPTIM_TypeDef *LPTIMx, uint32_t EncoderMode)
 Configure the encoder mode. More...
 
__STATIC_INLINE uint32_t LL_LPTIM_GetEncoderMode (LPTIM_TypeDef *LPTIMx)
 Get actual encoder mode. CFGR CKPOL LL_LPTIM_GetEncoderMode. More...
 
__STATIC_INLINE void LL_LPTIM_EnableEncoderMode (LPTIM_TypeDef *LPTIMx)
 Enable the encoder mode. More...
 
__STATIC_INLINE void LL_LPTIM_DisableEncoderMode (LPTIM_TypeDef *LPTIMx)
 Disable the encoder mode. More...
 
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledEncoderMode (LPTIM_TypeDef *LPTIMx)
 Indicates whether the LPTIM operates in encoder mode. CFGR ENC LL_LPTIM_IsEnabledEncoderMode. More...
 

Detailed Description

Function Documentation

◆ LL_LPTIM_DisableEncoderMode()

__STATIC_INLINE void LL_LPTIM_DisableEncoderMode ( LPTIM_TypeDef *  LPTIMx)

Disable the encoder mode.

Note
This function must be called when the LPTIM instance is disabled. CFGR ENC LL_LPTIM_DisableEncoderMode
Parameters
LPTIMxLow-Power Timer instance
Return values
None

Definition at line 1054 of file stm32l4xx_ll_lptim.h.

1055 {
1056  CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC);
1057 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPTIM_EnableEncoderMode()

__STATIC_INLINE void LL_LPTIM_EnableEncoderMode ( LPTIM_TypeDef *  LPTIMx)

Enable the encoder mode.

Note
This function must be called when the LPTIM instance is disabled.
In this mode the LPTIM instance must be clocked by an internal clock source. Also, the prescaler division ratio must be equal to 1.
LPTIM instance must be configured in continuous mode prior enabling the encoder mode. CFGR ENC LL_LPTIM_EnableEncoderMode
Parameters
LPTIMxLow-Power Timer instance
Return values
None

Definition at line 1042 of file stm32l4xx_ll_lptim.h.

1043 {
1044  SET_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC);
1045 }

◆ LL_LPTIM_GetEncoderMode()

__STATIC_INLINE uint32_t LL_LPTIM_GetEncoderMode ( LPTIM_TypeDef *  LPTIMx)

Get actual encoder mode. CFGR CKPOL LL_LPTIM_GetEncoderMode.

Parameters
LPTIMxLow-Power Timer instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPTIM_ENCODER_MODE_RISING
  • LL_LPTIM_ENCODER_MODE_FALLING
  • LL_LPTIM_ENCODER_MODE_RISING_FALLING

Definition at line 1026 of file stm32l4xx_ll_lptim.h.

1027 {
1028  return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKPOL));
1029 }

◆ LL_LPTIM_IsEnabledEncoderMode()

__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledEncoderMode ( LPTIM_TypeDef *  LPTIMx)

Indicates whether the LPTIM operates in encoder mode. CFGR ENC LL_LPTIM_IsEnabledEncoderMode.

Parameters
LPTIMxLow-Power Timer instance
Return values
Stateof bit (1 or 0).

Definition at line 1065 of file stm32l4xx_ll_lptim.h.

1066 {
1067  return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC) == LPTIM_CFGR_ENC)? 1UL : 0UL));
1068 }

◆ LL_LPTIM_SetEncoderMode()

__STATIC_INLINE void LL_LPTIM_SetEncoderMode ( LPTIM_TypeDef *  LPTIMx,
uint32_t  EncoderMode 
)

Configure the encoder mode.

Note
This function must be called when the LPTIM instance is disabled. CFGR CKPOL LL_LPTIM_SetEncoderMode
Parameters
LPTIMxLow-Power Timer instance
EncoderModeThis parameter can be one of the following values:
  • LL_LPTIM_ENCODER_MODE_RISING
  • LL_LPTIM_ENCODER_MODE_FALLING
  • LL_LPTIM_ENCODER_MODE_RISING_FALLING
Return values
None

Definition at line 1012 of file stm32l4xx_ll_lptim.h.

1013 {
1014  MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKPOL, EncoderMode);
1015 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)