⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sd_dskcomm_init.c

📁 闻停开发板视频程序
💻 C
字号:
//--------------------------------------------------------------------------
// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -