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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? primecellsio.c

?? vxwork arm920 bsp開(kāi)發(fā)包
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* primeCellSio.c - ARM AMBA UART tty driver *//* Copyright 1997-2000 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01c,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 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..SH DATA STRUCTURESAn AMBA_CHAN data structure is used to describe each channel, thisstructure is described in h/drv/sio/ambaSio.h..SH 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. .SH MODESThis driver supports both polled and interrupt modes..SH 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.     @/    }.CE.SH BSPBy 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)..SH INCLUDE FILES:drv/sio/ambaSio.h sioLib.h.SH SEE ALSO:.I "Advanced RISC Machines AMBA UART (AP13) Data Sheet,".I "Digital Semiconductor 21285 Core Logic for SA-110 Microprocessor DataSheet,".I "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);LOCAL int ambaTxStartup (SIO_CHAN * pSioChan);LOCAL int ambaCallbackInstall (SIO_CHAN * pSioChan, int callbackType,			       STATUS (*callback)(), void * callbackArg);LOCAL int ambaPollInput (SIO_CHAN * pSioChan, char *);LOCAL int ambaPollOutput (SIO_CHAN * pSioChan, char);/* driver functions */LOCAL SIO_DRV_FUNCS ambaSioDrvFuncs =    {    (int (*)())ambaIoctl,    ambaTxStartup,    ambaCallbackInstall,    ambaPollInput,    ambaPollOutput    };/********************************************************************************* ambaDummyCallback - dummy callback routine.** RETURNS: ERROR, always.*/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*/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*/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, 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.	     */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区四区五区中文| 国内精品伊人久久久久av一坑| 亚洲va欧美va国产va天堂影院| 亚洲一本大道在线| 久久69国产一区二区蜜臀| 高清不卡一区二区在线| 成人黄色在线网站| 777午夜精品免费视频| 亚洲国产成人在线| 日韩中文字幕麻豆| 99v久久综合狠狠综合久久| 欧美一二三区精品| 亚洲色图视频免费播放| 另类小说视频一区二区| 一本久久综合亚洲鲁鲁五月天| 日韩欧美卡一卡二| 亚洲欧美色综合| 国产剧情av麻豆香蕉精品| 欧美亚一区二区| 2024国产精品| 国产欧美久久久精品影院| 日韩福利电影在线| 成人免费高清在线观看| 91精品国产手机| 中文字幕在线视频一区| 久久成人久久爱| 欧美在线一二三四区| 国产欧美日韩综合精品一区二区 | 日韩av成人高清| 99久久精品免费精品国产| 精品国产一区二区三区久久久蜜月| 亚洲精品福利视频网站| 懂色av中文一区二区三区| 日韩视频国产视频| 亚洲国产成人av| 91天堂素人约啪| 国产午夜精品一区二区三区嫩草| 免费在线观看一区二区三区| 在线免费av一区| 久久久天堂av| 亚洲综合视频在线观看| 国产精品一区二区无线| 日韩一级在线观看| 天天射综合影视| 欧美在线观看你懂的| 亚洲品质自拍视频| 粉嫩高潮美女一区二区三区| 精品国产一区二区在线观看| 全部av―极品视觉盛宴亚洲| 欧美精选在线播放| 《视频一区视频二区| 成人a区在线观看| 久久久国际精品| 蜜臀av性久久久久av蜜臀妖精| 欧美精品1区2区3区| 亚洲摸摸操操av| 日本久久电影网| 亚洲欧美日韩在线播放| 99精品国产视频| 26uuu亚洲| 国产伦精品一区二区三区免费迷| 欧美丰满少妇xxxxx高潮对白| 亚洲国产va精品久久久不卡综合 | 亚洲精品欧美二区三区中文字幕| 成人免费va视频| 国产精品超碰97尤物18| www.亚洲人| 亚洲精品国产一区二区精华液 | 99热99精品| 国产精品久线观看视频| av成人动漫在线观看| 国产精品久久久久国产精品日日| 懂色av噜噜一区二区三区av| 国产精品久久久久影视| 91免费看视频| 亚洲在线视频一区| 欧美日韩日本视频| 强制捆绑调教一区二区| 精品黑人一区二区三区久久| 蜜臀av性久久久久蜜臀av麻豆| 欧美大片一区二区| 国产麻豆日韩欧美久久| 国产精品麻豆欧美日韩ww| 91色在线porny| 中文字幕在线免费不卡| 在线观看国产精品网站| 亚洲成人精品在线观看| 日韩精品一区二区在线观看| 国产精品亚洲一区二区三区妖精| 国产精品视频你懂的| 91豆麻精品91久久久久久| 婷婷综合久久一区二区三区| 538在线一区二区精品国产| 久久精品国产网站| 日本一区二区三区dvd视频在线| 91在线你懂得| 午夜精品福利久久久| 欧美不卡一区二区三区四区| 国产成人av自拍| 亚洲裸体xxx| 欧美一级国产精品| 国产精品99久久久久久似苏梦涵| 国产精品灌醉下药二区| 欧美日韩高清一区二区不卡| 国产在线精品一区二区夜色| 中文字幕一区二区在线观看| 欧美调教femdomvk| 国产精品久久三区| 69堂国产成人免费视频| 国产91丝袜在线18| 亚洲成av人片一区二区三区| www激情久久| 欧洲人成人精品| 国内精品免费**视频| 专区另类欧美日韩| 欧美成人欧美edvon| 99国产精品久| 麻豆视频一区二区| 中文字幕亚洲视频| 欧美xxxx老人做受| 在线免费观看日本欧美| 国产一区二区三区美女| 亚洲高清一区二区三区| 欧美本精品男人aⅴ天堂| 成人一区二区视频| 亚洲一区二区三区在线| 久久精品在线免费观看| 欧美日韩国产乱码电影| 成人精品免费看| 日韩福利视频导航| 亚洲女子a中天字幕| 久久久美女艺术照精彩视频福利播放| 91成人免费电影| 国产成人综合视频| 日韩综合小视频| 亚洲丝袜精品丝袜在线| 精品久久一区二区三区| 欧美日韩一区二区三区高清| 成人a免费在线看| 精品一区二区在线看| 亚洲美女一区二区三区| 精品国产一区二区三区av性色 | 国产精品国产三级国产aⅴ入口| 欧美日韩精品一区二区天天拍小说| 国产成人啪午夜精品网站男同| 夜夜嗨av一区二区三区中文字幕| 国产三级精品在线| 欧美mv和日韩mv国产网站| 欧美丝袜丝交足nylons图片| 91蜜桃免费观看视频| 成人动漫在线一区| 国产精品一区不卡| 久久er99精品| 日韩av中文字幕一区二区三区 | 成人av在线资源网站| 久久福利视频一区二区| 图片区小说区区亚洲影院| 夜夜爽夜夜爽精品视频| 国产偷国产偷亚洲高清人白洁| 7777精品伊人久久久大香线蕉超级流畅 | 麻豆成人免费电影| 亚洲一区二区在线免费看| 亚洲色图在线看| 国产精品成人在线观看| 国产日韩欧美综合一区| 久久女同精品一区二区| 欧美大片日本大片免费观看| 欧美理论片在线| 欧美日韩国产首页| 欧美三级电影在线观看| 色哟哟亚洲精品| 在线观看日产精品| 欧美亚洲一区三区| 欧美偷拍一区二区| 精品视频在线免费看| 欧美日韩在线播放| 欧美影院一区二区| 欧美久久久久久久久| 日韩精品一区二区三区四区视频| 精品剧情在线观看| 中文在线资源观看网站视频免费不卡 | 狠狠网亚洲精品| 国产91色综合久久免费分享| caoporn国产精品| 91黄色免费看| 欧美一区二区三区人| 精品日韩一区二区三区免费视频| 久久久精品国产免大香伊 | 欧美日韩一区高清| 日韩精品中文字幕一区| 国产无一区二区| 亚洲精品视频在线| 日本欧美一区二区三区乱码| 极品尤物av久久免费看| 成人性生交大片免费看在线播放| 91美女在线观看| 777a∨成人精品桃花网| 久久久久国产免费免费| 亚洲精品综合在线| 麻豆成人久久精品二区三区小说|