STM32F439xx HAL User Manual
Functions
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.
__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.
__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.

Function Documentation

__STATIC_INLINE void LL_TIM_DisableARRPreload ( TIM_TypeDef *  TIMx)

Disable auto-reload (ARR) preload.

Reference Manual to LL API cross reference:
CR1 ARPE LL_TIM_DisableARRPreload
Parameters:
TIMxTimer instance
Return values:
None

Definition at line 1244 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE void LL_TIM_DisableCounter ( TIM_TypeDef *  TIMx)

Disable timer counter.

Reference Manual to LL API cross reference:
CR1 CEN LL_TIM_DisableCounter
Parameters:
TIMxTimer instance
Return values:
None

Definition at line 1076 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE void LL_TIM_DisableUpdateEvent ( TIM_TypeDef *  TIMx)

Disable update event generation.

Reference Manual to LL API cross reference:
CR1 UDIS LL_TIM_DisableUpdateEvent
Parameters:
TIMxTimer instance
Return values:
None

Definition at line 1109 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE void LL_TIM_EnableARRPreload ( TIM_TypeDef *  TIMx)

Enable auto-reload (ARR) preload.

Reference Manual to LL API cross reference:
CR1 ARPE LL_TIM_EnableARRPreload
Parameters:
TIMxTimer instance
Return values:
None

Definition at line 1233 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE void LL_TIM_EnableCounter ( TIM_TypeDef *  TIMx)

Enable timer counter.

Reference Manual to LL API cross reference:
CR1 CEN LL_TIM_EnableCounter
Parameters:
TIMxTimer instance
Return values:
None

Definition at line 1065 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE void LL_TIM_EnableUpdateEvent ( TIM_TypeDef *  TIMx)

Enable update event generation.

Reference Manual to LL API cross reference:
CR1 UDIS LL_TIM_EnableUpdateEvent
Parameters:
TIMxTimer instance
Return values:
None

Definition at line 1098 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE uint32_t LL_TIM_GetAutoReload ( TIM_TypeDef *  TIMx)

Get the auto-reload value.

Reference Manual to LL API cross reference:
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 1386 of file stm32f4xx_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.
Reference Manual to LL API cross reference:
CR1 CKD LL_TIM_GetClockDivision
Parameters:
TIMxTimer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 1290 of file stm32f4xx_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.
Reference Manual to LL API cross reference:
CNT CNT LL_TIM_GetCounter
Parameters:
TIMxTimer instance
Return values:
Countervalue (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF)

Definition at line 1317 of file stm32f4xx_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.
Reference Manual to LL API cross reference:
CR1 DIR LL_TIM_GetCounterMode
CR1 CMS LL_TIM_GetCounterMode
Parameters:
TIMxTimer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 1222 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE uint32_t LL_TIM_GetDirection ( TIM_TypeDef *  TIMx)

Get the current direction of the counter.

Reference Manual to LL API cross reference:
CR1 DIR LL_TIM_GetDirection
Parameters:
TIMxTimer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 1330 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE uint32_t LL_TIM_GetOnePulseMode ( TIM_TypeDef *  TIMx)

Get actual one pulse mode.

Reference Manual to LL API cross reference:
CR1 OPM LL_TIM_GetOnePulseMode
Parameters:
TIMxTimer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 1181 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE uint32_t LL_TIM_GetPrescaler ( TIM_TypeDef *  TIMx)

Get the prescaler value.

Reference Manual to LL API cross reference:
PSC PSC LL_TIM_GetPrescaler
Parameters:
TIMxTimer instance
Return values:
Prescalervalue between Min_Data=0 and Max_Data=65535

Definition at line 1357 of file stm32f4xx_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.
Reference Manual to LL API cross reference:
RCR REP LL_TIM_GetRepetitionCounter
Parameters:
TIMxTimer instance
Return values:
Repetitioncounter value

