亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? primecellsio.c

?? workbench下vxworks6.6的ARM920T核對應的BSP源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* primeCellSio.c - ARM AMBA UART tty driver *//* * Copyright (c) 1997-2005 Wind River Systems, Inc. * * The right to copy, distribute or otherwise make use of this software * may be licensed only pursuant to the terms of an applicable Wind River * license agreement. *//*modification history--------------------01e,08jul05,h_k  added minimal poll driver feature.01d,02may05,mdo  SPR#10793001c,21feb00,jpd  renamed primecell... symbols to primeCell...01b,25jan00,jpd  renamed primeCellSio.c.01a,10nov99,ajb  copied from ambaSio.c, adding support for 1 interrupt per UART.*//*DESCRIPTIONThis is the device driver for the Advanced RISC Machines (ARM) AMBAUART. This is a generic design of UART used within a number of chipscontaining (or for use with) ARM CPUs such as in the Digital Semiconductor21285 chip as used in the EBSA-285 BSP.This design contains a universal asynchronous receiver/transmitter, abaud-rate generator, and an InfraRed Data Association (IrDa) SerialInfraRed (SiR) protocol encoder. The Sir encoder is not supported bythis driver. The UART contains two 16-entry deep FIFOs for receive andtransmit: if a framing, overrun or parity error occurs duringreception, the appropriate error bits are stored in the receive FIFOalong with the received data. The FIFOs can be programmed to be onebyte deep only, like a conventional UART with double buffering, but theonly mode of operation supported is with the FIFOs enabled.The UART design does not support the modem control output signals: DTR,RI and RTS. Moreover, the implementation in the 21285 chip does notsupport the modem control inputs: DCD, CTS and DSR.The UART design can generate four interrupts: Rx, Tx, modem statuschange and a UART disabled interrupt (which is asserted when a startbit is detected on the receive line when the UART is disabled). Theimplementation in the 21285 chip has only two interrupts: Rx and Tx,but the Rx interrupt is a combination of the normal Rx interrupt statusand the UART disabled interrupt status.Only asynchronous serial operation is supported by the UART whichsupports 5 to 8 bit word lengths with or without parity and withone or two stop bits. The only serial word format supported by thedriver is 8 data bits, 1 stop bit, no parity,  The default baud rate isdetermined by the BSP by filling in the AMBA_CHAN structure beforecalling ambaDevInit().The exact baud rates supported by this driver will depend on thecrystal fitted (and consequently the input clock to the baud-rategenerator), but in general, baud rates from about 300 to about 115200are possible.In theory, any number of UART channels could be implemented within achip. This driver has been designed to cope with an arbitrary number ofchannels, but at the time of writing, has only ever been tested withone channel.DATA STRUCTURESAn AMBA_CHAN data structure is used to describe each channel, thisstructure is described in h/drv/sio/ambaSio.h.CALLBACKSServicing a "transmitter ready" interrupt involves making a callback toa higher level library in order to get a character to transmit.  Bydefault, this driver installs dummy callback routines which do nothing.A higher layer library that wants to use this driver (e.g. ttyDrv)will install its own callback routine using the SIO_INSTALL_CALLBACKioctl command.  Likewise, a receiver interrupt handler makes a callbackto pass the character to the higher layer library. MODESThis driver supports both polled and interrupt modes.USAGEThe driver is typically only called by the BSP. The directly callableroutines in this modules are ambaDevInit(), ambaIntTx() andambaIntRx().The BSP's sysHwInit() routine typically calls sysSerialHwInit(), whichinitialises the hardware-specific fields in the AMBA_CHAN structure(e.g. register I/O addresses etc) before calling ambaDevInit() whichresets the device and installs the driver function pointers.  Afterthis the UART will be enabled and ready to generate interrupts, butthose interrupts will be disabled in the interrupt controller.The following example shows the first parts of the initialisation:\cs#include "primeCellSio.h"LOCAL AMBA_CHAN ambaChan[N_AMBA_UART_CHANS];void sysSerialHwInit (void)    {    int i;    for (i = 0; i < N_AMBA_UART_CHANS; i++)	{	ambaChan[i].regs = devParas[i].baseAdrs;	ambaChan[i].baudRate = CONSOLE_BAUD_RATE;	ambaChan[i].xtal = UART_XTAL_FREQ; 	ambaChan[i].levelRx = devParas[i].intLevelRx;	ambaChan[i].levelTx = devParas[i].intLevelTx;	/@	 * Initialise driver functions, getTxChar, putRcvChar and	 * channelMode, then initialise UART	 @/	ambaDevInit(&ambaChan[i]);	}    }\ceThe BSP's sysHwInit2() routine typically calls sysSerialHwInit2(),which connects the chips interrupts via intConnect() (the twointerrupts `ambaIntTx' and `ambaIntRx') and enables those interrupts,as shown in the following example:\csvoid sysSerialHwInit2 (void)    {    /@ connect and enable Rx interrupt @/    (void) intConnect (INUM_TO_IVEC(devParas[0].vectorRx),		       ambaIntRx, (int) &ambaChan[0]);    intEnable (devParas[0].intLevelRx);    /@ connect Tx interrupt @/    (void) intConnect (INUM_TO_IVEC(devParas[0].vectorTx),		       ambaIntTx, (int) &ambaChan[0]);    /@     * There is no point in enabling the Tx interrupt, as it will     * interrupt immediately and then be disabled.     @/    }\ceBSPBy convention all the BSP-specific serial initialisation is performedin a file called sysSerial.c, which is #include'ed by sysLib.c.sysSerial.c implements at least four functions, sysSerialHwInit()sysSerialHwInit2(), sysSerialChanGet(), and sysSerialReset(). The firsttwo have been described above, the others work as follows:sysSerialChanGet is called by usrRoot to get the serial channeldescriptor associated with a serial channel number. The routine takes asingle parameter which is a channel number ranging between zero andNUM_TTY. It returns a pointer to the corresponding channel descriptor,SIO_CHAN *, which is just the address of the AMBA_CHAN structure. sysSerialReset is called from sysToMonitor() and should reset theserial devices to an inactive state (prevent them from generating anyinterrupts).INCLUDE FILES:drv/sio/ambaSio.h sioLib.hSEE ALSO:\tb Advanced RISC Machines AMBA UART (AP13) Data Sheet, \tb Digital Semiconductor 21285 Core Logic for SA-110 Microprocessor Data Sheet,"\tb Digital Semiconductor EBSA-285 Evaluation Board Reference Manual. */#include <vxWorks.h>#include <intLib.h>#include <errnoLib.h>#include <errno.h>#include <sioLib.h>#include "primeCellSio.h"/* local defines  */#ifndef AMBA_UART_REG#define AMBA_UART_REG(pChan, reg) \	(*(volatile UINT32 *)((UINT32)(pChan)->regs + (reg)))#endif#ifndef AMBA_UART_REG_READ#define AMBA_UART_REG_READ(pChan, reg, result) \	(result) = (AMBA_UART_REG(pChan, reg))#endif#ifndef AMBA_UART_REG_WRITE#define AMBA_UART_REG_WRITE(pChan, reg, data) \	(AMBA_UART_REG(pChan, reg)) = (data)#endif#ifndef AMBA_UART_REG_BIT_SET#define AMBA_UART_REG_BIT_SET(pChan, reg, data) \	(AMBA_UART_REG(pChan, reg)) |= (data)#endif#ifndef AMBA_UART_REG_BIT_CLR#define AMBA_UART_REG_BIT_CLR(pChan, reg, data) \	(AMBA_UART_REG(pChan, reg)) &= ~(data)#endif/* locals *//* function prototypes */LOCAL STATUS ambaDummyCallback (void);LOCAL void   ambaInitChannel (AMBA_CHAN * pChan);LOCAL STATUS ambaIoctl (SIO_CHAN * pSioChan, int request, int arg);#ifdef	INCLUDE_TTY_DEVLOCAL int    ambaTxStartup (SIO_CHAN * pSioChan);LOCAL int    ambaCallbackInstall (SIO_CHAN * pSioChan, int callbackType,			       STATUS (*callback)(), void * callbackArg);#endif	/* INCLUDE_TTY_DEV */LOCAL int    ambaPollInput (SIO_CHAN * pSioChan, char *);LOCAL int    ambaPollOutput (SIO_CHAN * pSioChan, char);/* driver functions */LOCAL SIO_DRV_FUNCS ambaSioDrvFuncs =    {    (int (*)())                 ambaIoctl,#ifdef	INCLUDE_TTY_DEV    (int (*)())                 ambaTxStartup,    (int (*)())                 ambaCallbackInstall,#else	/* INCLUDE_TTY_DEV */    (int (*)())                 NULL,    (int (*)())                 NULL,#endif	/* INCLUDE_TTY_DEV */    (int (*)())                 ambaPollInput,    (int (*)(SIO_CHAN *,char))  ambaPollOutput    };/********************************************************************************* ambaDummyCallback - dummy callback routine.** This routine does nothing.** RETURNS: ERROR, always.** ERRNO*/LOCAL STATUS ambaDummyCallback (void)    {    return ERROR;    }/********************************************************************************* primeCellSioDevInit - initialise an AMBA channel** This routine initialises some SIO_CHAN function pointers and then resets* the chip to a quiescent state.  Before this routine is called, the BSP* must already have initialised all the device addresses, etc. in the* AMBA_CHAN structure.** RETURNS: N/A** ERRNO*/void primeCellSioDevInit    (    AMBA_CHAN *	pChan	/* ptr to AMBA_CHAN describing this channel */    )    {    int oldlevel = intLock();    /* initialise the driver function pointers in the SIO_CHAN */    pChan->sio.pDrvFuncs = &ambaSioDrvFuncs;    /* set the non BSP-specific constants */    pChan->getTxChar = ambaDummyCallback;    pChan->putRcvChar = ambaDummyCallback;    pChan->channelMode = 0;    /* undefined */    /* initialise the chip */    ambaInitChannel (pChan);    intUnlock (oldlevel);    }/********************************************************************************* ambaInitChannel - initialise UART** This routine performs hardware initialisation of the UART channel.** RETURNS: N/A** ERRNO*/LOCAL void ambaInitChannel    (    AMBA_CHAN *	pChan	/* ptr to AMBA_CHAN describing this channel */    )    {    int		i;    UINT32	discard;    /* Fill Tx FIFO with nulls (data sheet specifies this) */    for (i = 0; i < 16; i++)        AMBA_UART_REG_WRITE(pChan, UARTDR, 0);    /* Program UART control register */    AMBA_UART_REG_WRITE(pChan, UARTCON, 0);    AMBA_UART_REG_WRITE(pChan, UARTCON, UART_ENABLE);    /* Ensure that only Receive ints are generated. */    AMBA_UART_REG_BIT_CLR(pChan, 			  UARTCON, 			  UART_RTIE | UART_TIE | 			  UART_RIE | UART_MSIE );    AMBA_UART_REG_BIT_SET(pChan, UARTCON, UART_RIE | UART_RTIE);    /* Set baud rate divisor */    AMBA_UART_REG_WRITE(pChan, L_UBRLCR,		    (pChan->xtal / (16 * pChan->baudRate) - 1) & 0xFF);    AMBA_UART_REG_WRITE(pChan, M_UBRLCR,		    ((pChan->xtal / (16 * pChan->baudRate) - 1) >> 8) & 0xF);    /*     * Set word format, enable FIFOs: set 8 bits, 1 stop bit, no parity.     * This also latches the writes to the two (sub)registers above.     */    AMBA_UART_REG_WRITE(pChan, H_UBRLCR,	(UINT8)(WORD_LEN_8 | ONE_STOP | PARITY_NONE | FIFO_ENABLE));     /* Clear Rx FIFO (data sheet specifies this) */    for (i = 0; i < 16; i++)        AMBA_UART_REG_READ(pChan, RXSTAT, discard);    }/********************************************************************************* ambaIoctl - special device control** This routine handles the IOCTL messages from the user.** RETURNS: OK on success** ERRNO:  ENOSYS on unsupported request, EIO on failed request.*/LOCAL STATUS ambaIoctl    (    SIO_CHAN *	pSioChan,	/* ptr to SIO_CHAN describing this channel */    int		request,	/* request code */    int		arg		/* some argument */    )    {    int		oldlevel;	/* current interrupt level mask */    STATUS	status;		/* status to return */    UINT32	brd;		/* baud rate divisor */    AMBA_CHAN * pChan = (AMBA_CHAN *)pSioChan;    status = OK;	/* preset to return OK */    switch (request)        {        case SIO_BAUD_SET:            /*             * Set the baud rate. Return EIO for an invalid baud rate, or             * OK on success.             */            /*             * baudrate divisor must be non-zero and must fit in a 12-bit             * register.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线视频一区二区三区| 久久激情五月激情| 久久久91精品国产一区二区精品| 欧美一区二区不卡视频| 在线播放91灌醉迷j高跟美女| 色欧美88888久久久久久影院| 99国产精品99久久久久久| 成人一区二区三区中文字幕| 国产盗摄一区二区三区| 国产成人精品免费网站| 国产a区久久久| 色综合久久综合网97色综合| a美女胸又www黄视频久久| 91在线播放网址| 欧美在线free| 91精品国产欧美一区二区| 欧美精品一区视频| 中文字幕精品在线不卡| 一区二区三区中文字幕电影 | 国产精品自在欧美一区| 国产精品影视在线| 99re热这里只有精品免费视频| 日本伦理一区二区| 日韩欧美一区二区在线视频| 久久久久国产一区二区三区四区| 最新国产成人在线观看| 视频一区中文字幕| 国产成人午夜99999| 色88888久久久久久影院野外| 欧美一级片免费看| 欧美激情资源网| 亚洲高清视频的网址| 极品销魂美女一区二区三区| 色偷偷久久人人79超碰人人澡| 69堂成人精品免费视频| 国产精品免费久久| 国产成+人+日韩+欧美+亚洲| 91丨国产丨九色丨pron| 日韩欧美国产高清| 亚洲欧美在线另类| 美国十次综合导航| 色噜噜狠狠成人网p站| 日韩欧美激情四射| 亚洲欧美偷拍三级| 国产呦精品一区二区三区网站| 色综合中文字幕国产 | 国产精品二三区| 日本欧美一区二区| 91麻豆精东视频| 久久久一区二区| 天堂一区二区在线免费观看| 99re热这里只有精品视频| 精品国产一区二区三区久久影院| 亚洲女人的天堂| 国产一区二区三区免费看| 欧美色图天堂网| 中文字幕在线观看不卡| 国产一区二区三区精品视频| 欧美日韩一区成人| 国产精品久久久久久久久免费丝袜 | 欧美日韩精品免费观看视频| 欧美韩日一区二区三区四区| 久久se精品一区精品二区| 欧美美女bb生活片| 亚洲一区二区不卡免费| 99re这里都是精品| 日本一区二区三区电影| 另类欧美日韩国产在线| 91精选在线观看| 性做久久久久久免费观看| 欧美在线视频不卡| 亚洲午夜精品在线| 91视频观看视频| 亚洲免费观看高清完整版在线观看| 国产激情91久久精品导航| 久久综合色鬼综合色| 国产精品一区二区x88av| 久久久无码精品亚洲日韩按摩| 经典三级视频一区| 久久嫩草精品久久久精品一| 懂色av一区二区在线播放| 日本一区二区三区高清不卡| 成人av网址在线观看| 一区二区中文字幕在线| 91在线码无精品| 亚洲午夜一区二区| 7777精品伊人久久久大香线蕉的| 天天综合天天综合色| 欧美男男青年gay1069videost| 日韩精品视频网| 日韩欧美在线影院| 国产成人福利片| 国产精品久久久久影院色老大| 99免费精品视频| 亚洲一区视频在线观看视频| 日韩一区二区三区在线| 成人自拍视频在线| 亚洲精品免费在线观看| 69久久99精品久久久久婷婷 | 国产午夜亚洲精品不卡| 成人爱爱电影网址| 三级精品在线观看| 国产欧美一区二区精品仙草咪| av动漫一区二区| 午夜国产精品影院在线观看| 久久久久久亚洲综合影院红桃| 91麻豆精品秘密| 久久国产福利国产秒拍| 亚洲美女屁股眼交| 欧美www视频| 色综合久久99| 精品一区二区三区影院在线午夜 | 婷婷六月综合亚洲| 久久久久国产精品麻豆ai换脸 | 日韩精品专区在线| 国产成人精品免费在线| 天天av天天翘天天综合网| 欧美韩国日本一区| 欧美一级日韩一级| 91天堂素人约啪| 国内精品在线播放| 性做久久久久久免费观看| 成人欧美一区二区三区| 欧美成人女星排行榜| 欧美综合欧美视频| 99久久精品国产麻豆演员表| 久久er精品视频| 亚洲成av人片在线| 亚洲三级在线看| 日本一区二区视频在线观看| 日韩精品中文字幕一区二区三区 | 欧美一级在线免费| 欧美影院精品一区| 色域天天综合网| 豆国产96在线|亚洲| 国产毛片一区二区| 激情久久久久久久久久久久久久久久 | 久久久久久久久蜜桃| 538在线一区二区精品国产| 色综合天天综合狠狠| 成人免费视频caoporn| 九色porny丨国产精品| 青青青伊人色综合久久| 日韩在线一区二区| 亚洲成人免费电影| 亚洲一区二区三区四区在线免费观看| 国产精品区一区二区三区| 国产欧美精品一区二区色综合 | 丁香婷婷综合激情五月色| 激情国产一区二区| 国产一区二区美女诱惑| 麻豆精品视频在线观看| 美国三级日本三级久久99 | 国产精品亚洲成人| 国产高清无密码一区二区三区| 精品伊人久久久久7777人| 乱中年女人伦av一区二区| 久久99精品久久久久久久久久久久| 日韩主播视频在线| 久久福利视频一区二区| 国产一区二区三区| 成人黄色av电影| 91国偷自产一区二区使用方法| 色综合久久久久综合体桃花网| 色综合久久综合中文综合网| 欧美三级三级三级爽爽爽| 91精品婷婷国产综合久久性色| 日韩一区二区免费在线电影| 精品国产99国产精品| 久久久久国产精品人| 国产精品久久久久久亚洲毛片 | 亚洲一级电影视频| 亚洲一级不卡视频| 久久91精品久久久久久秒播| 国产一区二区免费视频| 91蜜桃传媒精品久久久一区二区| 在线看国产一区二区| 欧美一区二区二区| 国产精品视频一二三| 亚洲一区二区三区四区在线| 蜜桃精品视频在线| a级高清视频欧美日韩| 欧美挠脚心视频网站| 国产亚洲美州欧州综合国| 中文字幕视频一区| 免费高清在线一区| www.欧美精品一二区| 91精品国产欧美一区二区成人| 中文字幕免费观看一区| 夜夜精品浪潮av一区二区三区| 蓝色福利精品导航| 91色视频在线| 2019国产精品| 五月婷婷久久丁香| 99久久国产综合精品麻豆| 日韩一区二区免费在线电影| 亚洲麻豆国产自偷在线| 精品一区二区综合| 欧美另类z0zxhd电影| 国产精品你懂的在线欣赏|