STM32L4xx_HAL_Driver  1.14.0
Input channel configuration

Functions

__STATIC_INLINE void LL_TIM_IC_Config (TIM_TypeDef *TIMx, uint32_t Channel, uint32_t Configuration)
 Configure input channel. CCMR1 CC1S LL_TIM_IC_Config
CCMR1 IC1PSC LL_TIM_IC_Config
CCMR1 IC1F LL_TIM_IC_Config
CCMR1 CC2S LL_TIM_IC_Config
CCMR1 IC2PSC LL_TIM_IC_Config
CCMR1 IC2F LL_TIM_IC_Config
CCMR2 CC3S LL_TIM_IC_Config
CCMR2 IC3PSC LL_TIM_IC_Config
CCMR2 IC3F LL_TIM_IC_Config
CCMR2 CC4S LL_TIM_IC_Config
CCMR2 IC4PSC LL_TIM_IC_Config
CCMR2 IC4F LL_TIM_IC_Config
CCER CC1P LL_TIM_IC_Config
CCER CC1NP LL_TIM_IC_Config
CCER CC2P LL_TIM_IC_Config
CCER CC2NP LL_TIM_IC_Config
CCER CC3P LL_TIM_IC_Config
CCER CC3NP LL_TIM_IC_Config
CCER CC4P LL_TIM_IC_Config
CCER CC4NP LL_TIM_IC_Config. More...
 
__STATIC_INLINE void LL_TIM_IC_SetActiveInput (TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ICActiveInput)
 Set the active input. CCMR1 CC1S LL_TIM_IC_SetActiveInput
CCMR1 CC2S LL_TIM_IC_SetActiveInput
CCMR2 CC3S LL_TIM_IC_SetActiveInput
CCMR2 CC4S LL_TIM_IC_SetActiveInput. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_GetActiveInput (TIM_TypeDef *TIMx, uint32_t Channel)
 Get the current active input. CCMR1 CC1S LL_TIM_IC_GetActiveInput
CCMR1 CC2S LL_TIM_IC_GetActiveInput
CCMR2 CC3S LL_TIM_IC_GetActiveInput
CCMR2 CC4S LL_TIM_IC_GetActiveInput. More...
 
__STATIC_INLINE void LL_TIM_IC_SetPrescaler (TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ICPrescaler)
 Set the prescaler of input channel. CCMR1 IC1PSC LL_TIM_IC_SetPrescaler
CCMR1 IC2PSC LL_TIM_IC_SetPrescaler
CCMR2 IC3PSC LL_TIM_IC_SetPrescaler
CCMR2 IC4PSC LL_TIM_IC_SetPrescaler. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_GetPrescaler (TIM_TypeDef *TIMx, uint32_t Channel)
 Get the current prescaler value acting on an input channel. CCMR1 IC1PSC LL_TIM_IC_GetPrescaler
CCMR1 IC2PSC LL_TIM_IC_GetPrescaler
CCMR2 IC3PSC LL_TIM_IC_GetPrescaler
CCMR2 IC4PSC LL_TIM_IC_GetPrescaler. More...
 
__STATIC_INLINE void LL_TIM_IC_SetFilter (TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ICFilter)
 Set the input filter duration. CCMR1 IC1F LL_TIM_IC_SetFilter
CCMR1 IC2F LL_TIM_IC_SetFilter
CCMR2 IC3F LL_TIM_IC_SetFilter
CCMR2 IC4F LL_TIM_IC_SetFilter. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_GetFilter (TIM_TypeDef *TIMx, uint32_t Channel)
 Get the input filter duration. CCMR1 IC1F LL_TIM_IC_GetFilter
CCMR1 IC2F LL_TIM_IC_GetFilter
CCMR2 IC3F LL_TIM_IC_GetFilter
CCMR2 IC4F LL_TIM_IC_GetFilter. More...
 
__STATIC_INLINE void LL_TIM_IC_SetPolarity (TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ICPolarity)
 Set the input channel polarity. CCER CC1P LL_TIM_IC_SetPolarity
CCER CC1NP LL_TIM_IC_SetPolarity
CCER CC2P LL_TIM_IC_SetPolarity
CCER CC2NP LL_TIM_IC_SetPolarity
CCER CC3P LL_TIM_IC_SetPolarity
CCER CC3NP LL_TIM_IC_SetPolarity
CCER CC4P LL_TIM_IC_SetPolarity
CCER CC4NP LL_TIM_IC_SetPolarity. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_GetPolarity (TIM_TypeDef *TIMx, uint32_t Channel)
 Get the current input channel polarity. CCER CC1P LL_TIM_IC_GetPolarity
