STM32L4xx_HAL_Driver  1.14.0
Timer synchronisation configuration

Functions

__STATIC_INLINE void LL_TIM_SetTriggerOutput (TIM_TypeDef *TIMx, uint32_t TimerSynchronization)
 Set the trigger output (TRGO) used for timer synchronization . More...
 
__STATIC_INLINE void LL_TIM_SetTriggerOutput2 (TIM_TypeDef *TIMx, uint32_t ADCSynchronization)
 Set the trigger output 2 (TRGO2) used for ADC synchronization . More...
 
__STATIC_INLINE void LL_TIM_SetSlaveMode (TIM_TypeDef *TIMx, uint32_t SlaveMode)
 Set the synchronization mode of a slave timer. More...
 
__STATIC_INLINE void LL_TIM_SetTriggerInput (TIM_TypeDef *TIMx, uint32_t TriggerInput)
 Set the selects the trigger input to be used to synchronize the counter. More...
 
__STATIC_INLINE void LL_TIM_EnableMasterSlaveMode (TIM_TypeDef *TIMx)
 Enable the Master/Slave mode. More...
 
__STATIC_INLINE void LL_TIM_DisableMasterSlaveMode (TIM_TypeDef *TIMx)
 Disable the Master/Slave mode. More...
 
__STATIC_INLINE uint32_t LL_TIM_IsEnabledMasterSlaveMode (TIM_TypeDef *TIMx)
 Indicates whether the Master/Slave mode is enabled. More...
 
__STATIC_INLINE void LL_TIM_ConfigETR (TIM_TypeDef *TIMx, uint32_t ETRPolarity, uint32_t ETRPrescaler, uint32_t ETRFilter)
 Configure the external trigger (ETR) input. More...
 
__STATIC_INLINE void LL_TIM_SetETRSource (TIM_TypeDef *TIMx, uint32_t ETRSource)
 Select the external trigger (ETR) input source. More...
 

Detailed Description

Function Documentation

◆ LL_TIM_ConfigETR()

__STATIC_INLINE void LL_TIM_ConfigETR ( TIM_TypeDef *  TIMx,
uint32_t  ETRPolarity,
uint32_t  ETRPrescaler,
uint32_t  ETRFilter 
)

Configure the external trigger (ETR) input.

Note
Macro IS_TIM_ETR_INSTANCE(TIMx) can be used to check whether or not a timer instance provides an external trigger input. SMCR ETP LL_TIM_ConfigETR
SMCR ETPS LL_TIM_ConfigETR
SMCR ETF LL_TIM_ConfigETR
Parameters
TIMxTimer instance
ETRPolarityThis parameter can be one of the following values:
  • LL_TIM_ETR_POLARITY_NONINVERTED
  • LL_TIM_ETR_POLARITY_INVERTED
ETRPrescalerThis parameter can be one of the following values:
  • LL_TIM_ETR_PRESCALER_DIV1
  • LL_TIM_ETR_PRESCALER_DIV2
  • LL_TIM_ETR_PRESCALER_DIV4
  • LL_TIM_ETR_PRESCALER_DIV8
ETRFilterThis parameter can be one of the following values:
  • LL_TIM_ETR_FILTER_FDIV1
  • LL_TIM_ETR_FILTER_FDIV1_N2
  • LL_TIM_ETR_FILTER_FDIV1_N4
  • LL_TIM_ETR_FILTER_FDIV1_N8
  • LL_TIM_ETR_FILTER_FDIV2_N6
  • LL_TIM_ETR_FILTER_FDIV2_N8
  • LL_TIM_ETR_FILTER_FDIV4_N6
  • LL_TIM_ETR_FILTER_FDIV4_N8
  • LL_TIM_ETR_FILTER_FDIV8_N6
  • LL_TIM_ETR_FILTER_FDIV8_N8
  • LL_TIM_ETR_FILTER_FDIV16_N5
  • LL_TIM_ETR_FILTER_FDIV16_N6
  • LL_TIM_ETR_FILTER_FDIV16_N8
  • LL_TIM_ETR_FILTER_FDIV32_N5
  • LL_TIM_ETR_FILTER_FDIV32_N6
  • LL_TIM_ETR_FILTER_FDIV32_N8
