STM32L4xx_HAL_Driver  1.14.0
Break function configuration

Functions

__STATIC_INLINE void LL_TIM_EnableBRK (TIM_TypeDef *TIMx)
 Enable the break function. More...
 
__STATIC_INLINE void LL_TIM_DisableBRK (TIM_TypeDef *TIMx)
 Disable the break function. BDTR BKE LL_TIM_DisableBRK. More...
 
__STATIC_INLINE void LL_TIM_ConfigBRK (TIM_TypeDef *TIMx, uint32_t BreakPolarity, uint32_t BreakFilter)
 Configure the break input. More...
 
__STATIC_INLINE void LL_TIM_EnableBRK2 (TIM_TypeDef *TIMx)
 Enable the break 2 function. More...
 
__STATIC_INLINE void LL_TIM_DisableBRK2 (TIM_TypeDef *TIMx)
 Disable the break 2 function. More...
 
__STATIC_INLINE void LL_TIM_ConfigBRK2 (TIM_TypeDef *TIMx, uint32_t Break2Polarity, uint32_t Break2Filter)
 Configure the break 2 input. More...
 
__STATIC_INLINE void LL_TIM_SetOffStates (TIM_TypeDef *TIMx, uint32_t OffStateIdle, uint32_t OffStateRun)
 Select the outputs off state (enabled v.s. disabled) in Idle and Run modes. More...
 
__STATIC_INLINE void LL_TIM_EnableAutomaticOutput (TIM_TypeDef *TIMx)
 Enable automatic output (MOE can be set by software or automatically when a break input is active). More...
 
__STATIC_INLINE void LL_TIM_DisableAutomaticOutput (TIM_TypeDef *TIMx)
 Disable automatic output (MOE can be set only by software). More...
 
__STATIC_INLINE uint32_t LL_TIM_IsEnabledAutomaticOutput (TIM_TypeDef *TIMx)
 Indicate whether automatic output is enabled. More...
 
__STATIC_INLINE void LL_TIM_EnableAllOutputs (TIM_TypeDef *TIMx)
 Enable the outputs (set the MOE bit in TIMx_BDTR register). More...
 
__STATIC_INLINE void LL_TIM_DisableAllOutputs (TIM_TypeDef *TIMx)
 Disable the outputs (reset the MOE bit in TIMx_BDTR register). More...
 
__STATIC_INLINE uint32_t LL_TIM_IsEnabledAllOutputs (TIM_TypeDef *TIMx)
 Indicates whether outputs are enabled. More...
 
__STATIC_INLINE void LL_TIM_EnableBreakInputSource (TIM_TypeDef *TIMx, uint32_t BreakInput, uint32_t Source)
 Enable the signals connected to the designated timer break input. More...
 
__STATIC_INLINE void LL_TIM_DisableBreakInputSource (TIM_TypeDef *TIMx, uint32_t BreakInput, uint32_t Source)
 Disable the signals connected to the designated timer break input. More...
 
__STATIC_INLINE void LL_TIM_SetBreakInputSourcePolarity (TIM_TypeDef *TIMx, uint32_t BreakInput, uint32_t Source, uint32_t Polarity)
 Set the polarity of the break signal for the timer break input. More...
 

Detailed Description

Function Documentation

◆ LL_TIM_ConfigBRK()

__STATIC_INLINE void LL_TIM_ConfigBRK ( TIM_TypeDef *  TIMx,
uint32_t  BreakPolarity,
uint32_t  BreakFilter 
)

Configure the break input.

Note
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR BKP LL_TIM_ConfigBRK
BDTR BKF LL_TIM_ConfigBRK
Parameters
TIMxTimer instance
BreakPolarityThis parameter can be one of the following values:
  • LL_TIM_BREAK_POLARITY_LOW
  • LL_TIM_BREAK_POLARITY_HIGH
BreakFilterThis parameter can be one of the following values:
  • LL_TIM_BREAK_FILTER_FDIV1
  • LL_TIM_BREAK_FILTER_FDIV1_N2
  • LL_TIM_BREAK_FILTER_FDIV1_N4
  • LL_TIM_BREAK_FILTER_FDIV1_N8
  • LL_TIM_BREAK_FILTER_FDIV2_N6
  • LL_TIM_BREAK_FILTER_FDIV2_N8
  • LL_TIM_BREAK_FILTER_FDIV4_N6
  • LL_TIM_BREAK_FILTER_FDIV4_N8
  • LL_TIM_BREAK_FILTER_FDIV8_N6
  • LL_TIM_BREAK_FILTER_FDIV8_N8
  • LL_TIM_BREAK_FILTER_FDIV16_N5
  • LL_TIM_BREAK_FILTER_FDIV16_N6
  • LL_TIM_BREAK_FILTER_FDIV16_N8
  • LL_TIM_BREAK_FILTER_FDIV32_N5
  • LL_TIM_BREAK_FILTER_FDIV32_N6
  • LL_TIM_BREAK_FILTER_FDIV32_N8