CCER CC1NP LL_TIM_IC_GetPolarity
CCER CC2P LL_TIM_IC_GetPolarity
CCER CC2NP LL_TIM_IC_GetPolarity
CCER CC3P LL_TIM_IC_GetPolarity
CCER CC3NP LL_TIM_IC_GetPolarity
CCER CC4P LL_TIM_IC_GetPolarity
CCER CC4NP LL_TIM_IC_GetPolarity. More...
 
__STATIC_INLINE void LL_TIM_IC_EnableXORCombination (TIM_TypeDef *TIMx)
 Connect the TIMx_CH1, CH2 and CH3 pins to the TI1 input (XOR combination). More...
 
__STATIC_INLINE void LL_TIM_IC_DisableXORCombination (TIM_TypeDef *TIMx)
 Disconnect the TIMx_CH1, CH2 and CH3 pins from the TI1 input. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_IsEnabledXORCombination (TIM_TypeDef *TIMx)
 Indicates whether the TIMx_CH1, CH2 and CH3 pins are connectected to the TI1 input. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH1 (TIM_TypeDef *TIMx)
 Get captured value for input channel 1. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH2 (TIM_TypeDef *TIMx)
 Get captured value for input channel 2. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH3 (TIM_TypeDef *TIMx)
 Get captured value for input channel 3. More...
 
__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH4 (TIM_TypeDef *TIMx)
 Get captured value for input channel 4. More...
 

Detailed Description

Function Documentation

◆ LL_TIM_IC_Config()

__STATIC_INLINE void LL_TIM_IC_Config ( TIM_TypeDef *  TIMx,
uint32_t  Channel,
uint32_t  Configuration 
)

Configure input channel. CCMR1 CC1S LL_TIM_IC_Config
CCMR1 IC1PSC LL_TIM_IC_Config
CCMR1 IC1F LL_TIM_IC_Config
CCMR1 CC2S LL_TIM_IC_Config
CCMR1 IC2PSC LL_TIM_IC_Config
CCMR1 IC2F LL_TIM_IC_Config
CCMR2 CC3S LL_TIM_IC_Config
CCMR2 IC3PSC LL_TIM_IC_Config
CCMR2 IC3F LL_TIM_IC_Config
CCMR2 CC4S LL_TIM_IC_Config
CCMR2 IC4PSC LL_TIM_IC_Config
CCMR2 IC4F LL_TIM_IC_Config
CCER CC1P LL_TIM_IC_Config
CCER CC1NP LL_TIM_IC_Config
CCER CC2P LL_TIM_IC_Config
CCER CC2NP LL_TIM_IC_Config
CCER CC3P LL_TIM_IC_Config
CCER CC3NP LL_TIM_IC_Config
CCER CC4P LL_TIM_IC_Config
CCER CC4NP LL_TIM_IC_Config.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
ConfigurationThis parameter must be a combination of all the following values:
  • LL_TIM_ACTIVEINPUT_DIRECTTI or LL_TIM_ACTIVEINPUT_INDIRECTTI or LL_TIM_ACTIVEINPUT_TRC
  • LL_TIM_ICPSC_DIV1 or ... or LL_TIM_ICPSC_DIV8
  • LL_TIM_IC_FILTER_FDIV1 or ... or LL_TIM_IC_FILTER_FDIV32_N8
  • LL_TIM_IC_POLARITY_RISING or LL_TIM_IC_POLARITY_FALLING or LL_TIM_IC_POLARITY_BOTHEDGE
Return values
None

Definition at line 2775 of file stm32l4xx_ll_tim.h.

2776 {
2777  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
2778  register __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel]));
2779  MODIFY_REG(*pReg, ((TIM_CCMR1_IC1F | TIM_CCMR1_IC1PSC | TIM_CCMR1_CC1S) << SHIFT_TAB_ICxx[iChannel]),
2780  ((Configuration >> 16U) & (TIM_CCMR1_IC1F | TIM_CCMR1_IC1PSC | TIM_CCMR1_CC1S)) << SHIFT_TAB_ICxx[iChannel]);
2781  MODIFY_REG(TIMx->CCER, ((TIM_CCER_CC1NP | TIM_CCER_CC1P) << SHIFT_TAB_CCxP[iChannel]),
2782  (Configuration & (TIM_CCER_CC1NP | TIM_CCER_CC1P)) << SHIFT_TAB_CCxP[iChannel]);
2783 }
static const uint8_t SHIFT_TAB_CCxP[]
static const uint8_t SHIFT_TAB_ICxx[]
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
static const uint8_t OFFSET_TAB_CCMRx[]