Definition at line 1413 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE uint32_t LL_TIM_GetUpdateSource ( TIM_TypeDef *  TIMx)

Get actual event update source.

Reference Manual to LL API cross reference:
CR1 URS LL_TIM_GetUpdateSource
Parameters:
TIMxTimer instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 1154 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE uint32_t LL_TIM_IsEnabledARRPreload ( TIM_TypeDef *  TIMx)

Indicates whether auto-reload (ARR) preload is enabled.

Reference Manual to LL API cross reference:
CR1 ARPE LL_TIM_IsEnabledARRPreload
Parameters:
TIMxTimer instance
Return values:
Stateof bit (1 or 0).

Definition at line 1255 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE uint32_t LL_TIM_IsEnabledCounter ( TIM_TypeDef *  TIMx)

Indicates whether the timer counter is enabled.

Reference Manual to LL API cross reference:
CR1 CEN LL_TIM_IsEnabledCounter
Parameters:
TIMxTimer instance
Return values:
Stateof bit (1 or 0).

Definition at line 1087 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE uint32_t LL_TIM_IsEnabledUpdateEvent ( TIM_TypeDef *  TIMx)

Indicates whether update event generation is enabled.

Reference Manual to LL API cross reference:
CR1 UDIS LL_TIM_IsEnabledUpdateEvent
Parameters:
TIMxTimer instance
Return values:
Invertedstate of bit (0 or 1).

Definition at line 1120 of file stm32f4xx_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
Reference Manual to LL API cross reference:
ARR ARR LL_TIM_SetAutoReload
Parameters:
TIMxTimer instance
AutoReloadbetween Min_Data=0 and Max_Data=65535
Return values:
None

Definition at line 1373 of file stm32f4xx_ll_tim.h.

Referenced by LL_TIM_Init().

__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.
Reference Manual to LL API cross reference:
CR1 CKD LL_TIM_SetClockDivision
Parameters:
TIMxTimer instance
ClockDivisionThis parameter can be one of the following values:
Return values:
None

Definition at line 1273 of file stm32f4xx_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.
Reference Manual to LL API cross reference:
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 1304 of file stm32f4xx_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.
Reference Manual to LL API cross reference:
CR1 DIR LL_TIM_SetCounterMode
CR1 CMS LL_TIM_SetCounterMode
Parameters:
TIMxTimer instance
CounterModeThis parameter can be one of the following values:
Return values:
None

Definition at line 1202 of file stm32f4xx_ll_tim.h.

__STATIC_INLINE void LL_TIM_SetOnePulseMode ( TIM_TypeDef *  TIMx,
uint32_t  OnePulseMode 
)

Set one pulse mode (one shot v.s.

repetitive).

Reference Manual to LL API cross reference:
CR1 OPM LL_TIM_SetOnePulseMode
Parameters:
TIMxTimer instance
OnePulseModeThis parameter can be one of the following values:
Return values:
None

Definition at line 1168 of file stm32f4xx_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
Reference Manual to LL API cross reference:
PSC PSC LL_TIM_SetPrescaler
Parameters:
TIMxTimer instance
Prescalerbetween Min_Data=0 and Max_Data=65535
Return values:
None

Definition at line 1346 of file stm32f4xx_ll_tim.h.

Referenced by LL_TIM_Init().

__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.
Reference Manual to LL API cross reference:
RCR REP LL_TIM_SetRepetitionCounter
Parameters:
TIMxTimer instance
RepetitionCounterbetween Min_Data=0 and Max_Data=255
Return values:
None

Definition at line 1400 of file stm32f4xx_ll_tim.h.

Referenced by LL_TIM_Init().

__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.
Reference Manual to LL API cross reference:
CR1 URS LL_TIM_SetUpdateSource
Parameters:
TIMxTimer instance
UpdateSourceThis parameter can be one of the following values:
Return values:
None

Definition at line 1141 of file stm32f4xx_ll_tim.h.