微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > s3c2440对norflash的操作

s3c2440对norflash的操作

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

Rdiv0 = 26;

rSRCPND = (0x1<19)|(0x1<28);

rSUBSRCPND = 0x1;

rINTPND = (0x1<19)|(0x1<28);

rINTSUBMSK = ~(0x1);

rINTMSK = ~((0x1<19)|(0x1<28));

pISR_UART0 = (U32)uartISR;

cmd = 0;

while(1)

{

switch(cmd)

{

case 1: //读ID

cmd = 0;

temp = get_en29lv160ab_id();

while(!(rUTRSTAT0 & 0x2)) ;

rUTXH0=(U8)((temp&0xff000000)>>24);

while(!(rUTRSTAT0 & 0x2)) ;

rUTXH0=(U8)((temp&0x00ff0000)>>16);

while(!(rUTRSTAT0 & 0x2)) ;

rUTXH0=(U8)((temp&0x0000ff00)>>8);

while(!(rUTRSTAT0 & 0x2)) ;

rUTXH0=(U8)((temp&0x000000ff));

reset_en29lv160ab();

break;

case 0x7:

cmd = 0;

test_en29lv160ab();

break;

case 0x6:

cmd = 0;

test_en29lv160ab_CFI();

reset_en29lv160ab();

break;

}

}

}

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

网站地图

Top