◆ LL_TIM_IC_DisableXORCombination()

__STATIC_INLINE void LL_TIM_IC_DisableXORCombination ( TIM_TypeDef *  TIMx)

Disconnect the TIMx_CH1, CH2 and CH3 pins from the TI1 input.

Note
Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not a timer instance provides an XOR input. CR2 TI1S LL_TIM_IC_DisableXORCombination
Parameters
TIMxTimer instance
Return values
None

Definition at line 3038 of file stm32l4xx_ll_tim.h.

3039 {
3040  CLEAR_BIT(TIMx->CR2, TIM_CR2_TI1S);
3041 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_TIM_IC_EnableXORCombination()

__STATIC_INLINE void LL_TIM_IC_EnableXORCombination ( TIM_TypeDef *  TIMx)

Connect the TIMx_CH1, CH2 and CH3 pins to the TI1 input (XOR combination).

Note
Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not a timer instance provides an XOR input. CR2 TI1S LL_TIM_IC_EnableXORCombination
Parameters
TIMxTimer instance
Return values
None

Definition at line 3025 of file stm32l4xx_ll_tim.h.

3026 {
3027  SET_BIT(TIMx->CR2, TIM_CR2_TI1S);
3028 }

◆ LL_TIM_IC_GetActiveInput()

__STATIC_INLINE uint32_t LL_TIM_IC_GetActiveInput ( TIM_TypeDef *  TIMx,
uint32_t  Channel 
)

Get the current active input. CCMR1 CC1S LL_TIM_IC_GetActiveInput
CCMR1 CC2S LL_TIM_IC_GetActiveInput
CCMR2 CC3S LL_TIM_IC_GetActiveInput
CCMR2 CC4S LL_TIM_IC_GetActiveInput.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
Return values
Returnedvalue can be one of the following values:
  • LL_TIM_ACTIVEINPUT_DIRECTTI
  • LL_TIM_ACTIVEINPUT_INDIRECTTI
  • LL_TIM_ACTIVEINPUT_TRC

Definition at line 2827 of file stm32l4xx_ll_tim.h.

2828 {
2829  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
2830  register const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel]));
2831  return ((READ_BIT(*pReg, ((TIM_CCMR1_CC1S) << SHIFT_TAB_ICxx[iChannel])) >> SHIFT_TAB_ICxx[iChannel]) << 16U);
2832 }
static const uint8_t SHIFT_TAB_ICxx[]
static const uint8_t OFFSET_TAB_CCMRx[]

◆ LL_TIM_IC_GetCaptureCH1()

__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH1 ( TIM_TypeDef *  TIMx)

Get captured value for input channel 1.

Note
In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF.
Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a 32 bits counter.
Macro IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not input channel 1 is supported by a timer instance. CCR1 CCR1 LL_TIM_IC_GetCaptureCH1
Parameters
TIMxTimer instance
Return values
CapturedValue(between Min_Data=0 and Max_Data=65535)

Definition at line 3067 of file stm32l4xx_ll_tim.h.

3068 {
3069  return (uint32_t)(READ_REG(TIMx->CCR1));
3070 }

◆ LL_TIM_IC_GetCaptureCH2()

__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH2 ( TIM_TypeDef *  TIMx)

Get captured value for input channel 2.

Note
In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF.
Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a 32 bits counter.
Macro IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not input channel 2 is supported by a timer instance. CCR2 CCR2 LL_TIM_IC_GetCaptureCH2
Parameters
TIMxTimer instance
Return values
CapturedValue(between Min_Data=0 and Max_Data=65535)

Definition at line 3083 of file stm32l4xx_ll_tim.h.

3084 {
3085  return (uint32_t)(READ_REG(TIMx->CCR2));
3086 }

◆ LL_TIM_IC_GetCaptureCH3()

__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH3 ( TIM_TypeDef *  TIMx)

Get captured value for input channel 3.

