Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Time Base configuration
[TIM Exported Functions]
Functions | |
__STATIC_INLINE void | LL_TIM_EnableCounter (TIM_TypeDef *TIMx) |
Enable timer counter. | |
__STATIC_INLINE void | LL_TIM_DisableCounter (TIM_TypeDef *TIMx) |
Disable timer counter. | |
__STATIC_INLINE uint32_t | LL_TIM_IsEnabledCounter (TIM_TypeDef *TIMx) |
Indicates whether the timer counter is enabled. | |
__STATIC_INLINE void | LL_TIM_EnableUpdateEvent (TIM_TypeDef *TIMx) |
Enable update event generation. | |
__STATIC_INLINE void | LL_TIM_DisableUpdateEvent (TIM_TypeDef *TIMx) |
Disable update event generation. | |
__STATIC_INLINE uint32_t | LL_TIM_IsEnabledUpdateEvent (TIM_TypeDef *TIMx) |
Indicates whether update event generation is enabled. | |
__STATIC_INLINE void | LL_TIM_SetUpdateSource (TIM_TypeDef *TIMx, uint32_t UpdateSource) |
Set update event source. | |
__STATIC_INLINE uint32_t | LL_TIM_GetUpdateSource (TIM_TypeDef *TIMx) |
Get actual event update source CR1 URS LL_TIM_GetUpdateSource. | |
__STATIC_INLINE void | LL_TIM_SetOnePulseMode (TIM_TypeDef *TIMx, uint32_t OnePulseMode) |
Set one pulse mode (one shot v.s. | |
__STATIC_INLINE uint32_t | LL_TIM_GetOnePulseMode (TIM_TypeDef *TIMx) |
Get actual one pulse mode. | |
__STATIC_INLINE void | LL_TIM_SetCounterMode (TIM_TypeDef *TIMx, uint32_t CounterMode) |
Set the timer counter counting mode. | |
__STATIC_INLINE uint32_t | LL_TIM_GetCounterMode (TIM_TypeDef *TIMx) |
Get actual counter mode. | |
__STATIC_INLINE void | LL_TIM_EnableARRPreload (TIM_TypeDef *TIMx) |
Enable auto-reload (ARR) preload. | |
__STATIC_INLINE void | LL_TIM_DisableARRPreload (TIM_TypeDef *TIMx) |
Disable auto-reload (ARR) preload. | |
__STATIC_INLINE uint32_t | LL_TIM_IsEnabledARRPreload (TIM_TypeDef *TIMx) |
Indicates whether auto-reload (ARR) preload is enabled. | |
__STATIC_INLINE void | LL_TIM_SetClockDivision (TIM_TypeDef *TIMx, uint32_t ClockDivision) |
Set the division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters. | |
__STATIC_INLINE uint32_t | LL_TIM_GetClockDivision (TIM_TypeDef *TIMx) |
Get the actual division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters. | |
__STATIC_INLINE void | LL_TIM_SetCounter (TIM_TypeDef *TIMx, uint32_t Counter) |
Set the counter value. | |
__STATIC_INLINE uint32_t | LL_TIM_GetCounter (TIM_TypeDef *TIMx) |
Get the counter value. | |
__STATIC_INLINE uint32_t | LL_TIM_GetDirection (TIM_TypeDef *TIMx) |
Get the current direction of the counter CR1 DIR LL_TIM_GetDirection. | |
__STATIC_INLINE void | LL_TIM_SetPrescaler (TIM_TypeDef *TIMx, uint32_t Prescaler) |
Set the prescaler value. | |
__STATIC_INLINE uint32_t | LL_TIM_GetPrescaler (TIM_TypeDef *TIMx) |
Get the prescaler value. | |
__STATIC_INLINE void | LL_TIM_SetAutoReload (TIM_TypeDef *TIMx, uint32_t AutoReload) |
Set the auto-reload value. | |
__STATIC_INLINE uint32_t | LL_TIM_GetAutoReload (TIM_TypeDef *TIMx) |
Get the auto-reload value. | |
__STATIC_INLINE void | LL_TIM_SetRepetitionCounter (TIM_TypeDef *TIMx, uint32_t RepetitionCounter) |
Set the repetition counter value. | |
__STATIC_INLINE uint32_t | LL_TIM_GetRepetitionCounter (TIM_TypeDef *TIMx) |
Get the repetition counter value. | |
__STATIC_INLINE void | LL_TIM_EnableUIFRemap (TIM_TypeDef *TIMx) |
Force a continuous copy of the update interrupt flag (UIF) into the timer counter register (bit 31). | |
__STATIC_INLINE void | LL_TIM_DisableUIFRemap (TIM_TypeDef *TIMx) |
Disable update interrupt flag (UIF) remapping. |
Function Documentation
__STATIC_INLINE void LL_TIM_DisableARRPreload | ( | TIM_TypeDef * | TIMx ) |
Disable auto-reload (ARR) preload.
CR1 ARPE LL_TIM_DisableARRPreload
- Parameters:
-
TIMx Timer instance
- Return values:
-
None
Definition at line 1507 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_DisableCounter | ( | TIM_TypeDef * | TIMx ) |
Disable timer counter.
CR1 CEN LL_TIM_DisableCounter
- Parameters:
-
TIMx Timer instance
- Return values:
-
None
Definition at line 1339 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_DisableUIFRemap | ( | TIM_TypeDef * | TIMx ) |
Disable update interrupt flag (UIF) remapping.
CR1 UIFREMAP LL_TIM_DisableUIFRemap
- Parameters:
-
TIMx Timer instance
- Return values:
-
None
Definition at line 1700 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_DisableUpdateEvent | ( | TIM_TypeDef * | TIMx ) |
Disable update event generation.
CR1 UDIS LL_TIM_DisableUpdateEvent
- Parameters:
-
TIMx Timer instance
- Return values:
-
None
Definition at line 1372 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_EnableARRPreload | ( | TIM_TypeDef * | TIMx ) |
Enable auto-reload (ARR) preload.
CR1 ARPE LL_TIM_EnableARRPreload
- Parameters:
-
TIMx Timer instance
- Return values:
-
None
Definition at line 1496 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_EnableCounter | ( | TIM_TypeDef * | TIMx ) |
Enable timer counter.
CR1 CEN LL_TIM_EnableCounter
- Parameters:
-
TIMx Timer instance
- Return values:
-
None
Definition at line 1328 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_EnableUIFRemap | ( | TIM_TypeDef * | TIMx ) |
Force a continuous copy of the update interrupt flag (UIF) into the timer counter register (bit 31).
- Note:
- This allows both the counter value and a potential roll-over condition signalled by the UIFCPY flag to be read in an atomic way. CR1 UIFREMAP LL_TIM_EnableUIFRemap
- Parameters:
-
TIMx Timer instance
- Return values:
-
None
Definition at line 1689 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_EnableUpdateEvent | ( | TIM_TypeDef * | TIMx ) |
Enable update event generation.
CR1 UDIS LL_TIM_EnableUpdateEvent
- Parameters:
-
TIMx Timer instance
- Return values:
-
None
Definition at line 1361 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetAutoReload | ( | TIM_TypeDef * | TIMx ) |
Get the auto-reload value.
ARR ARR LL_TIM_GetAutoReload
- Note:
- Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a 32 bits counter.
- Parameters:
-
TIMx Timer instance
- Return values:
-
Auto-reload value
Definition at line 1649 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetClockDivision | ( | TIM_TypeDef * | TIMx ) |
Get the actual division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters.
- Note:
- Macro IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx) can be used to check whether or not the clock division feature is supported by the timer instance. CR1 CKD LL_TIM_GetClockDivision
- Parameters:
-
TIMx Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_TIM_CLOCKDIVISION_DIV1
- LL_TIM_CLOCKDIVISION_DIV2
- LL_TIM_CLOCKDIVISION_DIV4
Definition at line 1553 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetCounter | ( | TIM_TypeDef * | TIMx ) |
Get the counter value.
- Note:
- Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a 32 bits counter. CNT CNT LL_TIM_GetCounter
- Parameters:
-
TIMx Timer instance
- Return values:
-
Counter value (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF)
Definition at line 1580 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetCounterMode | ( | TIM_TypeDef * | TIMx ) |
Get actual counter mode.
- Note:
- Macro IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to check whether or not the counter mode selection feature is supported by a timer instance. CR1 DIR LL_TIM_GetCounterMode
CR1 CMS LL_TIM_GetCounterMode
- Parameters:
-
TIMx Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_TIM_COUNTERMODE_UP
- LL_TIM_COUNTERMODE_DOWN
- LL_TIM_COUNTERMODE_CENTER_UP
- LL_TIM_COUNTERMODE_CENTER_DOWN
- LL_TIM_COUNTERMODE_CENTER_UP_DOWN
Definition at line 1485 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetDirection | ( | TIM_TypeDef * | TIMx ) |
Get the current direction of the counter CR1 DIR LL_TIM_GetDirection.
- Parameters:
-
TIMx Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_TIM_COUNTERDIRECTION_UP
- LL_TIM_COUNTERDIRECTION_DOWN
Definition at line 1593 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetOnePulseMode | ( | TIM_TypeDef * | TIMx ) |
Get actual one pulse mode.
CR1 OPM LL_TIM_GetOnePulseMode
- Parameters:
-
TIMx Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_TIM_ONEPULSEMODE_SINGLE
- LL_TIM_ONEPULSEMODE_REPETITIVE
Definition at line 1444 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetPrescaler | ( | TIM_TypeDef * | TIMx ) |
Get the prescaler value.
PSC PSC LL_TIM_GetPrescaler
- Parameters:
-
TIMx Timer instance
- Return values:
-
Prescaler value between Min_Data=0 and Max_Data=65535
Definition at line 1620 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetRepetitionCounter | ( | TIM_TypeDef * | TIMx ) |
Get the repetition counter value.
- Note:
- Macro IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a repetition counter. RCR REP LL_TIM_GetRepetitionCounter
- Parameters:
-
TIMx Timer instance
- Return values:
-
Repetition counter value
Definition at line 1677 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_GetUpdateSource | ( | TIM_TypeDef * | TIMx ) |
Get actual event update source CR1 URS LL_TIM_GetUpdateSource.
- Parameters:
-
TIMx Timer instance
- Return values:
-
Returned value can be one of the following values: - LL_TIM_UPDATESOURCE_REGULAR
- LL_TIM_UPDATESOURCE_COUNTER
Definition at line 1417 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_IsEnabledARRPreload | ( | TIM_TypeDef * | TIMx ) |
Indicates whether auto-reload (ARR) preload is enabled.
CR1 ARPE LL_TIM_IsEnabledARRPreload
- Parameters:
-
TIMx Timer instance
- Return values:
-
State of bit (1 or 0).
Definition at line 1518 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_IsEnabledCounter | ( | TIM_TypeDef * | TIMx ) |
Indicates whether the timer counter is enabled.
CR1 CEN LL_TIM_IsEnabledCounter
- Parameters:
-
TIMx Timer instance
- Return values:
-
State of bit (1 or 0).
Definition at line 1350 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE uint32_t LL_TIM_IsEnabledUpdateEvent | ( | TIM_TypeDef * | TIMx ) |
Indicates whether update event generation is enabled.
CR1 UDIS LL_TIM_IsEnabledUpdateEvent
- Parameters:
-
TIMx Timer instance
- Return values:
-
State of bit (1 or 0).
Definition at line 1383 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_SetAutoReload | ( | TIM_TypeDef * | TIMx, |
uint32_t | AutoReload | ||
) |
Set the auto-reload value.
- Note:
- The counter is blocked while the auto-reload value is null.
- Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a 32 bits counter.
- Helper macro __LL_TIM_CALC_ARR can be used to calculate the AutoReload parameter ARR ARR LL_TIM_SetAutoReload
- Parameters:
-
TIMx Timer instance AutoReload between Min_Data=0 and Max_Data=65535
- Return values:
-
None
Definition at line 1636 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_SetClockDivision | ( | TIM_TypeDef * | TIMx, |
uint32_t | ClockDivision | ||
) |
Set the division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters.
- Note:
- Macro IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx) can be used to check whether or not the clock division feature is supported by the timer instance. CR1 CKD LL_TIM_SetClockDivision
- Parameters:
-
TIMx Timer instance ClockDivision This parameter can be one of the following values: - LL_TIM_CLOCKDIVISION_DIV1
- LL_TIM_CLOCKDIVISION_DIV2
- LL_TIM_CLOCKDIVISION_DIV4
- Return values:
-
None
Definition at line 1536 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_SetCounter | ( | TIM_TypeDef * | TIMx, |
uint32_t | Counter | ||
) |
Set the counter value.
- Note:
- Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a 32 bits counter. CNT CNT LL_TIM_SetCounter
- Parameters:
-
TIMx Timer instance Counter Counter value (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF)
- Return values:
-
None
Definition at line 1567 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_SetCounterMode | ( | TIM_TypeDef * | TIMx, |
uint32_t | CounterMode | ||
) |
Set the timer counter counting mode.
- Note:
- Macro IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to check whether or not the counter mode selection feature is supported by a timer instance. CR1 DIR LL_TIM_SetCounterMode
CR1 CMS LL_TIM_SetCounterMode
- Parameters:
-
TIMx Timer instance CounterMode This parameter can be one of the following values: - LL_TIM_COUNTERMODE_UP
- LL_TIM_COUNTERMODE_DOWN
- LL_TIM_COUNTERMODE_CENTER_UP
- LL_TIM_COUNTERMODE_CENTER_DOWN
- LL_TIM_COUNTERMODE_CENTER_UP_DOWN
- Return values:
-
None
Definition at line 1465 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_SetOnePulseMode | ( | TIM_TypeDef * | TIMx, |
uint32_t | OnePulseMode | ||
) |
Set one pulse mode (one shot v.s.
repetitive). CR1 OPM LL_TIM_SetOnePulseMode
- Parameters:
-
TIMx Timer instance OnePulseMode This parameter can be one of the following values: - LL_TIM_ONEPULSEMODE_SINGLE
- LL_TIM_ONEPULSEMODE_REPETITIVE
- Return values:
-
None
Definition at line 1431 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_SetPrescaler | ( | TIM_TypeDef * | TIMx, |
uint32_t | Prescaler | ||
) |
Set the prescaler value.
- Note:
- The counter clock frequency CK_CNT is equal to fCK_PSC / (PSC[15:0] + 1).
- The prescaler can be changed on the fly as this control register is buffered. The new prescaler ratio is taken into account at the next update event.
- Helper macro __LL_TIM_CALC_PSC can be used to calculate the Prescaler parameter PSC PSC LL_TIM_SetPrescaler
- Parameters:
-
TIMx Timer instance Prescaler between Min_Data=0 and Max_Data=65535
- Return values:
-
None
Definition at line 1609 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_SetRepetitionCounter | ( | TIM_TypeDef * | TIMx, |
uint32_t | RepetitionCounter | ||
) |
Set the repetition counter value.
- Note:
- For advanced timer instances RepetitionCounter can be up to 65535.
- Macro IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a repetition counter. RCR REP LL_TIM_SetRepetitionCounter
- Parameters:
-
TIMx Timer instance RepetitionCounter between Min_Data=0 and Max_Data=255
- Return values:
-
None
Definition at line 1664 of file stm32l4xx_ll_tim.h.
__STATIC_INLINE void LL_TIM_SetUpdateSource | ( | TIM_TypeDef * | TIMx, |
uint32_t | UpdateSource | ||
) |
Set update event source.
- Note:
- Update event source set to LL_TIM_UPDATESOURCE_REGULAR: any of the following events generate an update interrupt or DMA request if enabled:
- Counter overflow/underflow
- Setting the UG bit
- Update generation through the slave mode controller
- Update event source set to LL_TIM_UPDATESOURCE_COUNTER: only counter overflow/underflow generates an update interrupt or DMA request if enabled. CR1 URS LL_TIM_SetUpdateSource
- Parameters:
-
TIMx Timer instance UpdateSource This parameter can be one of the following values: - LL_TIM_UPDATESOURCE_REGULAR
- LL_TIM_UPDATESOURCE_COUNTER
- Return values:
-
None
Definition at line 1404 of file stm32l4xx_ll_tim.h.
Generated on Tue Jul 12 2022 11:00:16 by
