STM32F4xx_HAL_Driver  1.8.3
Time Base configuration
+ Collaboration diagram for Time Base configuration:

Functions

__STATIC_INLINE void LL_TIM_EnableCounter (TIM_TypeDef *TIMx)
 Enable timer counter. @rmtoll CR1 CEN LL_TIM_EnableCounter. More...
 
__STATIC_INLINE void LL_TIM_DisableCounter (TIM_TypeDef *TIMx)
 Disable timer counter. @rmtoll CR1 CEN LL_TIM_DisableCounter. More...
 
__STATIC_INLINE uint32_t LL_TIM_IsEnabledCounter (const TIM_TypeDef *TIMx)
 Indicates whether the timer counter is enabled. @rmtoll CR1 CEN LL_TIM_IsEnabledCounter. More...
 
__STATIC_INLINE void LL_TIM_EnableUpdateEvent (TIM_TypeDef *TIMx)
 Enable update event generation. @rmtoll CR1 UDIS LL_TIM_EnableUpdateEvent. More...
 
__STATIC_INLINE void LL_TIM_DisableUpdateEvent (TIM_TypeDef *TIMx)
 Disable update event generation. @rmtoll CR1 UDIS LL_TIM_DisableUpdateEvent. More...
 
__STATIC_INLINE uint32_t LL_TIM_IsEnabledUpdateEvent (const TIM_TypeDef *TIMx)
 Indicates whether update event generation is enabled. @rmtoll CR1 UDIS LL_TIM_IsEnabledUpdateEvent. More...
 
__STATIC_INLINE void LL_TIM_SetUpdateSource (TIM_TypeDef *TIMx, uint32_t UpdateSource)
 Set update event source. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetUpdateSource (const TIM_TypeDef *TIMx)
 Get actual event update source @rmtoll CR1 URS LL_TIM_GetUpdateSource. More...
 
__STATIC_INLINE void LL_TIM_SetOnePulseMode (TIM_TypeDef *TIMx, uint32_t OnePulseMode)
 Set one pulse mode (one shot v.s. repetitive). @rmtoll CR1 OPM LL_TIM_SetOnePulseMode. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetOnePulseMode (const TIM_TypeDef *TIMx)
 Get actual one pulse mode. @rmtoll CR1 OPM LL_TIM_GetOnePulseMode. More...
 
__STATIC_INLINE void LL_TIM_SetCounterMode (TIM_TypeDef *TIMx, uint32_t CounterMode)
 Set the timer counter counting mode. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetCounterMode (const TIM_TypeDef *TIMx)
 Get actual counter mode. More...
 
__STATIC_INLINE void LL_TIM_EnableARRPreload (TIM_TypeDef *TIMx)
 Enable auto-reload (ARR) preload. @rmtoll CR1 ARPE LL_TIM_EnableARRPreload. More...
 
__STATIC_INLINE void LL_TIM_DisableARRPreload (TIM_TypeDef *TIMx)
 Disable auto-reload (ARR) preload. @rmtoll CR1 ARPE LL_TIM_DisableARRPreload. More...
 
__STATIC_INLINE uint32_t LL_TIM_IsEnabledARRPreload (const TIM_TypeDef *TIMx)
 Indicates whether auto-reload (ARR) preload is enabled. @rmtoll CR1 ARPE LL_TIM_IsEnabledARRPreload. More...
 
