STM32L486xx HAL User Manual
Functions
LPTIM Configuration
LPTIM Exported Functions

Functions

__STATIC_INLINE void LL_LPTIM_Enable (LPTIM_TypeDef *LPTIMx)
 Enable the LPTIM instance.
__STATIC_INLINE void LL_LPTIM_Disable (LPTIM_TypeDef *LPTIMx)
 Disable the LPTIM instance.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabled (LPTIM_TypeDef *LPTIMx)
 Indicates whether the LPTIM instance is enabled.
__STATIC_INLINE void LL_LPTIM_StartCounter (LPTIM_TypeDef *LPTIMx, uint32_t OperatingMode)
 Starts the LPTIM counter in the desired mode.
__STATIC_INLINE void LL_LPTIM_SetUpdateMode (LPTIM_TypeDef *LPTIMx, uint32_t UpdateMode)
 Set the LPTIM registers update mode (enable/disable register preload)
__STATIC_INLINE uint32_t LL_LPTIM_GetUpdateMode (LPTIM_TypeDef *LPTIMx)
 Get the LPTIM registers update mode.
__STATIC_INLINE void LL_LPTIM_SetAutoReload (LPTIM_TypeDef *LPTIMx, uint32_t AutoReload)
 Set the auto reload value.
__STATIC_INLINE uint32_t LL_LPTIM_GetAutoReload (LPTIM_TypeDef *LPTIMx)
 Get actual auto reload value.
__STATIC_INLINE void LL_LPTIM_SetCompare (LPTIM_TypeDef *LPTIMx, uint32_t CompareValue)
 Set the compare value.
__STATIC_INLINE uint32_t LL_LPTIM_GetCompare (LPTIM_TypeDef *LPTIMx)
 Get actual compare value.
__STATIC_INLINE uint32_t LL_LPTIM_GetCounter (LPTIM_TypeDef *LPTIMx)
 Get actual counter value.
__STATIC_INLINE void LL_LPTIM_SetCounterMode (LPTIM_TypeDef *LPTIMx, uint32_t CounterMode)
 Set the counter mode (selection of the LPTIM counter clock source).
__STATIC_INLINE uint32_t LL_LPTIM_GetCounterMode (LPTIM_TypeDef *LPTIMx)
 Get the counter mode.
__STATIC_INLINE void LL_LPTIM_ConfigOutput (LPTIM_TypeDef *LPTIMx, uint32_t Waveform, uint32_t Polarity)
 Configure the LPTIM instance output (LPTIMx_OUT)
__STATIC_INLINE void LL_LPTIM_SetWaveform (LPTIM_TypeDef *LPTIMx, uint32_t Waveform)
 Set waveform shape.
__STATIC_INLINE uint32_t LL_LPTIM_GetWaveform (LPTIM_TypeDef *LPTIMx)
 Get actual waveform shape.
__STATIC_INLINE void LL_LPTIM_SetPolarity (LPTIM_TypeDef *LPTIMx, uint32_t Polarity)
 Set output polarity.
__STATIC_INLINE uint32_t LL_LPTIM_GetPolarity (LPTIM_TypeDef *LPTIMx)
 Get actual output polarity.
__STATIC_INLINE void LL_LPTIM_SetPrescaler (LPTIM_TypeDef *LPTIMx, uint32_t Prescaler)
 Set actual prescaler division ratio.
__STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler (LPTIM_TypeDef *LPTIMx)
 Get actual prescaler division ratio.
__STATIC_INLINE void LL_LPTIM_SetInput1Src (LPTIM_TypeDef *LPTIMx, uint32_t Src)
 Set LPTIM input 1 source (default GPIO).
__STATIC_INLINE void LL_LPTIM_SetInput2Src (LPTIM_TypeDef *LPTIMx, uint32_t Src)
 Set LPTIM input 2 source (default GPIO).

Function Documentation

__STATIC_INLINE void LL_LPTIM_ConfigOutput ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Waveform,
uint32_t  Polarity 
)

Configure the LPTIM instance output (LPTIMx_OUT)

Note:
This function must be called when the LPTIM instance is disabled.
Regarding the LPTIM output polarity the change takes effect immediately, so the output default value will change immediately after the polarity is re-configured, even before the timer is enabled.
Reference Manual to LL API cross reference:
CFGR WAVE LL_LPTIM_ConfigOutput
CFGR WAVPOL LL_LPTIM_ConfigOutput
Parameters:
LPTIMxLow-Power Timer instance
WaveformThis parameter can be one of the following values:
PolarityThis parameter can be one of the following values:
Return values:
None

