Hal Drivers for L4
Dependents: BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo
Fork of STM32L4xx_HAL_Driver by
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 CR ENABLE LL_LPTIM_Disable. | |
__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 CFGR PRELOAD LL_LPTIM_GetUpdateMode. | |
__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 ARR ARR LL_LPTIM_GetAutoReload. | |
__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 CMP CMP LL_LPTIM_GetCompare. | |
__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 CFGR COUNTMODE LL_LPTIM_GetCounterMode. | |
__STATIC_INLINE void | LL_LPTIM_ConfigOutput (LPTIM_TypeDef *LPTIMx, uint32_t Waveform, uint32_t Polarity) |
Configure the LPTIM instance output (LPTIMx_OUT) | |
__STATIC_INLINE uint32_t | LL_LPTIM_GetWaveform (LPTIM_TypeDef *LPTIMx) |
Get actual waveform shape CFGR WAVE LL_LPTIM_GetWaveform. | |
__STATIC_INLINE uint32_t | LL_LPTIM_GetPolarity (LPTIM_TypeDef *LPTIMx) |
Get actual output polarity CFGR WAVPOL LL_LPTIM_GetPolarity. | |
__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. CFGR WAVE LL_LPTIM_ConfigOutput
CFGR WAVPOL LL_LPTIM_ConfigOutput
- Parameters:
-
LPTIMx Low-Power Timer instance Waveform This parameter can be one of the following values: - LL_LPTIM_OUTPUT_WAVEFORM_PWM
- LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
Polarity This parameter can be one of the following values: - LL_LPTIM_OUTPUT_POLARITY_REGULAR
- LL_LPTIM_OUTPUT_POLARITY_INVERSE
- Return values:
-
None
Definition at line 493 of file stm32l4xx_ll_lptim.h.
__STATIC_INLINE void LL_LPTIM_Disable | ( | LPTIM_TypeDef * | LPTIMx ) |
Disable the LPTIM instance CR ENABLE LL_LPTIM_Disable.
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
None
Definition at line 326 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. CR ENABLE LL_LPTIM_Enable
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
None
Definition at line 315 of file stm32l4xx_ll_lptim.h.
__STATIC_INLINE uint32_t LL_LPTIM_GetAutoReload | ( | LPTIM_TypeDef * | LPTIMx ) |
Get actual auto reload value ARR ARR LL_LPTIM_GetAutoReload.
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
AutoReload Value between 0 and 0xFFFF
Definition at line 401 of file stm32l4xx_ll_lptim.h.
__STATIC_INLINE uint32_t LL_LPTIM_GetCompare | ( | LPTIM_TypeDef * | LPTIMx ) |
Get actual compare value CMP CMP LL_LPTIM_GetCompare.
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
CompareValue Value between 0 and 0xFFFF
Definition at line 428 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. CNT CNT LL_LPTIM_GetCounter
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
Counter value
Definition at line 443 of file stm32l4xx_ll_lptim.h.
__STATIC_INLINE uint32_t LL_LPTIM_GetCounterMode | ( | LPTIM_TypeDef * | LPTIMx ) |
Get the counter mode CFGR COUNTMODE LL_LPTIM_GetCounterMode.
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_LPTIM_COUNTER_MODE_INTERNAL
- LL_LPTIM_COUNTER_MODE_EXTERNAL
Definition at line 471 of file stm32l4xx_ll_lptim.h.
__STATIC_INLINE uint32_t LL_LPTIM_GetPolarity | ( | LPTIM_TypeDef * | LPTIMx ) |
Get actual output polarity CFGR WAVPOL LL_LPTIM_GetPolarity.
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_LPTIM_OUTPUT_POLARITY_REGULAR
- LL_LPTIM_OUTPUT_POLARITY_INVERSE
Definition at line 519 of file stm32l4xx_ll_lptim.h.
__STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler | ( | LPTIM_TypeDef * | LPTIMx ) |
Get actual prescaler division ratio.
CFGR PRESC LL_LPTIM_GetPrescaler
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
Returned value 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 563 of file stm32l4xx_ll_lptim.h.
__STATIC_INLINE uint32_t LL_LPTIM_GetUpdateMode | ( | LPTIM_TypeDef * | LPTIMx ) |
Get the LPTIM registers update mode CFGR PRELOAD LL_LPTIM_GetUpdateMode.
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_LPTIM_UPDATE_MODE_IMMEDIATE
- LL_LPTIM_UPDATE_MODE_ENDOFPERIOD
Definition at line 372 of file stm32l4xx_ll_lptim.h.
__STATIC_INLINE uint32_t LL_LPTIM_GetWaveform | ( | LPTIM_TypeDef * | LPTIMx ) |
Get actual waveform shape CFGR WAVE LL_LPTIM_GetWaveform.
- Parameters:
-
LPTIMx Low-Power Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_LPTIM_OUTPUT_WAVEFORM_PWM
- LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
Definition at line 506 of file stm32l4xx_ll_lptim.h.
__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. ARR ARR LL_LPTIM_SetAutoReload
- Parameters:
-
LPTIMx Low-Power Timer instance AutoReload Value between 0 and 0xFFFF
- Return values:
-
None
Definition at line 390 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. CMP CMP LL_LPTIM_SetCompare
- Parameters:
-
LPTIMx Low-Power Timer instance CompareValue Value between 0 and 0xFFFF
- Return values:
-
None
Definition at line 417 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. CFGR COUNTMODE LL_LPTIM_SetCounterMode
- Parameters:
-
LPTIMx Low-Power Timer instance CounterMode This parameter can be one of the following values: - LL_LPTIM_COUNTER_MODE_INTERNAL
- LL_LPTIM_COUNTER_MODE_EXTERNAL
- Return values:
-
None
Definition at line 458 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).
OR OR_0 LL_LPTIM_SetInput1Src OR OR_1 LL_LPTIM_SetInput1Src
- Parameters:
-
LPTIMx Low-Power Timer instance Src This parameter can be one of the following values: - LL_LPTIM_INPUT1_SRC_GPIO
- LL_LPTIM_INPUT1_SRC_COMP1
- LL_LPTIM_INPUT1_SRC_COMP2
- LL_LPTIM_INPUT1_SRC_COMP1_COMP2
- Return values:
-
None
Definition at line 580 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).
OR OR_0 LL_LPTIM_SetInput2Src
- Parameters:
-
LPTIMx Low-Power Timer instance Src This parameter can be one of the following values: - LL_LPTIM_INPUT2_SRC_GPIO
- LL_LPTIM_INPUT2_SRC_COMP2
- Return values:
-
None
Definition at line 594 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. CFGR PRESC LL_LPTIM_SetPrescaler
- Parameters:
-
LPTIMx Low-Power Timer instance Prescaler This 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 544 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. CFGR PRELOAD LL_LPTIM_SetUpdateMode
- Parameters:
-
LPTIMx Low-Power Timer instance UpdateMode This parameter can be one of the following values: - LL_LPTIM_UPDATE_MODE_IMMEDIATE
- LL_LPTIM_UPDATE_MODE_ENDOFPERIOD
- Return values:
-
None
Definition at line 359 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. CR CNTSTRT LL_LPTIM_StartCounter
CR SNGSTRT LL_LPTIM_StartCounter
- Parameters:
-
LPTIMx Low-Power Timer instance OperatingMode This parameter can be one of the following values: - LL_LPTIM_OPERATING_MODE_CONTINUOUS
- LL_LPTIM_OPERATING_MODE_ONESHOT
- Return values:
-
None
Definition at line 344 of file stm32l4xx_ll_lptim.h.
Generated on Tue Jul 12 2022 11:35:23 by
