/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file tim.c * @brief This file provides code for the configuration * of the TIM instances. ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "tim.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /* TIM14 init function */ void MX_TIM14_Init(void) { /* USER CODE BEGIN TIM14_Init 0 */ /* USER CODE END TIM14_Init 0 */ LL_TIM_InitTypeDef TIM_InitStruct = {0}; /* Peripheral clock enable */ LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM14); /* TIM14 interrupt Init */ NVIC_SetPriority(TIM14_IRQn, 1); NVIC_EnableIRQ(TIM14_IRQn); /* USER CODE BEGIN TIM14_Init 1 */ /* USER CODE END TIM14_Init 1 */ TIM_InitStruct.Prescaler = 6399; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 1699; TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; LL_TIM_Init(TIM14, &TIM_InitStruct); LL_TIM_EnableARRPreload(TIM14); /* USER CODE BEGIN TIM14_Init 2 */ /* USER CODE END TIM14_Init 2 */ } /* TIM16 init function */ void MX_TIM16_Init(void) { /* USER CODE BEGIN TIM16_Init 0 */ /* USER CODE END TIM16_Init 0 */ LL_TIM_InitTypeDef TIM_InitStruct = {0}; /* Peripheral clock enable */ LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM16); /* TIM16 interrupt Init */ NVIC_SetPriority(TIM16_IRQn, 1); NVIC_EnableIRQ(TIM16_IRQn); /* USER CODE BEGIN TIM16_Init 1 */ /* USER CODE END TIM16_Init 1 */ TIM_InitStruct.Prescaler = 6399; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 29999; TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TIM_InitStruct.RepetitionCounter = 0; LL_TIM_Init(TIM16, &TIM_InitStruct); LL_TIM_DisableARRPreload(TIM16); /* USER CODE BEGIN TIM16_Init 2 */ /* USER CODE END TIM16_Init 2 */ } /* TIM17 init function */ void MX_TIM17_Init(void) { /* USER CODE BEGIN TIM17_Init 0 */ /* USER CODE END TIM17_Init 0 */ LL_TIM_InitTypeDef TIM_InitStruct = {0}; /* Peripheral clock enable */ LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM17); /* TIM17 interrupt Init */ NVIC_SetPriority(TIM17_IRQn, 1); NVIC_EnableIRQ(TIM17_IRQn); /* USER CODE BEGIN TIM17_Init 1 */ /* USER CODE END TIM17_Init 1 */ TIM_InitStruct.Prescaler = 6399; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 9999; TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TIM_InitStruct.RepetitionCounter = 0; LL_TIM_Init(TIM17, &TIM_InitStruct); LL_TIM_DisableARRPreload(TIM17); /* USER CODE BEGIN TIM17_Init 2 */ /* USER CODE END TIM17_Init 2 */ } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */