forked from trocache/RefKEIL
46 lines
456 B
C
46 lines
456 B
C
#include "stm32f10x.h"
|
|
#include "Driver_GPIO.h"
|
|
|
|
|
|
// PA5 LED
|
|
// PC13 BP
|
|
|
|
MyGPIO_Struct_TypeDef LED;
|
|
|
|
int delay(){
|
|
int i;
|
|
for(i=0;i<1000000;i++);
|
|
}
|
|
|
|
|
|
int main ( void )
|
|
{
|
|
|
|
LED.GPIO=GPIOA;
|
|
LED.GPIO_Conf=Out_Ppull;
|
|
LED.GPIO_Pin=5;
|
|
|
|
MyGPIO_Init(&LED);
|
|
|
|
LED.GPIO=GPIOC;
|
|
LED.GPIO_Conf = In_PullUp;
|
|
LED.GPIO_Pin=13;
|
|
|
|
|
|
MyGPIO_Init(&LED);
|
|
|
|
|
|
|
|
|
|
|
|
while(1)
|
|
{
|
|
|
|
if(MyGPIO_Read(GPIOC, 13) == 0)
|
|
{
|
|
MyGPIO_Toggle(GPIOA, 5);
|
|
delay();
|
|
}
|
|
}
|
|
|
|
}
|