30 lines
564 B
C
30 lines
564 B
C
#include "stm32f10x.h"
|
|
#include "Driver_GPIO.h"
|
|
#include "Driver_Timer.h"
|
|
#include "Driver_ADC.h"
|
|
|
|
void toto (void)
|
|
{
|
|
static uint16_t val;
|
|
val = driver_adc_1_read();
|
|
}
|
|
|
|
int main() {
|
|
MyGPIO_Struct_TypeDef LED;
|
|
MyGPIO_Struct_TypeDef GPIO_ADC1;
|
|
|
|
LED.GPIO_Pin = 5;
|
|
LED.GPIO_Conf = Out_Ppull;
|
|
LED.GPIO = GPIOA;
|
|
MyGPIO_Init(&LED);
|
|
MyGPIO_Set(LED.GPIO, LED.GPIO_Pin);
|
|
|
|
GPIO_ADC1.GPIO_Pin = 1;
|
|
GPIO_ADC1.GPIO_Conf = In_Analog;
|
|
GPIO_ADC1.GPIO = GPIOC;
|
|
MyGPIO_Init(&GPIO_ADC1);
|
|
|
|
driver_adc_1_init(0x01,&toto);
|
|
driver_adc_1_launch_read();
|
|
while(1);
|
|
}
|