#include "./BSP/TIME6/time6.h"

TIM_HandleTypeDef TIM6_Handler;    

void timer6_init(short arr,short psc)
{ 
    __HAL_RCC_TIM6_CLK_ENABLE();
    HAL_NVIC_SetPriority(TIM6_IRQn,3,3);   
    HAL_NVIC_EnableIRQ(TIM6_IRQn);        
    
    TIM6_Handler.Instance=TIM6;                        
    TIM6_Handler.Init.Prescaler=psc;                     
    TIM6_Handler.Init.CounterMode=TIM_COUNTERMODE_UP;   
    TIM6_Handler.Init.Period=arr;                        
    TIM6_Handler.Init.ClockDivision=TIM_CLOCKDIVISION_DIV1;
    HAL_TIM_Base_Init(&TIM6_Handler);
    HAL_TIM_Base_Start_IT(&TIM6_Handler); 
}

