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

📄 sysserial.c

📁 ixp2400 bsp for vxworks
💻 C
字号:
/* sysSerial.c - NS 16550 UART bsp serial device initialization *//* Copyright 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------rev, mar02, vgd - Initial Port from BRH_BE BSP to IXDP2400 */#include "vxWorks.h"#include "iv.h"#include "intLib.h"#include "config.h"#include "sysLib.h"#include "ixdp2400Sio.h"/* local data */LOCAL IXP2400_CHAN ixp2400Chan[IXP2400_UART_N_UARTS];/******************************************************************************** sysSerialHwInit - initialize the BSP serial devices to a quiesent state** This routine initializes the BSP serial device descriptors and puts the* devices in a quiesent state.  It is called from sysHwInit() with* interrupts locked.** RETURNS: N/A*/void sysSerialHwInit (void)    {     /* intialize the chips device descriptors */               ixp2400Chan[0].regs      = (UINT8 *)IXP2400_UART_ADDR;        ixp2400Chan[0].level     = IXP2400_INT_UART;        ixp2400Chan[0].regDelta  = IXP2400_UART_REG_DELTA;         ixp2400Chan[0].xtal      = IXP2400_UART_XTAL;        ixp2400Chan[0].baudRate  = UART_DEFAULT_BAUD;#ifdef SECOND_UART		ixp2400Chan[0].regs      = (UINT8 *)IXP2400_UART_ADDR;        ixp2400Chan[0].level     = IXP2400_INT_UART;        ixp2400Chan[0].regDelta  = IXP2400_UART_REG_DELTA;         ixp2400Chan[0].xtal      = IXP2400_UART_XTAL;        ixp2400Chan[0].baudRate  = UART_DEFAULT_BAUD;#endif         /* reset the chips */        ixp2400DevInit (&ixp2400Chan[0]);#ifdef SECOND_UART                ixp2400DevInit (&ixp2400Chan[1]);#endif    }/******************************************************************************** sysSerialHwInit2 - connect BSP serial device interrupts** This routine connects the BSP serial device interrupts.  It is called from* sysHwInit2().  Serial device interrupts could not be connected in* sysSerialHwInit() because the kernel memory allocator was not initialized* at that point, and intConnect() calls malloc().** RETURNS: N/A*/void sysSerialHwInit2 (void)    {    /* now connect the serial device interrupts */    /* Connect serial interrupts. */     (void) intConnect (INUM_TO_IVEC((UINT32)ixp2400Chan[0].level),                       (VOIDFUNCPTR) ixp2400Int, (int)&ixp2400Chan[0]);#ifdef SECOND_UART	(void) intConnect (INUM_TO_IVEC((UINT32)ixp2400Chan[1].level),                       (VOIDFUNCPTR) ixp2400Int, (int)&ixp2400Chan[1]);#endif                /* Enable the UART interrupt */        intEnable (ixp2400Chan[0].level);#ifdef SECOND_UART 	intEnable (ixp2400Chan[1].level);#endif        }/******************************************************************************** sysSerialChanGet - get the SIO_CHAN device associated with a serial channel** This routine gets the SIO_CHAN device associated with a specified serial* channel.** RETURNS: A pointer to the SIO_CHAN structure for the channel, or ERROR* if the channel is invalid.*/SIO_CHAN * sysSerialChanGet    (    int channel    )    {       switch(channel)	{	case 0:		 return ((SIO_CHAN *)&ixp2400Chan[0]);#ifdef SECOND_UART	case 1: 		return ((SIO_CHAN *)&ixp2400Chan[1]);#endif    default:    return ((SIO_CHAN *)ERROR);   	}        }/******************************************************************************** sysSerialReset - reset the sio devices to a quiet state** Reset all devices to prevent them from generating interrupts.** This is called from sysToMonitor() to shutdown the system gracefully* before transferring control to the boot ROM.** RETURNS: N/A.*/void sysSerialReset (void)    {           /* Disable the UART interrupt */    intDisable (ixp2400Chan[0].level);#ifdef SECOND_UART    intDisable (ixp2400Chan[1].level);#endif	       }

⌨️ 快捷键说明

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