Note
In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF.
Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a 32 bits counter.
Macro IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not input channel 3 is supported by a timer instance. CCR3 CCR3 LL_TIM_IC_GetCaptureCH3
Parameters
TIMxTimer instance
Return values
CapturedValue(between Min_Data=0 and Max_Data=65535)

Definition at line 3099 of file stm32l4xx_ll_tim.h.

3100 {
3101  return (uint32_t)(READ_REG(TIMx->CCR3));
3102 }

◆ LL_TIM_IC_GetCaptureCH4()

__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH4 ( TIM_TypeDef *  TIMx)

Get captured value for input channel 4.

Note
In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF.
Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check whether or not a timer instance supports a 32 bits counter.
Macro IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not input channel 4 is supported by a timer instance. CCR4 CCR4 LL_TIM_IC_GetCaptureCH4
Parameters
TIMxTimer instance
Return values
CapturedValue(between Min_Data=0 and Max_Data=65535)

Definition at line 3115 of file stm32l4xx_ll_tim.h.

3116 {
3117  return (uint32_t)(READ_REG(TIMx->CCR4));
3118 }

◆ LL_TIM_IC_GetFilter()

__STATIC_INLINE uint32_t LL_TIM_IC_GetFilter ( TIM_TypeDef *  TIMx,
uint32_t  Channel 
)

Get the input filter duration. CCMR1 IC1F LL_TIM_IC_GetFilter
CCMR1 IC2F LL_TIM_IC_GetFilter
CCMR2 IC3F LL_TIM_IC_GetFilter
CCMR2 IC4F LL_TIM_IC_GetFilter.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
Return values
Returnedvalue can be one of the following values:
  • LL_TIM_IC_FILTER_FDIV1
  • LL_TIM_IC_FILTER_FDIV1_N2
  • LL_TIM_IC_FILTER_FDIV1_N4
  • LL_TIM_IC_FILTER_FDIV1_N8
  • LL_TIM_IC_FILTER_FDIV2_N6
  • LL_TIM_IC_FILTER_FDIV2_N8
  • LL_TIM_IC_FILTER_FDIV4_N6
  • LL_TIM_IC_FILTER_FDIV4_N8
  • LL_TIM_IC_FILTER_FDIV8_N6
  • LL_TIM_IC_FILTER_FDIV8_N8
  • LL_TIM_IC_FILTER_FDIV16_N5
  • LL_TIM_IC_FILTER_FDIV16_N6
  • LL_TIM_IC_FILTER_FDIV16_N8
  • LL_TIM_IC_FILTER_FDIV32_N5
  • LL_TIM_IC_FILTER_FDIV32_N6
  • LL_TIM_IC_FILTER_FDIV32_N8

Definition at line 2953 of file stm32l4xx_ll_tim.h.

2954 {
2955  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
2956  register const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel]));
2957  return ((READ_BIT(*pReg, ((TIM_CCMR1_IC1F) << SHIFT_TAB_ICxx[iChannel])) >> SHIFT_TAB_ICxx[iChannel]) << 16U);
2958 }
static const uint8_t SHIFT_TAB_ICxx[]
static const uint8_t OFFSET_TAB_CCMRx[]

◆ LL_TIM_IC_GetPolarity()

__STATIC_INLINE uint32_t LL_TIM_IC_GetPolarity ( TIM_TypeDef *  TIMx,
uint32_t  Channel 
)

Get the current input channel polarity. CCER CC1P LL_TIM_IC_GetPolarity
CCER CC1NP LL_TIM_IC_GetPolarity
CCER CC2P LL_TIM_IC_GetPolarity
CCER CC2NP LL_TIM_IC_GetPolarity
CCER CC3P LL_TIM_IC_GetPolarity
CCER CC3NP LL_TIM_IC_GetPolarity
CCER CC4P LL_TIM_IC_GetPolarity
CCER CC4NP LL_TIM_IC_GetPolarity.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
Return values
Returnedvalue can be one of the following values:
  • LL_TIM_IC_POLARITY_RISING
  • LL_TIM_IC_POLARITY_FALLING
  • LL_TIM_IC_POLARITY_BOTHEDGE

Definition at line 3010 of file stm32l4xx_ll_tim.h.

