LED_C.C
资源名称:arm_exam.rar [点击查看]
上传用户:mhstny
上传日期:2022-08-05
资源大小:793k
文件大小:1k
源码类别:
微处理器开发
开发平台:
Unix_Linux
- #define rGPFCON (*(volatile unsigned *)0x56000050) //Port F control
- #define rGPFDAT (*(volatile unsigned *)0x56000054) //Port F data
- #define rGPFUP (*(volatile unsigned *)0x56000058) //Pull-up control F
- void delay(int times);
- void xmain(void)
- {
- rGPFCON=(rGPFCON|0xFF00)&0x55FF;//GPF4--GPF7设置为output
- rGPFUP|=0xF0; //disable GPF pull up
- while(1)
- {
- rGPFDAT=(rGPFDAT&0x0F)|0xE0;//GPF4 output 0
- delay(500000);//delay
- rGPFDAT=(rGPFDAT&0x0F)|0xD0;//GPF5 output 0
- delay(500000);//delay
- rGPFDAT=(rGPFDAT&0x0F)|0xB0;//GPF6 output 0
- delay(500000);//delay
- rGPFDAT=(rGPFDAT&0x0F)|0x70;//GPF7 output 0
- delay(500000);//delay
- }
- }
- void delay(int times)
- {
- int i;
- for(i=0;i<times;i++);
- }