Definition at line 544 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_Disable ( LPTIM_TypeDef *  LPTIMx)

Disable the LPTIM instance.

Reference Manual to LL API cross reference:
CR ENABLE LL_LPTIM_Disable
Parameters:
LPTIMxLow-Power Timer instance
Return values:
None

Definition at line 365 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_Enable ( LPTIM_TypeDef *  LPTIMx)

Enable the LPTIM instance.

Note:
After setting the ENABLE bit, a delay of two counter clock is needed before the LPTIM instance is actually enabled.
Reference Manual to LL API cross reference:
CR ENABLE LL_LPTIM_Enable
Parameters:
LPTIMxLow-Power Timer instance
Return values:
None

Definition at line 354 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_GetAutoReload ( LPTIM_TypeDef *  LPTIMx)

Get actual auto reload value.

Reference Manual to LL API cross reference:
ARR ARR LL_LPTIM_GetAutoReload
Parameters:
LPTIMxLow-Power Timer instance
Return values:
AutoReloadValue between Min_Data=0x00 and Max_Data=0xFFFF

Definition at line 452 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_GetCompare ( LPTIM_TypeDef *  LPTIMx)

Get actual compare value.

Reference Manual to LL API cross reference:
CMP CMP LL_LPTIM_GetCompare
Parameters:
LPTIMxLow-Power Timer instance
Return values:
CompareValueValue between Min_Data=0x00 and Max_Data=0xFFFF

Definition at line 479 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_GetCounter ( LPTIM_TypeDef *  LPTIMx)

Get actual counter value.

Note:
When the LPTIM instance is running with an asynchronous clock, reading the LPTIMx_CNT register may return unreliable values. So in this case it is necessary to perform two consecutive read accesses and verify that the two returned values are identical.
Reference Manual to LL API cross reference:
CNT CNT LL_LPTIM_GetCounter
Parameters:
LPTIMxLow-Power Timer instance
Return values:
Countervalue

Definition at line 494 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_GetCounterMode ( LPTIM_TypeDef *  LPTIMx)

Get the counter mode.

Reference Manual to LL API cross reference:
CFGR COUNTMODE LL_LPTIM_GetCounterMode
Parameters:
LPTIMxLow-Power Timer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 522 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_GetPolarity ( LPTIM_TypeDef *  LPTIMx)

Get actual output polarity.

Reference Manual to LL API cross reference:
CFGR WAVPOL LL_LPTIM_GetPolarity
Parameters:
LPTIMxLow-Power Timer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 598 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler ( LPTIM_TypeDef *  LPTIMx)

Get actual prescaler division ratio.

Reference Manual to LL API cross reference:
CFGR PRESC LL_LPTIM_GetPrescaler
Parameters:
LPTIMxLow-Power Timer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 642 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_GetUpdateMode ( LPTIM_TypeDef *  LPTIMx)

Get the LPTIM registers update mode.

Reference Manual to LL API cross reference:
CFGR PRELOAD LL_LPTIM_GetUpdateMode
Parameters:
LPTIMxLow-Power Timer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 423 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_GetWaveform ( LPTIM_TypeDef *  LPTIMx)

Get actual waveform shape.

Reference Manual to LL API cross reference:
CFGR WAVE LL_LPTIM_GetWaveform
Parameters:
LPTIMxLow-Power Timer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 571 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE uint32_t LL_LPTIM_IsEnabled ( LPTIM_TypeDef *  LPTIMx)

Indicates whether the LPTIM instance is enabled.

Reference Manual to LL API cross reference:
CR ENABLE LL_LPTIM_IsEnabled
Parameters:
LPTIMxLow-Power Timer instance
Return values:
Stateof bit (1 or 0).

Definition at line 376 of file stm32l4xx_ll_lptim.h.

Referenced by LL_LPTIM_Init().

__STATIC_INLINE void LL_LPTIM_SetAutoReload ( LPTIM_TypeDef *  LPTIMx,
uint32_t  AutoReload 
)

Set the auto reload value.

Note:
The LPTIMx_ARR register content must only be modified when the LPTIM is enabled
After a write to the LPTIMx_ARR register a new write operation to the same register can only be performed when the previous write operation is completed. Any successive write before the ARROK flag be set, will lead to unpredictable results.
autoreload value be strictly greater than the compare value.
Reference Manual to LL API cross reference:
ARR ARR LL_LPTIM_SetAutoReload
Parameters:
LPTIMxLow-Power Timer instance
AutoReloadValue between Min_Data=0x00 and Max_Data=0xFFFF
Return values:
None

