📄 led_on_c.c
字号:
#define GPBCON (*(volatile unsigned long *)0x56000010)#define GPBDAT (*(volatile unsigned long *)0x56000014)#define BWSCON (*(volatile unsigned long *)0x48000000)#define BANKCON6 (*(volatile unsigned long *)0x4800001c)#define REFRESH (*(volatile unsigned long *)0x48000024)#define BANKSIZE (*(volatile unsigned long *)0x48000028)#define MRSRB6 (*(volatile unsigned long *)0x4800002c)#define MEM_BASE (volatile unsigned long *)0x30000000#define TEST_DAT (*(volatile unsigned long *)0x08000000)#define mem1 (*(volatile unsigned long *)0x53000000)#define mem2 (*(volatile unsigned long *)0x4a000008)#define mem3 (*(volatile unsigned long *)0x4a00001c)#define mem4 (*(volatile unsigned long *)0x4c000000)#define mem5 (*(volatile unsigned long *)0x4c000004)#define mem6 (*(volatile unsigned long *)0x48000000)#define mem7 (*(volatile unsigned long *)0x48000004)#define mem8 (*(volatile unsigned long *)0x48000008)#define mem9 (*(volatile unsigned long *)0x4800000c)#define mem10 (*(volatile unsigned long *)0x48000010)#define mem11 (*(volatile unsigned long *)0x48000014)#define mem12 (*(volatile unsigned long *)0x48000018)#define mem13 (*(volatile unsigned long *)0x4800001c)#define mem14 (*(volatile unsigned long *)0x48000020)#define mem15 (*(volatile unsigned long *)0x48000024)#define mem16 (*(volatile unsigned long *)0x48000028)#define mem17 (*(volatile unsigned long *)0x4800002c)#define mem18 (*(volatile unsigned long *)0x48000030)#define test1 (*(volatile unsigned long *)0x30000000)#define test2 (*(volatile unsigned long *)0x30000002)#define test3 (*(volatile unsigned long *)0x30000010)#define TEST_MEM_SET#define TEST_LED_ON#ifndef TEST_MEM_SET#define LED_SPARK_TIME_DELAY 40000#else#define LED_SPARK_TIME_DELAY 200000#endifvoid idle(void);void conf(int conf, int dat);int main(){#ifdef TEST_MEM_SET unsigned long i; unsigned long j; mem1= 0x00000000; mem2= 0xffffffff; mem3= 0x000007ff; mem4= 0x00ffffff; mem5= 0x0005c042; mem6= 0x21111112; mem7= 0x00000700; mem8= 0x00000700; mem9= 0x00000700; mem10= 0x00000700; mem11= 0x00000700; mem12= 0x00000700; mem13= 0x00018005; mem14= 0x00018005; mem15= 0x008e0459; mem16= 0x000000b0; mem17= 0x00000030; mem18= 0x00000030;#endif/* *configuration BWSCON= 0x21111110; BANKCON6= 0x00018005; REFRESH= 0x00ae0456; BANKSIZE= 0xb2; MRSRB6= 0x30;*/#ifdef TEST_MEM_SETtest1=0x55aa;test2=0x1177;test3=0x1234;#endif/* for(i=0; i<20; i=i+2){ *(MEM_BASE+i)= 0xaa55; } for(i=30; i<60; i=i+2){ *(MEM_BASE+i)= 0x1177; } while(1){ j= TEST_DAT; j++; }*/#ifdef TEST_LED_ON while(1){ conf(0x5, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x4, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x5, 0x0); idle(); conf(0x4, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x5, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x4, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x5, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x4, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x5, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x4, 0x0); idle(); conf(0x1, 0x0); idle(); conf(0x5, 0x0); idle(); }#endif return 0;}void idle(void){ int i=0; for(i=0; i<LED_SPARK_TIME_DELAY; i++); return;}void conf(int conf, int dat){ GPBCON= conf; GPBDAT= dat; return;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -