General-purpose timers (TIM)
This parameter can be one of the following values:
ï€ TIM_ExtTRGPSC_OFF : ETRP Prescaler OFF.
ï€ TIM_ExtTRGPSC_DIV2 : ETRP frequency divided by 2.
ï€ TIM_ExtTRGPSC_DIV4 : ETRP frequency divided by 4.
ï€ TIM_ExtTRGPSC_DIV8 : ETRP frequency divided by 8.
ï‚· TIM_ExtTRGPolarity : The external Trigger Polarity. This
parameter can be one of the following values:
ï€ TIM_ExtTRGPolarity_Inverted : active low or falling
edge active.
ï€ TIM_ExtTRGPolarity_NonInverted : active high or
rising edge active.
ï‚· ExtTRGFilter : External Trigger Filter. This parameter must
be a value between 0x00 and 0x0F
22.2.18 Specific interface management functions
22.2.18.1 TIM_EncoderInterfaceConfig
void TIM_EncoderInterfaceConfig ( TIM_TypeDef * TIMx,
uint16_t TIM_EncoderMode, uint16_t TIM_IC1Polarity, uint16_t
TIM_IC2Polarity)
Configures the TIMx Encoder Interface.
ï‚· TIMx : where x can be 1, 2, 3, 4 or 8 to select the TIM
peripheral.
ï‚· TIM_EncoderMode : specifies the TIMx Encoder Mode. This
parameter can be one of the following values:
ï€ TIM_EncoderMode_TI1 : Counter counts on TI1FP1
edge depending on TI2FP2 level.
ï€ TIM_EncoderMode_TI2 : Counter counts on TI2FP2
edge depending on TI1FP1 level.
ï€ TIM_EncoderMode_TI12 : Counter counts on both
TI1FP1 and TI2FP2 edges depending on the level of the
other input.
ï‚· TIM_IC1Polarity : specifies the IC1 Polarity This parameter
can be one of the following values:
ï€ TIM_ICPolarity_Falling : IC Falling edge.
ï€ TIM_ICPolarity_Rising : IC Rising edge.
ï‚· TIM_IC2Polarity : specifies the IC2 Polarity This parameter
can be one of the following values:
ï€ TIM_ICPolarity_Falling : IC Falling edge.
ï€ TIM_ICPolarity_Rising : IC Rising edge.