微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > S3C2440开发工具realview MDK4.22使用入门

S3C2440开发工具realview MDK4.22使用入门

时间:11-19 来源:互联网 点击:

led.c文件:

#include"S3C2440.h"
#define gpbcon (*(volatile ulong *)0xa0000010)
#define gpbdat (*(volatile ulong *)0xa0000014)

static __inline void wait(ulong dly);



#define GPB5_out (1<(5*2))
#define GPB6_out (1<(6*2))
#define GPB7_out (1<(7*2))
#define GPB8_out (1<(8*2))

static __inline void wait(ulong dly)
{
for(;dly > 0; dly--);
}

int Main(void)
{
ulongi = 0;

gpbcon= GPB5_out | GPB6_out | GPB7_out | GPB8_out;
while(1)
{
wait(3000000);
gpbdat= (~(i<5));
if(++i== 16)
i=0;
}
}

内存布局scatter文件:

;*
; * Scatter-Loading Description File generated by uVision *
; *

LR_ROM1 0x00000000 0x00200000 { ; load region size_region
NANDFLASH 0x00000000 0x00200000 { ; load address = executionaddress
*.o (initcode, +First)
.ANY (+RO)
}
}

LR_ROM2 2048 2048 {
SDRAM 0xb0004000 {
led.o (*)
}
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top