Return values
None

Definition at line 3468 of file stm32l4xx_ll_tim.h.

3470 {
3471  MODIFY_REG(TIMx->BDTR, TIM_BDTR_BKP | TIM_BDTR_BKF, BreakPolarity | BreakFilter);
3472 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_ConfigBRK2()

__STATIC_INLINE void LL_TIM_ConfigBRK2 ( TIM_TypeDef *  TIMx,
uint32_t  Break2Polarity,
uint32_t  Break2Filter 
)

Configure the break 2 input.

Note
Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a second break input. BDTR BK2P LL_TIM_ConfigBRK2
BDTR BK2F LL_TIM_ConfigBRK2
Parameters
TIMxTimer instance
Break2PolarityThis parameter can be one of the following values:
  • LL_TIM_BREAK2_POLARITY_LOW
  • LL_TIM_BREAK2_POLARITY_HIGH
Break2FilterThis parameter can be one of the following values:
  • LL_TIM_BREAK2_FILTER_FDIV1
  • LL_TIM_BREAK2_FILTER_FDIV1_N2
  • LL_TIM_BREAK2_FILTER_FDIV1_N4
  • LL_TIM_BREAK2_FILTER_FDIV1_N8
  • LL_TIM_BREAK2_FILTER_FDIV2_N6
  • LL_TIM_BREAK2_FILTER_FDIV2_N8
  • LL_TIM_BREAK2_FILTER_FDIV4_N6
  • LL_TIM_BREAK2_FILTER_FDIV4_N8
  • LL_TIM_BREAK2_FILTER_FDIV8_N6
  • LL_TIM_BREAK2_FILTER_FDIV8_N8
  • LL_TIM_BREAK2_FILTER_FDIV16_N5
  • LL_TIM_BREAK2_FILTER_FDIV16_N6
  • LL_TIM_BREAK2_FILTER_FDIV16_N8
  • LL_TIM_BREAK2_FILTER_FDIV32_N5
  • LL_TIM_BREAK2_FILTER_FDIV32_N6
  • LL_TIM_BREAK2_FILTER_FDIV32_N8
Return values
None

Definition at line 3529 of file stm32l4xx_ll_tim.h.

3530 {
3531  MODIFY_REG(TIMx->BDTR, TIM_BDTR_BK2P | TIM_BDTR_BK2F, Break2Polarity | Break2Filter);
3532 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_DisableAllOutputs()

__STATIC_INLINE void LL_TIM_DisableAllOutputs ( TIM_TypeDef *  TIMx)

Disable the outputs (reset the MOE bit in TIMx_BDTR register).

Note
The MOE bit in TIMx_BDTR register allows to enable /disable the outputs by software and is reset in case of break or break2 event.
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR MOE LL_TIM_DisableAllOutputs
Parameters
TIMxTimer instance
Return values
None

Definition at line 3618 of file stm32l4xx_ll_tim.h.

3619 {
3620  CLEAR_BIT(TIMx->BDTR, TIM_BDTR_MOE);
3621 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_TIM_DisableAutomaticOutput()

__STATIC_INLINE void LL_TIM_DisableAutomaticOutput ( TIM_TypeDef *  TIMx)

Disable automatic output (MOE can be set only by software).

Note
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR AOE LL_TIM_DisableAutomaticOutput
Parameters
TIMxTimer instance
Return values
None

Definition at line 3575 of file stm32l4xx_ll_tim.h.

3576 {
3577  CLEAR_BIT(TIMx->BDTR, TIM_BDTR_AOE);
3578 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_TIM_DisableBreakInputSource()

__STATIC_INLINE void LL_TIM_DisableBreakInputSource ( TIM_TypeDef *  TIMx,
uint32_t  BreakInput,
uint32_t  Source 
)

Disable the signals connected to the designated timer break input.

Note
Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether or not a timer instance allows for break input selection. OR2 BKINE LL_TIM_DisableBreakInputSource
OR2 BKCMP1E LL_TIM_DisableBreakInputSource
OR2 BKCMP2E LL_TIM_DisableBreakInputSource
OR2 BKDF1BK0E LL_TIM_DisableBreakInputSource
OR3 BK2INE LL_TIM_DisableBreakInputSource
OR3 BK2CMP1E LL_TIM_DisableBreakInputSource
OR3 BK2CMP2E LL_TIM_DisableBreakInputSource
OR3 BK2DF1BK1E LL_TIM_DisableBreakInputSource
Parameters
TIMxTimer instance
BreakInputThis parameter can be one of the following values:
  • LL_TIM_BREAK_INPUT_BKIN
  • LL_TIM_BREAK_INPUT_BKIN2
SourceThis parameter can be one of the following values:
  • LL_TIM_BKIN_SOURCE_BKIN
  • LL_TIM_BKIN_SOURCE_BKCOMP1
  • LL_TIM_BKIN_SOURCE_BKCOMP2
  • LL_TIM_BKIN_SOURCE_DF1BK
Return values
None

Definition at line 3688 of file stm32l4xx_ll_tim.h.

3689 {
3690  register __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->OR2) + BreakInput));
3691  CLEAR_BIT(*pReg, Source);
3692 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_TIM_DisableBRK()

__STATIC_INLINE void LL_TIM_DisableBRK ( TIM_TypeDef *  TIMx)

Disable the break function. BDTR BKE LL_TIM_DisableBRK.

Parameters
TIMxTimer instance
Note
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input.
Return values
None

Definition at line 3434 of file stm32l4xx_ll_tim.h.

3435 {
3436  CLEAR_BIT(TIMx->BDTR, TIM_BDTR_BKE);
3437 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_TIM_DisableBRK2()

__STATIC_INLINE void LL_TIM_DisableBRK2 ( TIM_TypeDef *  TIMx)

Disable the break 2 function.

Note
Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a second break input. BDTR BK2E LL_TIM_DisableBRK2
Parameters
TIMxTimer instance
Return values
None

Definition at line 3495 of file stm32l4xx_ll_tim.h.

3496 {
3497  CLEAR_BIT(TIMx->BDTR, TIM_BDTR_BK2E);
3498 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_TIM_EnableAllOutputs()

__STATIC_INLINE void LL_TIM_EnableAllOutputs ( TIM_TypeDef *  TIMx)

Enable the outputs (set the MOE bit in TIMx_BDTR register).

Note
The MOE bit in TIMx_BDTR register allows to enable /disable the outputs by software and is reset in case of break or break2 event
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR MOE LL_TIM_EnableAllOutputs
Parameters
TIMxTimer instance
Return values
None

Definition at line 3603 of file stm32l4xx_ll_tim.h.

3604 {
3605  SET_BIT(TIMx->BDTR, TIM_BDTR_MOE);
3606 }

◆ LL_TIM_EnableAutomaticOutput()

__STATIC_INLINE void LL_TIM_EnableAutomaticOutput ( TIM_TypeDef *  TIMx)

Enable automatic output (MOE can be set by software or automatically when a break input is active).

Note
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR AOE LL_TIM_EnableAutomaticOutput
Parameters
TIMxTimer instance
Return values
None

Definition at line 3562 of file stm32l4xx_ll_tim.h.

3563 {
3564  SET_BIT(TIMx->BDTR, TIM_BDTR_AOE);
3565 }

◆ LL_TIM_EnableBreakInputSource()

__STATIC_INLINE void LL_TIM_EnableBreakInputSource ( TIM_TypeDef *  TIMx,
uint32_t  BreakInput,
uint32_t  Source 
)

Enable the signals connected to the designated timer break input.

Note
Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether or not a timer instance allows for break input selection. OR2 BKINE LL_TIM_EnableBreakInputSource
OR2 BKCMP1E LL_TIM_EnableBreakInputSource
OR2 BKCMP2E LL_TIM_EnableBreakInputSource
OR2 BKDF1BK0E LL_TIM_EnableBreakInputSource
OR3 BK2INE LL_TIM_EnableBreakInputSource
OR3 BK2CMP1E LL_TIM_EnableBreakInputSource
OR3 BK2CMP2E LL_TIM_EnableBreakInputSource
OR3 BK2DF1BK1E LL_TIM_EnableBreakInputSource
Parameters
TIMxTimer instance
BreakInputThis parameter can be one of the following values:
  • LL_TIM_BREAK_INPUT_BKIN
  • LL_TIM_BREAK_INPUT_BKIN2
SourceThis parameter can be one of the following values:
  • LL_TIM_BKIN_SOURCE_BKIN
  • LL_TIM_BKIN_SOURCE_BKCOMP1
  • LL_TIM_BKIN_SOURCE_BKCOMP2
  • LL_TIM_BKIN_SOURCE_DF1BK
Return values
None

Definition at line 3659 of file stm32l4xx_ll_tim.h.

3660 {
3661  register __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->OR2) + BreakInput));
3662  SET_BIT(*pReg, Source);
3663 }

◆ LL_TIM_EnableBRK()

__STATIC_INLINE void LL_TIM_EnableBRK ( TIM_TypeDef *  TIMx)

Enable the break function.

Note
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR BKE LL_TIM_EnableBRK
Parameters
TIMxTimer instance
Return values
None

Definition at line 3421 of file stm32l4xx_ll_tim.h.

3422 {
3423  SET_BIT(TIMx->BDTR, TIM_BDTR_BKE);
3424 }

◆ LL_TIM_EnableBRK2()

__STATIC_INLINE void LL_TIM_EnableBRK2 ( TIM_TypeDef *  TIMx)

Enable the break 2 function.

Note
Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a second break input. BDTR BK2E LL_TIM_EnableBRK2
Parameters
TIMxTimer instance
Return values
None

Definition at line 3482 of file stm32l4xx_ll_tim.h.

3483 {
3484  SET_BIT(TIMx->BDTR, TIM_BDTR_BK2E);
3485 }

◆ LL_TIM_IsEnabledAllOutputs()

__STATIC_INLINE uint32_t LL_TIM_IsEnabledAllOutputs ( TIM_TypeDef *  TIMx)

Indicates whether outputs are enabled.

Note
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR MOE LL_TIM_IsEnabledAllOutputs
Parameters
TIMxTimer instance
Return values
Stateof bit (1 or 0).

Definition at line 3631 of file stm32l4xx_ll_tim.h.

3632 {
3633  return ((READ_BIT(TIMx->BDTR, TIM_BDTR_MOE) == (TIM_BDTR_MOE)) ? 1UL : 0UL);
3634 }

◆ LL_TIM_IsEnabledAutomaticOutput()

__STATIC_INLINE uint32_t LL_TIM_IsEnabledAutomaticOutput ( TIM_TypeDef *  TIMx)

Indicate whether automatic output is enabled.

Note
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR AOE LL_TIM_IsEnabledAutomaticOutput
Parameters
TIMxTimer instance
Return values
Stateof bit (1 or 0).

Definition at line 3588 of file stm32l4xx_ll_tim.h.

3589 {
3590  return ((READ_BIT(TIMx->BDTR, TIM_BDTR_AOE) == (TIM_BDTR_AOE)) ? 1UL : 0UL);
3591 }

◆ LL_TIM_SetBreakInputSourcePolarity()

__STATIC_INLINE void LL_TIM_SetBreakInputSourcePolarity ( TIM_TypeDef *  TIMx,
uint32_t  BreakInput,
uint32_t  Source,
uint32_t  Polarity 
)

Set the polarity of the break signal for the timer break input.

Note
Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether or not a timer instance allows for break input selection. OR2 BKINP LL_TIM_SetBreakInputSourcePolarity
OR2 BKCMP1P LL_TIM_SetBreakInputSourcePolarity
OR2 BKCMP2P LL_TIM_SetBreakInputSourcePolarity
OR3 BK2INP LL_TIM_SetBreakInputSourcePolarity
OR3 BK2CMP1P LL_TIM_SetBreakInputSourcePolarity
OR3 BK2CMP2P LL_TIM_SetBreakInputSourcePolarity
Parameters
TIMxTimer instance
BreakInputThis parameter can be one of the following values:
  • LL_TIM_BREAK_INPUT_BKIN
  • LL_TIM_BREAK_INPUT_BKIN2
SourceThis parameter can be one of the following values:
  • LL_TIM_BKIN_SOURCE_BKIN
  • LL_TIM_BKIN_SOURCE_BKCOMP1
  • LL_TIM_BKIN_SOURCE_BKCOMP2
PolarityThis parameter can be one of the following values:
  • LL_TIM_BKIN_POLARITY_LOW
  • LL_TIM_BKIN_POLARITY_HIGH
Return values
None

Definition at line 3717 of file stm32l4xx_ll_tim.h.

3719 {
3720  register __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->OR2) + BreakInput));
3721  MODIFY_REG(*pReg, (TIMx_OR2_BKINP << TIM_POSITION_BRK_SOURCE), (Polarity << TIM_POSITION_BRK_SOURCE));
3722 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_SetOffStates()

__STATIC_INLINE void LL_TIM_SetOffStates ( TIM_TypeDef *  TIMx,
uint32_t  OffStateIdle,
uint32_t  OffStateRun 
)

Select the outputs off state (enabled v.s. disabled) in Idle and Run modes.

Note
Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not a timer instance provides a break input. BDTR OSSI LL_TIM_SetOffStates
BDTR OSSR LL_TIM_SetOffStates
Parameters
TIMxTimer instance
OffStateIdleThis parameter can be one of the following values:
  • LL_TIM_OSSI_DISABLE
  • LL_TIM_OSSI_ENABLE
OffStateRunThis parameter can be one of the following values:
  • LL_TIM_OSSR_DISABLE
  • LL_TIM_OSSR_ENABLE
Return values
None

Definition at line 3549 of file stm32l4xx_ll_tim.h.

3550 {
3551  MODIFY_REG(TIMx->BDTR, TIM_BDTR_OSSI | TIM_BDTR_OSSR, OffStateIdle | OffStateRun);
3552 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)