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

📄 sysultraend.c

📁 鼎鼎大名的WRS提供的VxWorks下pcPentium BSP开发包
💻 C
字号:
/* sysUltraEnd.c - system configuration module for smc Elite Ultra END */ /* Copyright 1999 Wind River Systems, Inc. */ /*modification history--------------------01a,09mar99,sbs  written from sysNE2000End.c*//*DESCRIPTIONThis is the WRS-supplied configuration module for the VxWorks smc Elite Ultra (ultra) END driver. It performs the dynamic parameterization of the ultraEnd driver.This technique of 'just-in-time' parameterization allows driverparameter values to be declared as any other defined constants rather than as static strings. */ /* includes */#include "vxWorks.h"#include "stdio.h"#include "stdlib.h"#include "string.h"#include "end.h"#include "config.h"#ifdef INCLUDE_ULTRA_END /* defines */#define ULTRA_OFFSET	0x00 /* imports */IMPORT END_OBJ * ultraLoad (char *);/******************************************************************************** sysUltraEndLoad - load (create) smc elite ultra (ultra) device** This routine loads the ene device with initial parameters specified by* values given in the BSP configuration files (config.h).** RETURNS: pointer to END object or ERROR.** SEE ALSO: ultraLoad()*/ END_OBJ * sysUltraEndLoad    (    char * pParamStr,   /* ptr to initialization parameter string */    void * unused       /* unused optional argument */    )    {    /*     * The ultraEnd driver END_LOAD_STRING should be:     * "<ioAddr>:<memAddr>:<vecNum>:<intLvl>:<config>:<offset>"     * Note that ultraEnd unit number is prepended by the mux.     */    char * cp; 			    char paramStr [END_INIT_STR_MAX];   /* from end.h */    static char ultraEndParamTemplate [] = "%#x:%#x:%#x:%#x:%#x:%x";    END_OBJ * pEnd;    if (strlen (pParamStr) == 0)        {        /*          * muxDevLoad() calls us twice.  If the string is         * zero length, then this is the first time through         * this routine, so we just return.         */        pEnd = ultraLoad (pParamStr);        }    else	{        /*         * On the second pass though here, we actually create          * the initialization parameter string on the fly.            * Note that we will be handed our unit number on the          * second pass through and we need to preserve that information.         * So we use the unit number handed from the input string.         */        cp = strcpy (paramStr, pParamStr); /* cp points to paramStr */        /* Now, we advance cp, by finding the end the string */        cp += strlen (paramStr);                /* finish off the initialization parameter string */	sprintf (cp, ultraEndParamTemplate,                  IO_ADRS_ULTRA,                  MEM_ADRS_ULTRA,                 INT_VEC_ULTRA,                 INT_LVL_ULTRA,                  CONFIG_ULTRA,                 ULTRA_OFFSET);        if ((pEnd = ultraLoad (paramStr)) == (END_OBJ *)ERROR)	    {            printf ("Error: ultraEnd device failed ultraLoad routine.\n");	    }	}    return (pEnd);    } /********************************************************************************* sysUltraIntEnable - enable the board level interrupt** This routine enables the board level interrupt.** RETURNS: N/A** NOMANUAL*/void sysUltraIntEnable    (    int intLevel        /* irq level */    )    {    sysIntEnablePIC (intLevel);    }/********************************************************************************* sysUltraIntDisable - disable the board level interrupt** This routine disables the board level interrupt.** RETURNS: N/A** NOMANUAL*/void sysUltraIntDisable    (    int intLevel        /* irq level */    )    {    sysIntDisablePIC (intLevel);    }#endif /* INCLUDE_ULTRA_END */

⌨️ 快捷键说明

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