Definition at line 441 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_SetCompare ( LPTIM_TypeDef *  LPTIMx,
uint32_t  CompareValue 
)

Set the compare value.

Note:
After a write to the LPTIMx_CMP register a new write operation to the same register can only be performed when the previous write operation is completed. Any successive write before the CMPOK flag be set, will lead to unpredictable results.
Reference Manual to LL API cross reference:
CMP CMP LL_LPTIM_SetCompare
Parameters:
LPTIMxLow-Power Timer instance
CompareValueValue between Min_Data=0x00 and Max_Data=0xFFFF
Return values:
None

Definition at line 468 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_SetCounterMode ( LPTIM_TypeDef *  LPTIMx,
uint32_t  CounterMode 
)

Set the counter mode (selection of the LPTIM counter clock source).

Note:
The counter mode can be set only when the LPTIM instance is disabled.
Reference Manual to LL API cross reference:
CFGR COUNTMODE LL_LPTIM_SetCounterMode
Parameters:
LPTIMxLow-Power Timer instance
CounterModeThis parameter can be one of the following values:
Return values:
None

Definition at line 509 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_SetInput1Src ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Src 
)

Set LPTIM input 1 source (default GPIO).

Reference Manual to LL API cross reference:
OR OR_0 LL_LPTIM_SetInput1Src
Reference Manual to LL API cross reference:
OR OR_1 LL_LPTIM_SetInput1Src
Parameters:
LPTIMxLow-Power Timer instance
SrcThis parameter can be one of the following values:
Return values:
None

Definition at line 659 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_SetInput2Src ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Src 
)

Set LPTIM input 2 source (default GPIO).

Reference Manual to LL API cross reference:
OR OR_0 LL_LPTIM_SetInput2Src
Parameters:
LPTIMxLow-Power Timer instance
SrcThis parameter can be one of the following values:
Return values:
None

Definition at line 673 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_SetPolarity ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Polarity 
)

Set output polarity.

Reference Manual to LL API cross reference:
CFGR WAVPOL LL_LPTIM_SetPolarity
Parameters:
LPTIMxLow-Power Timer instance
PolarityThis parameter can be one of the following values:
Return values:
None

Definition at line 585 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_SetPrescaler ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Prescaler 
)

Set actual prescaler division ratio.

Note:
This function must be called when the LPTIM instance is disabled.
When the LPTIM is configured to be clocked by an internal clock source and the LPTIM counter is configured to be updated by active edges detected on the LPTIM external Input1, the internal clock provided to the LPTIM must be not be prescaled.
Reference Manual to LL API cross reference:
CFGR PRESC LL_LPTIM_SetPrescaler
Parameters:
LPTIMxLow-Power Timer instance
PrescalerThis parameter can be one of the following values:
Return values:
None

Definition at line 623 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_SetUpdateMode ( LPTIM_TypeDef *  LPTIMx,
uint32_t  UpdateMode 
)

Set the LPTIM registers update mode (enable/disable register preload)

Note:
This function must be called when the LPTIM instance is disabled.
Reference Manual to LL API cross reference:
CFGR PRELOAD LL_LPTIM_SetUpdateMode
Parameters:
LPTIMxLow-Power Timer instance
UpdateModeThis parameter can be one of the following values:
Return values:
None

Definition at line 410 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_SetWaveform ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Waveform 
)

Set waveform shape.

Reference Manual to LL API cross reference:
CFGR WAVE LL_LPTIM_SetWaveform
Parameters:
LPTIMxLow-Power Timer instance
WaveformThis parameter can be one of the following values:
Return values:
None

Definition at line 558 of file stm32l4xx_ll_lptim.h.

__STATIC_INLINE void LL_LPTIM_StartCounter ( LPTIM_TypeDef *  LPTIMx,
uint32_t  OperatingMode 
)

Starts the LPTIM counter in the desired mode.

Note:
LPTIM instance must be enabled before starting the counter.
It is possible to change on the fly from One Shot mode to Continuous mode.
Reference Manual to LL API cross reference:
CR CNTSTRT LL_LPTIM_StartCounter
CR SNGSTRT LL_LPTIM_StartCounter
Parameters:
LPTIMxLow-Power Timer instance
OperatingModeThis parameter can be one of the following values:
Return values:
None

Definition at line 394 of file stm32l4xx_ll_lptim.h.