/******************** (C) COPYRIGHT 2013 STMicroelectronics ********************
* File Name : main.c
* Author : WWW.ARMJISHU.COM之STM32核心团队 JESSE
* Version :
* Date :
* Description : STM32神舟III号开发板 广州
*******************************************************************************/
#include "stm32f10x.h"
//#include "led.h"
//#include "stm32f10x_gpio.h"
void delay(vu32 nCount);
uint8_t DATA = 0;//这一句写在main函数里面,仿真运行到断点 DATA通过keil看到的就是???,放在这里是对的
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE);
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
while(1)
{
delay(800000); //延时
DATA = GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_1);//PFInBit(9);
/*断点*/ delay(800000); //延时
}
}
void delay(vu32 nCount)
{
for(; nCount != 0; nCount--);
}
/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
|