/* Configures the tim Internal Trigger as External Clock.  */
void TIM_ITRxExternalClockConfig(TIM_TypeDef *tim, TIMTS_TypeDef source)
/* Configures the tim Internal Trigger as External Clock.  */
void TIM_ITRxExternalClockConfig(TIM_TypeDef *tim, TIMTS_TypeDef source)
{
    TIM_SelectInputTrigger(tim, source);
    SET_BIT(tim->SMCR, TIM_SlaveMode_External1);
}