RefKEIL/ProjetsKEIL/Drivers/Source/Principale.c

19 lines
No EOL
376 B
C

#include "stm32f10x.h"
#include "../gpiodriver.h"
#define CEN 0x0
int main (void)
{
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);
while(1){
if(MyGPIO_Read(GPIOC,13))
{
MyGPIO_Reset(GPIOA,5);
} else {
MyGPIO_Set(GPIOA,5);
}
};
}