forked from trocache/RefKEIL
28 lines
402 B
C
28 lines
402 B
C
#include "stm32f10x.h"
|
|
#include "GPIO.h"
|
|
|
|
MyGPIO_Struct_TypeDef PA5;
|
|
MyGPIO_Struct_TypeDef PC13;
|
|
//PA5 LED
|
|
//PC13 Bouton
|
|
|
|
int main ( void )
|
|
{
|
|
PA5.GPIO=GPIOA;
|
|
PA5.GPIO_Conf=Out_Ppull;
|
|
PA5.GPIO_Pin=5;
|
|
MyGPIO_Init(&PA5);
|
|
|
|
PC13.GPIO=GPIOC;
|
|
PC13.GPIO_Conf=In_Floating;
|
|
PC13.GPIO_Pin=13;
|
|
MyGPIO_Init(&PC13);
|
|
while(1)
|
|
{
|
|
if(!MyGPIO_Read(PC13.GPIO,13))
|
|
{
|
|
MyGPIO_Toggle(PA5.GPIO,5);
|
|
}
|
|
}
|
|
|
|
}
|