Core/Src/main.c
static void MX_TIM15_Init(void)
{

  /* USER CODE BEGIN TIM15_Init 0 */

  /* USER CODE END TIM15_Init 0 */

  TIM_ClockConfigTypeDef sClockSourceConfig = {0};
  TIM_MasterConfigTypeDef sMasterConfig = {0};

  /* USER CODE BEGIN TIM15_Init 1 */

  /* USER CODE END TIM15_Init 1 */
  htim15.Instance = TIM15;
  htim15.Init.Prescaler = 60000;
  htim15.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim15.Init.Period = 3000;
  htim15.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  htim15.Init.RepetitionCounter = 0;
  htim15.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
  if (HAL_TIM_Base_Init(&htim15) != HAL_OK)
  {
    Error_Handler();
  }
  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
  if (HAL_TIM_ConfigClockSource(&htim15, &sClockSourceConfig) != HAL_OK)
  {
    Error_Handler();
  }
  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  if (HAL_TIMEx_MasterConfigSynchronization(&htim15, &sMasterConfig) != HAL_OK)
  {
    Error_Handler();
  }
  /* USER CODE BEGIN TIM15_Init 2 */
  HAL_TIM_Base_Start_IT(&htim15);
  /* USER CODE END TIM15_Init 2 */

}
/**
  * @brief TIM15 Initialization Function
  * @param None
  * @retval None
  */
@brief TIM15 Initialization Function
@param None
@retval None
@brief TIM15 Initialization Function @param None @retval None
static void MX_TIM15_Init(void)
{
  TIM_ClockConfigTypeDef sClockSourceConfig = {0};
  TIM_MasterConfigTypeDef sMasterConfig = {0};
  htim15.Instance = TIM15;
  htim15.Init.Prescaler = 60000;
  htim15.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim15.Init.Period = 3000;
  htim15.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  htim15.Init.RepetitionCounter = 0;
  htim15.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
  if (HAL_TIM_Base_Init(&htim15) != HAL_OK)
  {
    Error_Handler();
  }
  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
  if (HAL_TIM_ConfigClockSource(&htim15, &sClockSourceConfig) != HAL_OK)
  {
    Error_Handler();
  }
  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  if (HAL_TIMEx_MasterConfigSynchronization(&htim15, &sMasterConfig) != HAL_OK)
  {
    Error_Handler();
  }
  HAL_TIM_Base_Start_IT(&htim15);
}
static void MX_TIM15_Init ( void ) { TIM_ClockConfigTypeDef sClockSourceConfig = { 0 } ; TIM_MasterConfigTypeDef sMasterConfig = { 0 } ; htim15 . Instance = TIM15 ; htim15 . Init . Prescaler = 60000 ; htim15 . Init . CounterMode = TIM_COUNTERMODE_UP ; htim15 . Init . Period = 3000 ; htim15 . Init . ClockDivision = TIM_CLOCKDIVISION_DIV1 ; htim15 . Init . RepetitionCounter = 0 ; htim15 . Init . AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE ; if ( HAL_TIM_Base_Init ( & htim15 ) != HAL_OK ) { Error_Handler ( ) ; } sClockSourceConfig . ClockSource = TIM_CLOCKSOURCE_INTERNAL ; if ( HAL_TIM_ConfigClockSource ( & htim15 , & sClockSourceConfig ) != HAL_OK ) { Error_Handler ( ) ; } sMasterConfig . MasterOutputTrigger = TIM_TRGO_RESET ; sMasterConfig . MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE ; if ( HAL_TIMEx_MasterConfigSynchronization ( & htim15 , & sMasterConfig ) != HAL_OK ) { Error_Handler ( ) ; } HAL_TIM_Base_Start_IT ( & htim15 ) ; }
@brief TIM15 Initialization Function
 @param None
 @retval None
@brief TIM15 Initialization Function @param None @retval None
/* USER CODE BEGIN TIM15_Init 0 */ /* USER CODE END TIM15_Init 0 */ /* USER CODE BEGIN TIM15_Init 1 */ /* USER CODE END TIM15_Init 1 */ /* USER CODE BEGIN TIM15_Init 2 */ /* USER CODE END TIM15_Init 2 */