|
ok2440-III的跑马灯程序,哪为大侠可以帮注解下
[复制链接]
/*********************LED实验*********************************/
// 公司名称 :保定飞凌嵌入式技术有限公司
// 描 述 :跑马灯
#define GPFCON (*(volatile unsigned *)0x56000050)
#define GPFDAT (*(volatile unsigned *)0x56000054)
#define GPFUP (*(volatile unsigned *)0x56000058)
int LedMain()
{
void Delay(unsigned int);
unsigned char ledtab[]={0xf7,0xef,0xdf,0xbf};
int i;
GPFUP&=0XFFFFFF87; //使能上拉F3-6
GPFCON&=0XC03f;
GPFCON|=0X1540; //将F3-6设为输出口
while(1)
{
for(i=0;i<4;i++)
{
GPFDAT=ledtab;
Delay(70);
}
}
return(0);
}
void Delay(unsigned int x )
{
unsigned int i,j,k;
for(i=0;i<=x;i++)
for(j=0;j<=0xff;j++)
for(k=0;k<=0xff;k++);
}
尤其是下面这段不是很清楚
unsigned char ledtab[]={0xf7,0xef,0xdf,0xbf};
int i;
GPFUP&=0XFFFFFF87; //使能上拉F3-6
GPFCON&=0XC03f;
GPFCON|=0X1540; //将F3-6设为输出口
|
|