__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. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetClockDivision (const 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. More...
 
__STATIC_INLINE void LL_TIM_SetCounter (TIM_TypeDef *TIMx, uint32_t Counter)
 Set the counter value. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetCounter (const TIM_TypeDef *TIMx)
 Get the counter value. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetDirection (const TIM_TypeDef *TIMx)
 Get the current direction of the counter @rmtoll CR1 DIR LL_TIM_GetDirection. More...
 
__STATIC_INLINE void LL_TIM_SetPrescaler (TIM_TypeDef *TIMx, uint32_t Prescaler)
 Set the prescaler value. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetPrescaler (const TIM_TypeDef *TIMx)
 Get the prescaler value. @rmtoll PSC PSC LL_TIM_GetPrescaler. More...
 
__STATIC_INLINE void LL_TIM_SetAutoReload (TIM_TypeDef *TIMx, uint32_t AutoReload)
 Set the auto-reload value. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetAutoReload (const TIM_TypeDef *TIMx)
 Get the auto-reload value. @rmtoll ARR ARR LL_TIM_GetAutoReload. More...
 
__STATIC_INLINE void LL_TIM_SetRepetitionCounter (TIM_TypeDef *TIMx, uint32_t RepetitionCounter)
 Set the repetition counter value. More...
 
__STATIC_INLINE uint32_t LL_TIM_GetRepetitionCounter (const TIM_TypeDef *TIMx)
 Get the repetition counter value. More...
 

Detailed Description

Function Documentation

◆ LL_TIM_DisableARRPreload()

__STATIC_INLINE void LL_TIM_DisableARRPreload ( TIM_TypeDef *  TIMx)

Disable auto-reload (ARR) preload. @rmtoll CR1 ARPE LL_TIM_DisableARRPreload.

Parameters
TIMxTimer instance
Return values
None

Definition at line 1307 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_DisableCounter()

__STATIC_INLINE void LL_TIM_DisableCounter ( TIM_TypeDef *  TIMx)

Disable timer counter. @rmtoll CR1 CEN LL_TIM_DisableCounter.

Parameters
TIMxTimer instance
Return values
None

Definition at line 1127 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_DisableUpdateEvent()

__STATIC_INLINE void LL_TIM_DisableUpdateEvent ( TIM_TypeDef *  TIMx)

Disable update event generation. @rmtoll CR1 UDIS LL_TIM_DisableUpdateEvent.

Parameters
TIMxTimer instance
Return values
None

Definition at line 1160 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_EnableARRPreload()

__STATIC_INLINE void LL_TIM_EnableARRPreload ( TIM_TypeDef *  TIMx)

Enable auto-reload (ARR) preload. @rmtoll CR1 ARPE LL_TIM_EnableARRPreload.

Parameters
TIMxTimer instance
Return values
None

Definition at line 1296 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_EnableCounter()

__STATIC_INLINE void LL_TIM_EnableCounter ( TIM_TypeDef *  TIMx)

Enable timer counter. @rmtoll CR1 CEN LL_TIM_EnableCounter.

Parameters
TIMxTimer instance
Return values
None

Definition at line 1116 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_EnableUpdateEvent()

__STATIC_INLINE void LL_TIM_EnableUpdateEvent ( TIM_TypeDef *  TIMx)

Enable update event generation. @rmtoll CR1 UDIS LL_TIM_EnableUpdateEvent.

Parameters
TIMxTimer instance
Return values
None

Definition at line 1149 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetAutoReload()

__STATIC_INLINE uint32_t LL_TIM_GetAutoReload ( const TIM_TypeDef *  TIMx)

Get the auto-reload value. @rmtoll 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
TIMxTimer instance
Return values
Auto-reloadvalue

Definition at line 1451 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetClockDivision()

__STATIC_INLINE uint32_t LL_TIM_GetClockDivision ( const 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. @rmtoll CR1 CKD LL_TIM_GetClockDivision
Parameters
TIMxTimer instance
Return values
Returnedvalue can be one of the following values:
  • LL_TIM_CLOCKDIVISION_DIV1
  • LL_TIM_CLOCKDIVISION_DIV2
  • LL_TIM_CLOCKDIVISION_DIV4

Definition at line 1355 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetCounter()

__STATIC_INLINE uint32_t LL_TIM_GetCounter ( const 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. @rmtoll CNT CNT LL_TIM_GetCounter
Parameters
TIMxTimer instance
Return values
Countervalue (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF)

Definition at line 1382 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetCounterMode()

__STATIC_INLINE uint32_t LL_TIM_GetCounterMode ( const 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. @rmtoll CR1 DIR LL_TIM_GetCounterMode
CR1 CMS LL_TIM_GetCounterMode
Parameters
TIMxTimer instance
Return values
Returnedvalue 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 1276 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetDirection()

__STATIC_INLINE uint32_t LL_TIM_GetDirection ( const TIM_TypeDef *  TIMx)

Get the current direction of the counter @rmtoll CR1 DIR LL_TIM_GetDirection.

Parameters
TIMxTimer instance
Return values
Returnedvalue can be one of the following values:
  • LL_TIM_COUNTERDIRECTION_UP
  • LL_TIM_COUNTERDIRECTION_DOWN

Definition at line 1395 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetOnePulseMode()

__STATIC_INLINE uint32_t LL_TIM_GetOnePulseMode ( const TIM_TypeDef *  TIMx)

Get actual one pulse mode. @rmtoll CR1 OPM LL_TIM_GetOnePulseMode.

Parameters
TIMxTimer instance
Return values
Returnedvalue can be one of the following values:
  • LL_TIM_ONEPULSEMODE_SINGLE
  • LL_TIM_ONEPULSEMODE_REPETITIVE

Definition at line 1232 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetPrescaler()

__STATIC_INLINE uint32_t LL_TIM_GetPrescaler ( const TIM_TypeDef *  TIMx)

Get the prescaler value. @rmtoll PSC PSC LL_TIM_GetPrescaler.

Parameters
TIMxTimer instance
Return values
Prescalervalue between Min_Data=0 and Max_Data=65535

Definition at line 1422 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetRepetitionCounter()

__STATIC_INLINE uint32_t LL_TIM_GetRepetitionCounter ( const 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. @rmtoll RCR REP LL_TIM_GetRepetitionCounter
Parameters
TIMxTimer instance
Return values
Repetitioncounter value

Definition at line 1478 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_GetUpdateSource()

__STATIC_INLINE uint32_t LL_TIM_GetUpdateSource ( const TIM_TypeDef *  TIMx)

Get actual event update source @rmtoll CR1 URS LL_TIM_GetUpdateSource.

Parameters
TIMxTimer instance
Return values
Returnedvalue can be one of the following values:
  • LL_TIM_UPDATESOURCE_REGULAR
  • LL_TIM_UPDATESOURCE_COUNTER

Definition at line 1205 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_IsEnabledARRPreload()

__STATIC_INLINE uint32_t LL_TIM_IsEnabledARRPreload ( const TIM_TypeDef *  TIMx)

Indicates whether auto-reload (ARR) preload is enabled. @rmtoll CR1 ARPE LL_TIM_IsEnabledARRPreload.

Parameters
TIMxTimer instance
Return values
Stateof bit (1 or 0).

Definition at line 1318 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_IsEnabledCounter()

__STATIC_INLINE uint32_t LL_TIM_IsEnabledCounter ( const TIM_TypeDef *  TIMx)

Indicates whether the timer counter is enabled. @rmtoll CR1 CEN LL_TIM_IsEnabledCounter.

Parameters
TIMxTimer instance
Return values
Stateof bit (1 or 0).

Definition at line 1138 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_IsEnabledUpdateEvent()

__STATIC_INLINE uint32_t LL_TIM_IsEnabledUpdateEvent ( const TIM_TypeDef *  TIMx)

Indicates whether update event generation is enabled. @rmtoll CR1 UDIS LL_TIM_IsEnabledUpdateEvent.

Parameters
TIMxTimer instance
Return values
Invertedstate of bit (0 or 1).

Definition at line 1171 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_SetAutoReload()

__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 @rmtoll ARR ARR LL_TIM_SetAutoReload
Parameters
TIMxTimer instance
AutoReloadbetween Min_Data=0 and Max_Data=65535
Return values
None

Definition at line 1438 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_SetClockDivision()

__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. @rmtoll CR1 CKD LL_TIM_SetClockDivision
Parameters
TIMxTimer instance
ClockDivisionThis 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 1337 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_SetCounter()

__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. @rmtoll CNT CNT LL_TIM_SetCounter
Parameters
TIMxTimer instance
CounterCounter value (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF)
Return values
None

Definition at line 1369 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_SetCounterMode()

__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.
Switching from Center Aligned counter mode to Edge counter mode (or reverse) requires a timer reset to avoid unexpected direction due to DIR bit readonly in center aligned mode. @rmtoll CR1 DIR LL_TIM_SetCounterMode
CR1 CMS LL_TIM_SetCounterMode
Parameters
TIMxTimer instance
CounterModeThis 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 1256 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_SetOnePulseMode()

__STATIC_INLINE void LL_TIM_SetOnePulseMode ( TIM_TypeDef *  TIMx,
uint32_t  OnePulseMode 
)

Set one pulse mode (one shot v.s. repetitive). @rmtoll CR1 OPM LL_TIM_SetOnePulseMode.

Parameters
TIMxTimer instance
OnePulseModeThis parameter can be one of the following values:
  • LL_TIM_ONEPULSEMODE_SINGLE
  • LL_TIM_ONEPULSEMODE_REPETITIVE
Return values
None

Definition at line 1219 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_SetPrescaler()

__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 @rmtoll PSC PSC LL_TIM_SetPrescaler
Parameters
TIMxTimer instance
Prescalerbetween Min_Data=0 and Max_Data=65535
Return values
None

Definition at line 1411 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_SetRepetitionCounter()

__STATIC_INLINE void LL_TIM_SetRepetitionCounter ( TIM_TypeDef *  TIMx,
uint32_t  RepetitionCounter 
)

Set 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. @rmtoll RCR REP LL_TIM_SetRepetitionCounter
Parameters
TIMxTimer instance
RepetitionCounterbetween Min_Data=0 and Max_Data=255 or 65535 for advanced timer.
Return values
None

Definition at line 1465 of file stm32f4xx_ll_tim.h.

◆ LL_TIM_SetUpdateSource()

__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. @rmtoll CR1 URS LL_TIM_SetUpdateSource
Parameters
TIMxTimer instance
UpdateSourceThis parameter can be one of the following values:
  • LL_TIM_UPDATESOURCE_REGULAR
  • LL_TIM_UPDATESOURCE_COUNTER
Return values
None

Definition at line 1192 of file stm32f4xx_ll_tim.h.