www.pudn.com > FFT.rar > sdram_init.c


#include "myapp.h" 
 
void SDRAM_init( void ) 
{       
    ioport unsigned int *ebsr  =(unsigned int *)0x6c00; 
    ioport unsigned int *egcr  =(unsigned int *)0x800; 
    ioport unsigned int *emirst=(unsigned int *)0x801; 
    //ioport unsigned int *emibe =(unsigned int *)0x802;   
    ioport unsigned int *ce01  =(unsigned int *)0x803; 
    //ioport unsigned int *ce02  =(unsigned int *)0x804; 
    //ioport unsigned int *ce03  =(unsigned int *)0x805; 
    ioport unsigned int *ce11  =(unsigned int *)0x806; 
    //ioport unsigned int *ce12  =(unsigned int *)0x807; 
    //ioport unsigned int *ce13  =(unsigned int *)0x808; 
    ioport unsigned int *ce21  =(unsigned int *)0x809; 
    //ioport unsigned int *ce22  =(unsigned int *)0x80A; 
    //ioport unsigned int *ce23  =(unsigned int *)0x80B; 
    ioport unsigned int *ce31  =(unsigned int *)0x80C; 
    //ioport unsigned int *ce32  =(unsigned int *)0x80D; 
    //ioport unsigned int *ce33  =(unsigned int *)0x80E; 
    ioport unsigned int *sdc1  =(unsigned int *)0x80F; 
    //ioport unsigned int *sdper =(unsigned int *)0x810; 
    //ioport unsigned int *sdcnt =(unsigned int *)0x811; 
    ioport unsigned int *init  =(unsigned int *)0x812; 
    ioport unsigned int *sdc2  =(unsigned int *)0x813; 
    //*ebsr   = 0x221;//0xa01 
    *ebsr   = 0xa01; 
    *egcr   = 0x220; 
    *egcr   = 0X220; 
    *ce01   = 0X3000; 
    *ce11   = 0X1fff; 
    *ce21   = 0x1fff; 
    *ce31   = 0x1fff; 
    *emirst = 0; 
    *sdc1   = 0X5958; 
    *sdc2   = 0X38F; 
    *init   = 0; 
}