46 lines
883 B
C
46 lines
883 B
C
#include "stm32f10x.h"
|
|
#include "gpio.h"
|
|
#include "MyTimer.h"
|
|
#include "adc.h"
|
|
|
|
void clignot(void){
|
|
gpio_toggle(GPIOA,13);
|
|
}
|
|
|
|
int main ( void )
|
|
{
|
|
//RCC->APB2ENR |= (0x01 << 2) | (0x01 << 3) | (0x01 << 4) ;
|
|
// TIM2->CR1 |= 1;
|
|
// TIM2->ARR=6000;
|
|
// TIM2->PSC=6000;
|
|
|
|
// MyTimer_Base_Init(TIM2,6000,6000);
|
|
// TIM2->DIER |= 1;//tim2 transmet flag uif
|
|
// MyTimer_ActiveIT(TIM2, 4, clignot);
|
|
// NVIC->ISER[0] |= NVIC_ISER_SETENA_25; //tim2 ligne 28
|
|
// TIM2->CCR1 = 2000;
|
|
// MyTimer_PWM(TIM2, 1);
|
|
|
|
|
|
// MyTimer_Base_Init(TIM4,720,1);
|
|
// TIM2->DIER |= 1;//tim2 transmet flag uif
|
|
// NVIC->ISER[0] |= NVIC_ISER_SETENA_25; //tim2 ligne 28
|
|
// TIM4->CCR1 = 2000;
|
|
// MyTimer_PWM(TIM4, 1);
|
|
// MyTimer_PWM_Setup(TIM4,20,1);
|
|
//
|
|
// gpio_init( GPIOB, 6 , AltOut_Ppull);
|
|
|
|
|
|
// ADC
|
|
|
|
|
|
ADC_Base_Init(ADC1,1);
|
|
|
|
while (1)
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
|