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

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

?? primecellsio.c

?? vxworks for Sam2410 bsp NoNet
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* 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.	     */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线国产亚洲欧美| jlzzjlzz亚洲女人18| 国产精品久久网站| 欧美国产激情二区三区| 国产调教视频一区| 中文一区二区在线观看| 欧美国产成人精品| 日韩美女精品在线| 亚洲乱码国产乱码精品精可以看| 中文字幕在线观看不卡视频| 亚洲色图视频免费播放| 一区av在线播放| 婷婷久久综合九色国产成人 | 日韩中文字幕区一区有砖一区| 亚洲女性喷水在线观看一区| 亚洲欧美另类久久久精品| 亚洲激情六月丁香| 成人亚洲一区二区一| 丁香桃色午夜亚洲一区二区三区| 成人av在线电影| 国产日韩精品久久久| 日韩三级伦理片妻子的秘密按摩| 精品日韩99亚洲| 久久蜜臀精品av| 国产精品成人免费| 亚洲成av人片一区二区| 久久精品国产久精国产爱| 国产成人亚洲综合a∨婷婷| 色综合夜色一区| 日韩欧美一级在线播放| 国产精品污污网站在线观看| 尤物视频一区二区| 韩国一区二区视频| 91免费在线看| 精品精品国产高清一毛片一天堂| 国产精品欧美久久久久一区二区| 亚洲一区二区精品久久av| 狠狠色丁香久久婷婷综合_中| 国产91富婆露脸刺激对白| 欧美日韩午夜影院| 久久精品亚洲国产奇米99| 一区二区三区欧美| 国产精品99久久久久久有的能看| 日本高清不卡aⅴ免费网站| 日韩欧美一级二级三级| 亚洲男人天堂一区| 国产一区二区三区日韩| 欧美日韩你懂的| 国产精品视频第一区| 日韩1区2区3区| 色猫猫国产区一区二在线视频| 日韩一二三区视频| 亚洲一区二区三区四区的| 国产传媒久久文化传媒| 欧美男女性生活在线直播观看| 国产精品看片你懂得| 久久精品国产第一区二区三区| 色综合久久久久| 精品国产凹凸成av人网站| 亚洲成人激情综合网| 91麻豆精东视频| 中文字幕免费在线观看视频一区| 精品综合免费视频观看| 日韩欧美自拍偷拍| 舔着乳尖日韩一区| 欧美人妖巨大在线| 亚洲自拍都市欧美小说| 91精彩视频在线| 亚洲欧美日韩系列| 成人一区二区在线观看| 国产女同互慰高潮91漫画| 国产伦精品一区二区三区视频青涩| 69久久夜色精品国产69蝌蚪网| 亚洲视频 欧洲视频| 99国产欧美另类久久久精品| 国产女主播一区| 成人毛片在线观看| 亚洲欧洲www| 色综合中文字幕| 亚洲一区二区三区四区在线| 欧美亚洲综合色| 午夜欧美电影在线观看| 欧美一卡2卡三卡4卡5免费| 日韩电影在线观看电影| 日韩一区二区三区在线观看| 蜜臀av性久久久久av蜜臀妖精 | 欧美成人性战久久| 精品亚洲成av人在线观看| 久久在线观看免费| 成人黄色免费短视频| 中文字幕视频一区二区三区久| av网站免费线看精品| 亚洲国产精品一区二区www在线| 欧美日韩在线观看一区二区| 日韩av电影一区| 久久天天做天天爱综合色| 成人午夜电影网站| 亚洲一区二区在线视频| 欧美一区二区三区视频| 国产精品一区二区x88av| 中文字幕一区免费在线观看| 99re视频精品| 日韩二区三区在线观看| 中文在线资源观看网站视频免费不卡 | 国产成人三级在线观看| 一区在线观看视频| 精品视频在线免费看| 美女久久久精品| 亚洲人一二三区| 制服丝袜亚洲播放| 99在线精品观看| 一卡二卡欧美日韩| 欧美高清精品3d| 国产高清久久久| 性做久久久久久久免费看| 欧美精品一区二区三区高清aⅴ| 99久久婷婷国产综合精品| 亚洲六月丁香色婷婷综合久久| 欧美不卡激情三级在线观看| 一本一道综合狠狠老| 国产一区二区三区四区五区入口| 一区二区三区精品视频| 久久久噜噜噜久久人人看| 欧美羞羞免费网站| 成人听书哪个软件好| 日本va欧美va欧美va精品| 亚洲特级片在线| 国产日韩影视精品| 日韩精品中文字幕在线一区| 色综合天天综合网天天狠天天| 国产麻豆精品久久一二三| 性做久久久久久免费观看欧美| 国产精品初高中害羞小美女文| 欧美电影免费观看高清完整版在| 91成人看片片| a4yy欧美一区二区三区| 国产综合久久久久影院| 青青草国产成人99久久| 亚洲电影在线免费观看| 日韩伦理免费电影| 国产精品毛片久久久久久久| 欧美精品一区二区高清在线观看 | 在线视频中文字幕一区二区| 国产成人aaa| 国产综合一区二区| 久久成人免费网| 秋霞电影网一区二区| 午夜电影一区二区三区| 亚洲国产精品综合小说图片区| 亚洲精品免费一二三区| 亚洲欧美经典视频| 亚洲精品综合在线| 亚洲欧美激情在线| 亚洲乱码国产乱码精品精小说| 亚洲色图欧美偷拍| 亚洲婷婷综合色高清在线| 亚洲欧美一区二区三区久本道91| 国产精品国产三级国产aⅴ中文| 国产精品视频在线看| 中文字幕一区二区在线观看| 亚洲欧洲www| 亚洲一区二区高清| 首页亚洲欧美制服丝腿| 蜜臀精品一区二区三区在线观看| 免费观看成人av| 国产原创一区二区| 岛国精品在线播放| 色综合色综合色综合| 欧美性大战久久| 日韩视频一区二区三区在线播放| 欧美电影免费观看高清完整版| 久久久综合精品| 国产精品久久久久天堂| 亚洲综合精品久久| 日本午夜一区二区| 国产精品资源在线| 一本一道综合狠狠老| 91精品国产综合久久福利软件| 欧美一区二区私人影院日本| 国产日韩精品一区二区三区| 亚洲精品高清在线| 日韩精品一二三四| 国产成人av资源| 欧美日韩亚洲高清一区二区| 精品美女在线播放| 亚洲另类在线一区| 久久99精品国产.久久久久| 不卡电影一区二区三区| 欧美日产在线观看| 中文字幕精品一区二区三区精品| 亚洲在线免费播放| 国产精品自产自拍| 色一区在线观看| 日韩视频免费直播| 最近中文字幕一区二区三区| 日韩成人av影视| 99re热这里只有精品免费视频| 日韩午夜电影在线观看| 亚洲精品乱码久久久久久日本蜜臀| 麻豆精品一区二区综合av|