/** ****************************************************************************** * File Name : TIM.c * Description : This file provides code for the configuration * of the TIM instances. ****************************************************************************** * @attention * *

© Copyright (c) 2021 STMicroelectronics. * All rights reserved.

* * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "tim.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /* TIM6 init function */ void MX_TIM6_Init(void) { LL_TIM_InitTypeDef TIM_InitStruct = {0}; /* Peripheral clock enable */ LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM6); /* TIM6 interrupt Init */ NVIC_SetPriority(TIM6_DAC_IRQn, 0); NVIC_EnableIRQ(TIM6_DAC_IRQn); TIM_InitStruct.Prescaler = 300; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 20; LL_TIM_Init(TIM6, &TIM_InitStruct); LL_TIM_EnableARRPreload(TIM6); LL_TIM_SetTriggerOutput(TIM6, LL_TIM_TRGO_UPDATE); LL_TIM_DisableMasterSlaveMode(TIM6); } /* TIM14 init function */ void MX_TIM14_Init(void) { LL_TIM_InitTypeDef TIM_InitStruct = {0}; /* Peripheral clock enable */ LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM14); /* TIM14 interrupt Init */ NVIC_SetPriority(TIM14_IRQn, 0); NVIC_EnableIRQ(TIM14_IRQn); TIM_InitStruct.Prescaler = 47999; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 4999; TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; LL_TIM_Init(TIM14, &TIM_InitStruct); LL_TIM_DisableARRPreload(TIM14); } /* TIM17 init function */ void MX_TIM17_Init(void) { LL_TIM_InitTypeDef TIM_InitStruct = {0}; /* Peripheral clock enable */ LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_TIM17); /* TIM17 interrupt Init */ NVIC_SetPriority(TIM17_IRQn, 0); NVIC_EnableIRQ(TIM17_IRQn); TIM_InitStruct.Prescaler = 48000; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 3000; TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TIM_InitStruct.RepetitionCounter = 0; LL_TIM_Init(TIM17, &TIM_InitStruct); LL_TIM_DisableARRPreload(TIM17); } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/