RefKEIL/ProjetsKEIL/Drivers/Source/Principale.c

20 lines
383 B
C

#include "stm32f10x.h"
#include "../gpiodriver.h"
int main ( void )
{
int returnValue;
MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp}; //led
MyGPIO_Struct_TypeDef bouton = {GPIOC,13,In_PullDown}; //bouton poussoir
MyGPIO_Init(&led);
MyGPIO_Init(&bouton);
do{
if(MyGPIO_Read(GPIOC,13))
{
MyGPIO_Reset(GPIOA,5);
} else {
MyGPIO_Set(GPIOA,5);
}
}while(1) ;
}