Return values
None

Definition at line 3382 of file stm32l4xx_ll_tim.h.

3384 {
3385  MODIFY_REG(TIMx->SMCR, TIM_SMCR_ETP | TIM_SMCR_ETPS | TIM_SMCR_ETF, ETRPolarity | ETRPrescaler | ETRFilter);
3386 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_DisableMasterSlaveMode()

__STATIC_INLINE void LL_TIM_DisableMasterSlaveMode ( TIM_TypeDef *  TIMx)

Disable the Master/Slave mode.

Note
Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not a timer instance can operate as a slave timer. SMCR MSM LL_TIM_DisableMasterSlaveMode
Parameters
TIMxTimer instance
Return values
None

Definition at line 3329 of file stm32l4xx_ll_tim.h.

3330 {
3331  CLEAR_BIT(TIMx->SMCR, TIM_SMCR_MSM);
3332 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_TIM_EnableMasterSlaveMode()

__STATIC_INLINE void LL_TIM_EnableMasterSlaveMode ( TIM_TypeDef *  TIMx)

Enable the Master/Slave mode.

Note
Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not a timer instance can operate as a slave timer. SMCR MSM LL_TIM_EnableMasterSlaveMode
Parameters
TIMxTimer instance
Return values
None

Definition at line 3316 of file stm32l4xx_ll_tim.h.

3317 {
3318  SET_BIT(TIMx->SMCR, TIM_SMCR_MSM);
3319 }

◆ LL_TIM_IsEnabledMasterSlaveMode()

__STATIC_INLINE uint32_t LL_TIM_IsEnabledMasterSlaveMode ( TIM_TypeDef *  TIMx)

Indicates whether the Master/Slave mode is enabled.

Note
Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not a timer instance can operate as a slave timer. SMCR MSM LL_TIM_IsEnabledMasterSlaveMode
Parameters
TIMxTimer instance
Return values
Stateof bit (1 or 0).

Definition at line 3342 of file stm32l4xx_ll_tim.h.

3343 {
3344  return ((READ_BIT(TIMx->SMCR, TIM_SMCR_MSM) == (TIM_SMCR_MSM)) ? 1UL : 0UL);
3345 }

◆ LL_TIM_SetETRSource()

__STATIC_INLINE void LL_TIM_SetETRSource ( TIM_TypeDef *  TIMx,
uint32_t  ETRSource 
)

Select the external trigger (ETR) input source.

Note
Macro IS_TIM_ETRSEL_INSTANCE(TIMx) can be used to check whether or not a timer instance supports ETR source selection. OR2 ETRSEL LL_TIM_SetETRSource
Parameters
TIMxTimer instance
ETRSourceThis parameter can be one of the following values:
  • LL_TIM_ETRSOURCE_LEGACY
  • LL_TIM_ETRSOURCE_COMP1
  • LL_TIM_ETRSOURCE_COMP2
Return values
None

Definition at line 3400 of file stm32l4xx_ll_tim.h.

3401 {
3402 
3403  MODIFY_REG(TIMx->OR2, TIMx_OR2_ETRSEL, ETRSource);
3404 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_SetSlaveMode()

__STATIC_INLINE void LL_TIM_SetSlaveMode ( TIM_TypeDef *  TIMx,
uint32_t  SlaveMode 
)

Set the synchronization mode of a slave timer.

Note
Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not a timer instance can operate as a slave timer. SMCR SMS LL_TIM_SetSlaveMode
Parameters
TIMxTimer instance
SlaveModeThis parameter can be one of the following values:
  • LL_TIM_SLAVEMODE_DISABLED
  • LL_TIM_SLAVEMODE_RESET
  • LL_TIM_SLAVEMODE_GATED
  • LL_TIM_SLAVEMODE_TRIGGER
  • LL_TIM_SLAVEMODE_COMBINED_RESETTRIGGER
Return values
None

Definition at line 3281 of file stm32l4xx_ll_tim.h.

3282 {
3283  MODIFY_REG(TIMx->SMCR, TIM_SMCR_SMS, SlaveMode);
3284 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_SetTriggerInput()

__STATIC_INLINE void LL_TIM_SetTriggerInput ( TIM_TypeDef *  TIMx,
uint32_t  TriggerInput 
)

Set the selects the trigger input to be used to synchronize the counter.

Note
Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not a timer instance can operate as a slave timer. SMCR TS LL_TIM_SetTriggerInput
Parameters
TIMxTimer instance
TriggerInputThis parameter can be one of the following values:
  • LL_TIM_TS_ITR0
  • LL_TIM_TS_ITR1
  • LL_TIM_TS_ITR2
  • LL_TIM_TS_ITR3
  • LL_TIM_TS_TI1F_ED
  • LL_TIM_TS_TI1FP1
  • LL_TIM_TS_TI2FP2
  • LL_TIM_TS_ETRF
Return values
None

Definition at line 3303 of file stm32l4xx_ll_tim.h.

3304 {
3305  MODIFY_REG(TIMx->SMCR, TIM_SMCR_TS, TriggerInput);
3306 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_SetTriggerOutput()

__STATIC_INLINE void LL_TIM_SetTriggerOutput ( TIM_TypeDef *  TIMx,
uint32_t  TimerSynchronization 
)

Set the trigger output (TRGO) used for timer synchronization .

Note
Macro IS_TIM_MASTER_INSTANCE(TIMx) can be used to check whether or not a timer instance can operate as a master timer. CR2 MMS LL_TIM_SetTriggerOutput
Parameters
TIMxTimer instance
TimerSynchronizationThis parameter can be one of the following values:
  • LL_TIM_TRGO_RESET
  • LL_TIM_TRGO_ENABLE
  • LL_TIM_TRGO_UPDATE
  • LL_TIM_TRGO_CC1IF
  • LL_TIM_TRGO_OC1REF
  • LL_TIM_TRGO_OC2REF
  • LL_TIM_TRGO_OC3REF
  • LL_TIM_TRGO_OC4REF
Return values
None

Definition at line 3232 of file stm32l4xx_ll_tim.h.

3233 {
3234  MODIFY_REG(TIMx->CR2, TIM_CR2_MMS, TimerSynchronization);
3235 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_SetTriggerOutput2()

__STATIC_INLINE void LL_TIM_SetTriggerOutput2 ( TIM_TypeDef *  TIMx,
uint32_t  ADCSynchronization 
)

Set the trigger output 2 (TRGO2) used for ADC synchronization .

Note
Macro IS_TIM_TRGO2_INSTANCE(TIMx) can be used to check whether or not a timer instance can be used for ADC synchronization. CR2 MMS2 LL_TIM_SetTriggerOutput2
Parameters
TIMxTimer Instance
ADCSynchronizationThis parameter can be one of the following values:
  • LL_TIM_TRGO2_RESET
  • LL_TIM_TRGO2_ENABLE
  • LL_TIM_TRGO2_UPDATE
  • LL_TIM_TRGO2_CC1F
  • LL_TIM_TRGO2_OC1
  • LL_TIM_TRGO2_OC2
  • LL_TIM_TRGO2_OC3
  • LL_TIM_TRGO2_OC4
  • LL_TIM_TRGO2_OC5
  • LL_TIM_TRGO2_OC6
  • LL_TIM_TRGO2_OC4_RISINGFALLING
  • LL_TIM_TRGO2_OC6_RISINGFALLING
  • LL_TIM_TRGO2_OC4_RISING_OC6_RISING
  • LL_TIM_TRGO2_OC4_RISING_OC6_FALLING
  • LL_TIM_TRGO2_OC5_RISING_OC6_RISING
  • LL_TIM_TRGO2_OC5_RISING_OC6_FALLING
Return values
None

Definition at line 3262 of file stm32l4xx_ll_tim.h.

3263 {
3264  MODIFY_REG(TIMx->CR2, TIM_CR2_MMS2, ADCSynchronization);
3265 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)