📄 emif.c
字号:
void initial_emif(void)
{
int i;
*EBSR=0x0201; //Parallel Port Mode:Full EMIF Mode
*EMI_RST=0x00; //复位EMIF状态机并等待100个周期
for(i=0;i<100;i++)
asm(" nop");
*EGCR=0x000f; //禁止同步时钟和总线申请占用
/* CE0_1 REG */
*CE0_1=0x121d; //16-bit asynchronous 121dh
//rsetup=2,rstrobe =7,rhold=1
/* CE0_2 REG */
*CE0_2=0x0319; //no ext hold 0319h
//wsetup=3,wstrobe=6,whold=1
/* CE0_3 REG */
*CE0_3=0x00ff; //timeout=31 001fh
/* CE1_1 REG */
*CE1_1=0x121d; //16-bit asynchronous 121dh
//rsetup=2,rstrobe =7,rhold=1
/* CE1_2 REG */
*CE1_2=0x0319; //no ext hold 0319h
//wsetup=3,wstrobe=6,whold=1
/* CE1_3 REG */
*CE1_3=0x00ff; //timeout=31 001fh
/* CE1_1 REG */
*CE2_1=0x121d; //16-bit asynchronous 121dh
//rsetup=2,rstrobe =7,rhold=1
/* CE1_2 REG */
*CE2_2=0x0319; //no ext hold 0319h
//wsetup=3,wstrobe=6,whold=1
/* CE1_3 REG */
*CE2_3=0x00ff; //timeout=31 001fh
/* CE1_1 REG */
*CE3_1=0x121d; //16-bit asynchronous 121dh
//rsetup=2,rstrobe =7,rhold=1
/* CE1_2 REG */
*CE3_2=0x0319; //no ext hold 0319h
//wsetup=3,wstrobe=6,whold=1
/* CE1_3 REG */
*CE3_3=0x00ff; //timeout=31 001fh
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -