emif.c

来自「dsp vc5509 的多通道SPI通信程序」· C语言 代码 · 共 43 行

C
43
字号
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 + =
减小字号Ctrl + -
显示快捷键?