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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? primecellsio.c

?? vxwork arm920 bsp開發(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.	     */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲影院在线观看| 欧美视频一二三区| 2021国产精品久久精品| 美女任你摸久久| 欧美成人三级电影在线| 麻豆精品在线观看| 国产午夜精品一区二区三区视频| 韩国精品主播一区二区在线观看| 2023国产精品| 99免费精品在线| 亚洲综合久久av| 69成人精品免费视频| 久久机这里只有精品| 精品久久国产字幕高潮| 国产成人av电影在线| 亚洲同性同志一二三专区| 欧美在线观看你懂的| 水野朝阳av一区二区三区| 欧美va亚洲va在线观看蝴蝶网| 激情久久五月天| 亚洲欧洲性图库| 欧美三片在线视频观看| 精品一区二区三区免费观看| 欧美国产日产图区| 欧美亚洲综合色| 精品一二三四区| 亚洲视频一二三区| 91精品国产91综合久久蜜臀| 国产不卡在线视频| 亚洲第一激情av| 精品久久人人做人人爽| 99在线精品观看| 日本少妇一区二区| **欧美大码日韩| 欧美一区二区福利视频| 成人午夜av电影| 日本成人在线看| 中文字幕亚洲区| 日韩欧美高清dvd碟片| 99久久综合狠狠综合久久| 蜜臀久久久99精品久久久久久| 国产精品大尺度| 精品国产乱码久久久久久免费| 一本大道久久精品懂色aⅴ| 免费观看成人鲁鲁鲁鲁鲁视频| 中文字幕日韩av资源站| 日韩免费在线观看| 欧美午夜一区二区三区| 粉嫩aⅴ一区二区三区四区| 天堂一区二区在线免费观看| 精品国产一区a| 欧美日韩在线三区| av色综合久久天堂av综合| 激情五月婷婷综合| 视频一区中文字幕| 亚洲精品免费播放| 亚洲国产成人在线| 精品国产一区二区三区久久影院| 欧美日韩在线观看一区二区 | 丝袜美腿亚洲一区| 亚洲少妇屁股交4| 欧美韩日一区二区三区| 日韩欧美自拍偷拍| 欧美精品免费视频| 欧美色大人视频| 色婷婷狠狠综合| 成人久久18免费网站麻豆| 国产主播一区二区| 久久99精品国产.久久久久| 视频一区在线视频| 日本中文一区二区三区| 国产精品电影院| 中文字幕一区三区| 国产精品久久久久aaaa| 国产日韩欧美在线一区| www久久精品| 精品盗摄一区二区三区| 日韩午夜av电影| 欧美一区二区啪啪| 日韩欧美一级二级三级| 欧美日韩国产高清一区| 欧美精三区欧美精三区| 欧美久久久久免费| 日韩欧美一区二区不卡| 日韩三级电影网址| 精品三级在线观看| 久久久亚洲综合| 中文字幕精品综合| 亚洲视频 欧洲视频| 一区二区三区在线观看欧美| 亚洲自拍偷拍麻豆| 亚洲va韩国va欧美va精品| 日韩国产精品久久久久久亚洲| 日韩成人午夜电影| 国产在线不卡一区| 国产在线精品一区在线观看麻豆| 国产在线精品视频| av爱爱亚洲一区| 欧美日韩一区二区在线观看| 欧美乱妇一区二区三区不卡视频| 这里只有精品电影| 久久久五月婷婷| 国产精品不卡在线| 午夜av电影一区| 国产一区二区在线看| 不卡一区在线观看| 欧美人伦禁忌dvd放荡欲情| 欧美一区二区三区性视频| 久久夜色精品一区| 1000精品久久久久久久久| 亚洲国产欧美在线| 久久精品国产亚洲aⅴ| 激情五月婷婷综合| 99久久久精品| 欧美综合在线视频| 日韩女优av电影| 国产精品色一区二区三区| 成人在线视频一区| 久久综合中文字幕| 国产欧美日产一区| 亚洲福利视频三区| 亚洲精品久久嫩草网站秘色| 亚洲va韩国va欧美va精品| 国产亚洲精品7777| 午夜精品免费在线观看| 国产一区美女在线| av一区二区久久| 日韩精品中午字幕| 欧美视频中文一区二区三区在线观看| 天天av天天翘天天综合网色鬼国产| 一区二区三区免费| 久久成人av少妇免费| 高清在线成人网| 91精品国产欧美日韩| 国产欧美一区二区三区在线看蜜臀 | 亚洲国产精品精华液网站| 亚洲午夜激情av| 成人夜色视频网站在线观看| 91精品视频网| 国产精品久久久久一区二区三区 | 狠狠色狠狠色综合| 色综合久久天天综合网| 日韩一级黄色大片| 亚洲天堂2014| 久久精品国产亚洲aⅴ| 91蜜桃婷婷狠狠久久综合9色| 在线观看91视频| 成人欧美一区二区三区视频网页 | 精品国产91乱码一区二区三区| 一区二区高清视频在线观看| 韩国女主播一区| 欧美一激情一区二区三区| 日韩美一区二区三区| 国产精品久久久久影院色老大| 亚洲成人一二三| 色综合一区二区三区| 国产午夜精品理论片a级大结局| 五月综合激情日本mⅴ| 欧美午夜精品久久久久久超碰| 国产日韩欧美一区二区三区综合| 久草在线在线精品观看| 欧美午夜精品久久久久久孕妇 | 日韩欧美一区在线| 日日嗨av一区二区三区四区| 99久久亚洲一区二区三区青草| 国产精品久久久一区麻豆最新章节| 美女国产一区二区三区| 欧美电影一区二区三区| 一区二区三区中文字幕| 色综合婷婷久久| 国产色91在线| 黄色日韩网站视频| 久久久久久久久久久久久夜| 日韩电影免费在线| 精品国免费一区二区三区| 强制捆绑调教一区二区| 精品国产免费一区二区三区香蕉| 亚洲黄色片在线观看| 欧美无人高清视频在线观看| 亚洲国产精品一区二区久久 | 欧美四级电影网| 亚洲男帅同性gay1069| 91精品1区2区| 亚洲精品国产一区二区精华液| 欧美无砖专区一中文字| 亚洲国产精品视频| 日韩精品一区二区三区中文精品| 久久99精品久久久久久久久久久久 | 日韩视频一区二区在线观看| 亚洲综合激情小说| 在线观看三级视频欧美| 日韩电影在线一区二区三区| 欧美成人女星排名| 国产最新精品精品你懂的| 国产精品不卡视频| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲一区在线观看免费 | 精品一区二区在线看| 久久婷婷成人综合色| 91在线丨porny丨国产|