RefKEIL/ProjetsKEIL/Drivers/Source/Principale.c

18 lines
343 B
C

#include "stm32f10x.h"
#include "../gpiodriver.h"
#define CEN 0x0
int main (void)
{
int returnValue;
MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp}; //led
MyGPIO_Init(&led);
TIM2->PSC = 7199;
TIM2->ARR = 499;
TIM2->CR1 = TIM2->CR1 | (0x01<<CEN);
//Pour reset le timer : RCC_APB1RSTR
do{
returnValue = TIM2->CNT;
}while(1) ;
}