3011 {
3012  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
3013  return (READ_BIT(TIMx->CCER, ((TIM_CCER_CC1NP | TIM_CCER_CC1P) << SHIFT_TAB_CCxP[iChannel])) >>
3014  SHIFT_TAB_CCxP[iChannel]);
3015 }
static const uint8_t SHIFT_TAB_CCxP[]

◆ LL_TIM_IC_GetPrescaler()

__STATIC_INLINE uint32_t LL_TIM_IC_GetPrescaler ( TIM_TypeDef *  TIMx,
uint32_t  Channel 
)

Get the current prescaler value acting on an input channel. CCMR1 IC1PSC LL_TIM_IC_GetPrescaler
CCMR1 IC2PSC LL_TIM_IC_GetPrescaler
CCMR2 IC3PSC LL_TIM_IC_GetPrescaler
CCMR2 IC4PSC LL_TIM_IC_GetPrescaler.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
Return values
Returnedvalue can be one of the following values:
  • LL_TIM_ICPSC_DIV1
  • LL_TIM_ICPSC_DIV2
  • LL_TIM_ICPSC_DIV4
  • LL_TIM_ICPSC_DIV8

Definition at line 2878 of file stm32l4xx_ll_tim.h.

2879 {
2880  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
2881  register const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel]));
2882  return ((READ_BIT(*pReg, ((TIM_CCMR1_IC1PSC) << SHIFT_TAB_ICxx[iChannel])) >> SHIFT_TAB_ICxx[iChannel]) << 16U);
2883 }
static const uint8_t SHIFT_TAB_ICxx[]
static const uint8_t OFFSET_TAB_CCMRx[]

◆ LL_TIM_IC_IsEnabledXORCombination()

__STATIC_INLINE uint32_t LL_TIM_IC_IsEnabledXORCombination ( TIM_TypeDef *  TIMx)

Indicates whether the TIMx_CH1, CH2 and CH3 pins are connectected to the TI1 input.

Note
Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not a timer instance provides an XOR input. CR2 TI1S LL_TIM_IC_IsEnabledXORCombination
Parameters
TIMxTimer instance
Return values
Stateof bit (1 or 0).

Definition at line 3051 of file stm32l4xx_ll_tim.h.

3052 {
3053  return ((READ_BIT(TIMx->CR2, TIM_CR2_TI1S) == (TIM_CR2_TI1S)) ? 1UL : 0UL);
3054 }

◆ LL_TIM_IC_SetActiveInput()

__STATIC_INLINE void LL_TIM_IC_SetActiveInput ( TIM_TypeDef *  TIMx,
uint32_t  Channel,
uint32_t  ICActiveInput 
)

Set the active input. CCMR1 CC1S LL_TIM_IC_SetActiveInput
CCMR1 CC2S LL_TIM_IC_SetActiveInput
CCMR2 CC3S LL_TIM_IC_SetActiveInput
CCMR2 CC4S LL_TIM_IC_SetActiveInput.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
ICActiveInputThis parameter can be one of the following values:
  • LL_TIM_ACTIVEINPUT_DIRECTTI
  • LL_TIM_ACTIVEINPUT_INDIRECTTI
  • LL_TIM_ACTIVEINPUT_TRC
Return values
None

Definition at line 2803 of file stm32l4xx_ll_tim.h.

2804 {
2805  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
2806  register __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel]));
2807  MODIFY_REG(*pReg, ((TIM_CCMR1_CC1S) << SHIFT_TAB_ICxx[iChannel]), (ICActiveInput >> 16U) << SHIFT_TAB_ICxx[iChannel]);
2808 }
static const uint8_t SHIFT_TAB_ICxx[]
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
static const uint8_t OFFSET_TAB_CCMRx[]

◆ LL_TIM_IC_SetFilter()

__STATIC_INLINE void LL_TIM_IC_SetFilter ( TIM_TypeDef *  TIMx,
uint32_t  Channel,
uint32_t  ICFilter 
)

