STM32F4xx_HAL_Driver  1.8.3
+ Collaboration diagram for LPTIM Configuration:

Functions

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

Detailed Description

Function Documentation

◆ LL_LPTIM_ConfigOutput()

__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. @rmtoll CFGR WAVE LL_LPTIM_ConfigOutput
CFGR WAVPOL LL_LPTIM_ConfigOutput
Parameters
LPTIMxLow-Power Timer instance
WaveformThis parameter can be one of the following values:
  • LL_LPTIM_OUTPUT_WAVEFORM_PWM
  • LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
PolarityThis parameter can be one of the following values:
  • LL_LPTIM_OUTPUT_POLARITY_REGULAR
  • LL_LPTIM_OUTPUT_POLARITY_INVERSE
Return values
None

Definition at line 535 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_Enable()

__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. @rmtoll CR ENABLE LL_LPTIM_Enable
Parameters
LPTIMxLow-Power Timer instance
Return values
None

Definition at line 357 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_GetAutoReload()

__STATIC_INLINE uint32_t LL_LPTIM_GetAutoReload ( const LPTIM_TypeDef *  LPTIMx)

Get actual auto reload value @rmtoll ARR ARR LL_LPTIM_GetAutoReload.

Parameters
LPTIMxLow-Power Timer instance
Return values
AutoReloadValue between Min_Data=0x0001 and Max_Data=0xFFFF

Definition at line 443 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_GetCompare()

__STATIC_INLINE uint32_t LL_LPTIM_GetCompare ( const LPTIM_TypeDef *  LPTIMx)

Get actual compare value @rmtoll CMP CMP LL_LPTIM_GetCompare.

Parameters
LPTIMxLow-Power Timer instance
Return values
CompareValueValue between Min_Data=0x00 and Max_Data=0xFFFF

Definition at line 470 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_GetCounter()

__STATIC_INLINE uint32_t LL_LPTIM_GetCounter ( const 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. @rmtoll CNT CNT LL_LPTIM_GetCounter
Parameters
LPTIMxLow-Power Timer instance
Return values
Countervalue

Definition at line 485 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_GetCounterMode()

__STATIC_INLINE uint32_t LL_LPTIM_GetCounterMode ( const LPTIM_TypeDef *  LPTIMx)

Get the counter mode @rmtoll CFGR COUNTMODE LL_LPTIM_GetCounterMode.

Parameters
LPTIMxLow-Power Timer instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPTIM_COUNTER_MODE_INTERNAL
  • LL_LPTIM_COUNTER_MODE_EXTERNAL

Definition at line 513 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_GetPolarity()

__STATIC_INLINE uint32_t LL_LPTIM_GetPolarity ( const LPTIM_TypeDef *  LPTIMx)

Get actual output polarity @rmtoll CFGR WAVPOL LL_LPTIM_GetPolarity.

Parameters
LPTIMxLow-Power Timer instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPTIM_OUTPUT_POLARITY_REGULAR
  • LL_LPTIM_OUTPUT_POLARITY_INVERSE

Definition at line 589 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_GetPrescaler()

__STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler ( const LPTIM_TypeDef *  LPTIMx)

Get actual prescaler division ratio. @rmtoll CFGR PRESC LL_LPTIM_GetPrescaler.

Parameters
LPTIMxLow-Power Timer instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPTIM_PRESCALER_DIV1
  • LL_LPTIM_PRESCALER_DIV2
  • LL_LPTIM_PRESCALER_DIV4
  • LL_LPTIM_PRESCALER_DIV8
  • LL_LPTIM_PRESCALER_DIV16
  • LL_LPTIM_PRESCALER_DIV32
  • LL_LPTIM_PRESCALER_DIV64
  • LL_LPTIM_PRESCALER_DIV128

Definition at line 633 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_GetUpdateMode()

__STATIC_INLINE uint32_t LL_LPTIM_GetUpdateMode ( const LPTIM_TypeDef *  LPTIMx)

Get the LPTIM registers update mode @rmtoll CFGR PRELOAD LL_LPTIM_GetUpdateMode.

Parameters
LPTIMxLow-Power Timer instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPTIM_UPDATE_MODE_IMMEDIATE
  • LL_LPTIM_UPDATE_MODE_ENDOFPERIOD

Definition at line 414 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_GetWaveform()

__STATIC_INLINE uint32_t LL_LPTIM_GetWaveform ( const LPTIM_TypeDef *  LPTIMx)

Get actual waveform shape @rmtoll CFGR WAVE LL_LPTIM_GetWaveform.

Parameters
LPTIMxLow-Power Timer instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPTIM_OUTPUT_WAVEFORM_PWM
  • LL_LPTIM_OUTPUT_WAVEFORM_SETONCE

Definition at line 562 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_IsEnabled()

__STATIC_INLINE uint32_t LL_LPTIM_IsEnabled ( const LPTIM_TypeDef *  LPTIMx)

Indicates whether the LPTIM instance is enabled. @rmtoll CR ENABLE LL_LPTIM_IsEnabled.

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

Definition at line 368 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_SetAutoReload()

__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 is set, will lead to unpredictable results.
autoreload value be strictly greater than the compare value. @rmtoll ARR ARR LL_LPTIM_SetAutoReload
Parameters
LPTIMxLow-Power Timer instance
AutoReloadValue between Min_Data=0x0001 and Max_Data=0xFFFF
Return values
None

Definition at line 432 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_SetCompare()

__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 is set, will lead to unpredictable results. @rmtoll 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 459 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_SetCounterMode()

__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. @rmtoll CFGR COUNTMODE LL_LPTIM_SetCounterMode
Parameters
LPTIMxLow-Power Timer instance
CounterModeThis parameter can be one of the following values:
  • LL_LPTIM_COUNTER_MODE_INTERNAL
  • LL_LPTIM_COUNTER_MODE_EXTERNAL
Return values
None

Definition at line 500 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_SetInput1Src()

__STATIC_INLINE void LL_LPTIM_SetInput1Src ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Src 
)

