#include "stm32h7xx.h"	 
#include "stm32h7xx_ll_tim.h"	

void delay_us(unsigned int nus)
{	
	LL_TIM_SetCounter(TIM6,0);
	LL_TIM_SetAutoReload(TIM6,(10*nus-1));
	LL_TIM_EnableCounter(TIM6);
	while(!(LL_TIM_IsActiveFlag_UPDATE(TIM6))){
		;
	}
	LL_TIM_ClearFlag_UPDATE(TIM6);
	LL_TIM_DisableCounter(TIM6);
}

void delay_ms(unsigned int nms)
{
	unsigned int i = 0;
	for(i=0;i<nms;i++){
		delay_us(1000);
	}
}
