/* TIM_Encoder MSP Initialization This function configures the hardware resources used in this example.  */
void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef *htim_encoder)
/* TIM_Encoder MSP Initialization This function configures the hardware resources used in this example.  */
void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef *htim_encoder)
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
  if(htim_encoder->Instance==TIM4)
  {
    __HAL_RCC_TIM4_CLK_ENABLE();
    __HAL_RCC_GPIOB_CLK_ENABLE();
    GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF2_TIM4;
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  }
}