Set the input filter duration. CCMR1 IC1F LL_TIM_IC_SetFilter
CCMR1 IC2F LL_TIM_IC_SetFilter
CCMR2 IC3F LL_TIM_IC_SetFilter
CCMR2 IC4F LL_TIM_IC_SetFilter.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
ICFilterThis parameter can be one of the following values:
  • LL_TIM_IC_FILTER_FDIV1
  • LL_TIM_IC_FILTER_FDIV1_N2
  • LL_TIM_IC_FILTER_FDIV1_N4
  • LL_TIM_IC_FILTER_FDIV1_N8
  • LL_TIM_IC_FILTER_FDIV2_N6
  • LL_TIM_IC_FILTER_FDIV2_N8
  • LL_TIM_IC_FILTER_FDIV4_N6
  • LL_TIM_IC_FILTER_FDIV4_N8
  • LL_TIM_IC_FILTER_FDIV8_N6
  • LL_TIM_IC_FILTER_FDIV8_N8
  • LL_TIM_IC_FILTER_FDIV16_N5
  • LL_TIM_IC_FILTER_FDIV16_N6
  • LL_TIM_IC_FILTER_FDIV16_N8
  • LL_TIM_IC_FILTER_FDIV32_N5
  • LL_TIM_IC_FILTER_FDIV32_N6
  • LL_TIM_IC_FILTER_FDIV32_N8
Return values
None

Definition at line 2916 of file stm32l4xx_ll_tim.h.

2917 {
2918  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
2919  register __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel]));
2920  MODIFY_REG(*pReg, ((TIM_CCMR1_IC1F) << SHIFT_TAB_ICxx[iChannel]), (ICFilter >> 16U) << SHIFT_TAB_ICxx[iChannel]);
2921 }
static const uint8_t SHIFT_TAB_ICxx[]
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
static const uint8_t OFFSET_TAB_CCMRx[]

◆ LL_TIM_IC_SetPolarity()

__STATIC_INLINE void LL_TIM_IC_SetPolarity ( TIM_TypeDef *  TIMx,
uint32_t  Channel,
uint32_t  ICPolarity 
)

Set the input channel polarity. CCER CC1P LL_TIM_IC_SetPolarity
CCER CC1NP LL_TIM_IC_SetPolarity
CCER CC2P LL_TIM_IC_SetPolarity
CCER CC2NP LL_TIM_IC_SetPolarity
CCER CC3P LL_TIM_IC_SetPolarity
CCER CC3NP LL_TIM_IC_SetPolarity
CCER CC4P LL_TIM_IC_SetPolarity
CCER CC4NP LL_TIM_IC_SetPolarity.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
ICPolarityThis parameter can be one of the following values:
  • LL_TIM_IC_POLARITY_RISING
  • LL_TIM_IC_POLARITY_FALLING
  • LL_TIM_IC_POLARITY_BOTHEDGE
Return values
None

Definition at line 2982 of file stm32l4xx_ll_tim.h.

2983 {
2984  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
2985  MODIFY_REG(TIMx->CCER, ((TIM_CCER_CC1NP | TIM_CCER_CC1P) << SHIFT_TAB_CCxP[iChannel]),
2986  ICPolarity << SHIFT_TAB_CCxP[iChannel]);
2987 }
static const uint8_t SHIFT_TAB_CCxP[]
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_TIM_IC_SetPrescaler()

__STATIC_INLINE void LL_TIM_IC_SetPrescaler ( TIM_TypeDef *  TIMx,
uint32_t  Channel,
uint32_t  ICPrescaler 
)

Set the prescaler of input channel. CCMR1 IC1PSC LL_TIM_IC_SetPrescaler
CCMR1 IC2PSC LL_TIM_IC_SetPrescaler
CCMR2 IC3PSC LL_TIM_IC_SetPrescaler
CCMR2 IC4PSC LL_TIM_IC_SetPrescaler.

Parameters
TIMxTimer instance
ChannelThis parameter can be one of the following values:
  • LL_TIM_CHANNEL_CH1
  • LL_TIM_CHANNEL_CH2
  • LL_TIM_CHANNEL_CH3
  • LL_TIM_CHANNEL_CH4
ICPrescalerThis parameter can be one of the following values:
  • LL_TIM_ICPSC_DIV1
  • LL_TIM_ICPSC_DIV2
  • LL_TIM_ICPSC_DIV4
  • LL_TIM_ICPSC_DIV8
Return values
None

Definition at line 2853 of file stm32l4xx_ll_tim.h.

2854 {
2855  register uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel);
2856  register __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel]));
2857  MODIFY_REG(*pReg, ((TIM_CCMR1_IC1PSC) << SHIFT_TAB_ICxx[iChannel]), (ICPrescaler >> 16U) << SHIFT_TAB_ICxx[iChannel]);
2858 }
static const uint8_t SHIFT_TAB_ICxx[]
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
static const uint8_t OFFSET_TAB_CCMRx[]