/* Specifies the tim Counter Mode to be used.  */
void TIM_CounterModeConfig(TIM_TypeDef *tim, TIMCOUNTMODE_Typedef counter_mode)
/* Specifies the tim Counter Mode to be used.  */
void TIM_CounterModeConfig(TIM_TypeDef *tim, TIMCOUNTMODE_Typedef counter_mode)
{
    MODIFY_REG(tim->CR1, TIM_CR1_CMS | TIM_CR1_DIR, counter_mode);
}