STM32: Timer encoder reset
You should write one for yourself based on the 'get' function:

uint32_t TIM_GetCounter(TIM_TypeDef* TIMx)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));

  /* Get the Counter Register value */
  return TIMx-&gt;CNT;
}


So a TIM_ResetCounter should look like this:

void TIM_ResetCounter(TIM_TypeDef* TIMx)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));

  /* Reset the Counter Register value */
  TIMx-&gt;CNT = 0;
}


If you check in the reference manual, you can see that the counter value register has read-write access. So you can set it to 0.



You can create a general set function as well with an additional "value" parameter.