/* Specifies the TIMx Counter Mode to be used.  */
void TIM_CounterModeConfig(TIM_TypeDef *TIMx, uint16_t TIM_CounterMode)
/* Specifies the TIMx Counter Mode to be used.  */
void TIM_CounterModeConfig(TIM_TypeDef *TIMx, uint16_t TIM_CounterMode)
{
    uint16_t tmpcr1 = 0;
    assert_param(IS_TIM_123458_PERIPH(TIMx));
    assert_param(IS_TIM_COUNTER_MODE(TIM_CounterMode));
    tmpcr1 = TIMx->CR1;
    tmpcr1 &= CR1_CounterMode_Mask;
    tmpcr1 |= TIM_CounterMode;
    TIMx->CR1 = tmpcr1;
}