sd_dskcomm_init.c

来自「dm642网络传输程序」· C语言 代码 · 共 45 行

C
45
字号
//--------------------------------------------------------------------------
// IP Stack Client Demo
//--------------------------------------------------------------------------
// sd_dskcomm_init.c
//
// Private initialization function for the Spectrum Digital DSK Comm Adapter
//
// This function can be plugged into the user init function of the DSP/BIOS
// .CDB file to initialize the Spectrum Digital "DSK Communucations Adapter"
// so that is works with the standard SMSC Etherent driver as shipped in
// the NDK.
//
//--------------------------------------------------------------------------

#define CE3 (*(unsigned int *)0x1800014)
#define CPLD_REG1 (*(unsigned int *)0xb0000004)
#define CPLD_REG2 (*(unsigned int *)0xb0000008)

//
// dskcomm_init()
//
// Use the UserInit function of the CDB file to call this private init
// function. It will initialize the SD DSK Comm board to be compatible
// with the NDK SMSC Ethernet driver.
//
void sd_dskcomm_init()
{
    volatile int i;

    // Setup CE3 (to access CPLD regs)
    CE3 = 0x22a28a22;

    // SMSC in reset
    CPLD_REG1 = 0x87;

    for(i=0;i<100000;i++);

    // SMSC out of reset
    CPLD_REG1 = 0x86;

    // Use EXTINT4 and invert it
    CPLD_REG2 = 0x11;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?