Set LPTIM input 1 source (default GPIO). @rmtoll OR OR LL_LPTIM_SetInput1Src.

Parameters
LPTIMxLow-Power Timer instance
SrcThis parameter can be one of the following values:
  • LL_LPTIM_INPUT1_SRC_PAD_AF
  • LL_LPTIM_INPUT1_SRC_PAD_PA4
  • LL_LPTIM_INPUT1_SRC_PAD_PB9
  • LL_LPTIM_INPUT1_SRC_TIM_DAC
Return values
None

Definition at line 649 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_SetPolarity()

__STATIC_INLINE void LL_LPTIM_SetPolarity ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Polarity 
)

Set output polarity @rmtoll CFGR WAVPOL LL_LPTIM_SetPolarity.

Parameters
LPTIMxLow-Power Timer instance
PolarityThis parameter can be one of the following values:
  • LL_LPTIM_OUTPUT_POLARITY_REGULAR
  • LL_LPTIM_OUTPUT_POLARITY_INVERSE
Return values
None

Definition at line 576 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_SetPrescaler()

__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. @rmtoll CFGR PRESC LL_LPTIM_SetPrescaler
Parameters
LPTIMxLow-Power Timer instance
PrescalerThis parameter can be one of the following values:
  • LL_LPTIM_PRESCALER_DIV1
  • LL_LPTIM_PRESCALER_DIV2
  • LL_LPTIM_PRESCALER_DIV4
  • LL_LPTIM_PRESCALER_DIV8
  • LL_LPTIM_PRESCALER_DIV16
  • LL_LPTIM_PRESCALER_DIV32
  • LL_LPTIM_PRESCALER_DIV64
  • LL_LPTIM_PRESCALER_DIV128
Return values
None

Definition at line 614 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_SetUpdateMode()

__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. @rmtoll CFGR PRELOAD LL_LPTIM_SetUpdateMode
Parameters
LPTIMxLow-Power Timer instance
UpdateModeThis parameter can be one of the following values:
  • LL_LPTIM_UPDATE_MODE_IMMEDIATE
  • LL_LPTIM_UPDATE_MODE_ENDOFPERIOD
Return values
None

Definition at line 401 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_SetWaveform()

__STATIC_INLINE void LL_LPTIM_SetWaveform ( LPTIM_TypeDef *  LPTIMx,
uint32_t  Waveform 
)

Set waveform shape @rmtoll CFGR WAVE LL_LPTIM_SetWaveform.

Parameters
LPTIMxLow-Power Timer instance
WaveformThis parameter can be one of the following values:
  • LL_LPTIM_OUTPUT_WAVEFORM_PWM
  • LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
Return values
None

Definition at line 549 of file stm32f4xx_ll_lptim.h.

◆ LL_LPTIM_StartCounter()

__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. @rmtoll CR CNTSTRT LL_LPTIM_StartCounter
CR SNGSTRT LL_LPTIM_StartCounter
Parameters
LPTIMxLow-Power Timer instance
OperatingModeThis parameter can be one of the following values:
  • LL_LPTIM_OPERATING_MODE_CONTINUOUS
  • LL_LPTIM_OPERATING_MODE_ONESHOT
Return values
None

Definition at line 386 of file stm32f4xx_ll_lptim.h.