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

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

?? s3c2410xsio.c

?? 附件是一份S3C2410的原廠BSP源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* s3c2410xSio.c - Samsung s3c2410x UART tty driver *//* Copyright 2004 HITSAT, Inc. */#include "copyright_wrs.h"/*DESCRIPTIONThis is the device driver for the Advanced RISC Machines (ARM) s3c2410xUART. 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 s3c2410x_CHAN structure beforecalling s3c2410xDevInit().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 s3c2410x_CHAN data structure is used to describe each channel, thisstructure is described in h/drv/sio/s3c2410xSio.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 s3c2410xDevInit(), s3c2410xIntTx() ands3c2410xIntRx().The BSP's sysHwInit() routine typically calls sysSerialHwInit(), whichinitialises the hardware-specific fields in the s3c2410x_CHAN structure(e.g. register I/O addresses etc) before calling s3c2410xDevInit() 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 "s3c2410xSio.h"LOCAL s3c2410x_CHAN s3c2410xChan[N_s3c2410x_UART_CHANS];void sysSerialHwInit (void)    {    int i;    for (i = 0; i < N_s3c2410x_UART_CHANS; i++)	{	s3c2410xChan[i].regs = devParas[i].baseAdrs;	s3c2410xChan[i].baudRate = CONSOLE_BAUD_RATE;	s3c2410xChan[i].xtal = UART_XTAL_FREQ; 	s3c2410xChan[i].levelRx = devParas[i].intLevelRx;	s3c2410xChan[i].levelTx = devParas[i].intLevelTx;	/@	 * Initialise driver functions, getTxChar, putRcvChar and	 * channelMode, then initialise UART	 @/	s3c2410xDevInit(&s3c2410xChan[i]);	}    }.CEThe BSP's sysHwInit2() routine typically calls sysSerialHwInit2(),which connects the chips interrupts via intConnect() (the twointerrupts `s3c2410xIntTx' and `s3c2410xIntRx') 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),		       s3c2410xIntRx, (int) &s3c2410xChan[0]);    intEnable (devParas[0].intLevelRx);    /@ connect Tx interrupt @/    (void) intConnect (INUM_TO_IVEC(devParas[0].vectorTx),		       s3c2410xIntTx, (int) &s3c2410xChan[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 s3c2410x_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/s3c2410xSio.h sioLib.h.SH SEE ALSO:.I "Advanced RISC Machines s3c2410x 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 "s3c2410xSio.h"/* local defines  */#define s3c2410x_BAUD_MIN         18#define s3c2410x_BAUD_MAX         1152000#define s3c2410x_SIO_DEFAULT_BAUD 1152000#ifndef s3c2410x_UART_REG#define s3c2410x_UART_REG(pChan, reg) \	(*(volatile UINT32 *)((UINT32)(pChan)->regs + (reg)))#endif#ifndef s3c2410x_UART_REG_READ#define s3c2410x_UART_REG_READ(pChan, reg, result) \	(result) = (s3c2410x_UART_REG(pChan, reg))#endif#ifndef s3c2410x_UART_REG_WRITE#define s3c2410x_UART_REG_WRITE(pChan, reg, data) \	(s3c2410x_UART_REG(pChan, reg)) = (data)#endif#ifndef s3c2410x_UART_REG_BIT_SET#define s3c2410x_UART_REG_BIT_SET(pChan, reg, data) \	(s3c2410x_UART_REG(pChan, reg)) |= (data)#endif#ifndef s3c2410x_UART_REG_BIT_CLR#define s3c2410x_UART_REG_BIT_CLR(pChan, reg, data) \	(s3c2410x_UART_REG(pChan, reg)) &= ~(data)#endif/* hardware access methods */#ifndef s3c2410x_INT_REG_READ#define s3c2410x_INT_REG_READ(reg,result) \	((result) = *(volatile UINT32 *)(reg))#endif#ifndef s3c2410x_INT_REG_WRITE#define s3c2410x_INT_REG_WRITE(reg,data) \	(*((volatile UINT32 *)(reg)) = (data))#endif/* locals *//* function prototypes */LOCAL STATUS s3c2410xIoctl (SIO_CHAN * pSioChan, int request, int arg);LOCAL int s3c2410xTxStartup (SIO_CHAN * pSioChan);LOCAL int s3c2410xCallbackInstall (SIO_CHAN * pSioChan, int callbackType,				STATUS (*callback)(), void * callbackArg);LOCAL int s3c2410xPollInput (SIO_CHAN * pSioChan, char *);LOCAL int s3c2410xPollOutput (SIO_CHAN * pSioChan, char);LOCAL STATUS s3c2410xDummyCallback (void);/* driver functions */LOCAL SIO_DRV_FUNCS s3c2410xSioDrvFuncs =	{		(int (*)())s3c2410xIoctl,		s3c2410xTxStartup,		(int (*)())s3c2410xCallbackInstall,		s3c2410xPollInput,		s3c2410xPollOutput	};/* * s3c2410xDummyCallback - dummy callback routine. * * RETURNS: ERROR, always. */LOCAL STATUS s3c2410xDummyCallback (void){	return ERROR;}/* * s3c2410xInitChannel - initialise UART * * This routine performs hardware initialisation of the UART channel. * * RETURNS: N/A */LOCAL void s3c2410xInitChannel	(		s3c2410x_CHAN *	pChan	/* ptr to s3c2410x_CHAN describing this channel */	){	UINT32	tempUINT32;	/* Set UCLK, polling&interrupt mode. */	s3c2410x_UART_REG_WRITE(pChan, OFFSET_UCON, CLK_PCLK+TxMode_IntPoll+RxMode_IntPoll);	/* enable subInterrupt for UART0. */	s3c2410x_INT_REG_READ(s3c2410x_INT_CSR_INTSUBMSK,tempUINT32);	switch((int)(pChan->regs))	{	case UART_1_BASE_ADR:		tempUINT32 &= ~((1<<SUBINT_LVL_RXD1)|(1<<SUBINT_LVL_TXD1));		break;	case UART_0_BASE_ADR:	default:		tempUINT32 &= ~((1<<SUBINT_LVL_RXD0)|(1<<SUBINT_LVL_TXD0));	}	s3c2410x_INT_REG_WRITE(s3c2410x_INT_CSR_INTSUBMSK,tempUINT32);	/* Set baud rate to 9600. */	s3c2410xIoctl((SIO_CHAN *)pChan, SIO_BAUD_SET, s3c2410x_SIO_DEFAULT_BAUD);	/* Set NonInfra-red mode, 8, N, 1. */	s3c2410xIoctl((SIO_CHAN *)pChan, SIO_HW_OPTS_SET, CLOCAL+CS8);	s3c2410xIoctl((SIO_CHAN *)pChan, SIO_MODE_SET, SIO_MODE_POLL);	/* Set disable FIFO */	s3c2410x_UART_REG_WRITE(pChan, OFFSET_UFCON, FIFO_OFF);	/* Enable pin for UART */	s3c2410x_IO_READ(rGPHCON, tempUINT32);	switch((int)(pChan->regs))	{	case UART_1_BASE_ADR:		tempUINT32 |= (MASK_GPH4(2)+MASK_GPH5(2)+MASK_GPH6(3)+MASK_GPH7(3)); /* +MASK_GPH8(2)); */		break;	case UART_0_BASE_ADR:	default:		tempUINT32 |= (MASK_GPH0(2)+MASK_GPH1(2)+MASK_GPH2(2)+MASK_GPH3(2)); /* +MASK_GPH8(2)); */	}	s3c2410x_IO_WRITE(rGPHCON,tempUINT32);		/* Clear Rx */	s3c2410x_UART_REG_READ(pChan, OFFSET_URXH, tempUINT32);}/* * s3c2410xSioDevInit - initialise an s3c2410x 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 * s3c2410x_CHAN structure. * * RETURNS: N/A */void s3c2410xSioDevInit	(		s3c2410x_CHAN *	pChan	/* ptr to s3c2410x_CHAN describing this channel */	){	int oldlevel = intLock();	/* initialise the driver function pointers in the SIO_CHAN */	pChan->sio.pDrvFuncs = &s3c2410xSioDrvFuncs;	/* set the non BSP-specific constants */	pChan->getTxChar = s3c2410xDummyCallback;	pChan->putRcvChar = s3c2410xDummyCallback;	pChan->channelMode = 0;    /* undefined */	/* initialise the chip */	s3c2410xInitChannel(pChan);	intUnlock(oldlevel);}/* * s3c2410xIoctl - 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 int s3c2410xIoctl	(		SIO_CHAN*	pSioChan,	/* device to control */    		int		request,	/* request code */    		int		arg	){	s3c2410x_CHAN *pChan = (s3c2410x_CHAN*) pSioChan;	int oldlevel;        /* current interrupt level mask */	UINT32 tempUINT32 = 0;	int lvl;    	switch (request)	{	case SIO_BAUD_SET:		if(arg < s3c2410x_BAUD_MIN || arg > s3c2410x_BAUD_MAX) return(EIO);				/* disable interrupts during chip access */		oldlevel = intLock ();		s3c2410x_UART_REG_WRITE(pChan,OFFSET_UDIV,(((s3c2410x_PCLK/16)/arg)-1));		intUnlock (oldlevel);		s3c2410x_UART_REG_READ(pChan,OFFSET_UDIV,tempUINT32);		pChan->baudRate=((s3c2410x_PCLK/16)/(tempUINT32+1));		break;	case SIO_BAUD_GET:		*(int *)arg = pChan->baudRate;		break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区在线播放| 欧美亚洲综合色| 婷婷综合久久一区二区三区| 亚洲精选视频在线| 一区二区三区四区在线播放| 亚洲视频资源在线| 一区二区三区资源| 国产一区二区三区av电影 | 一区二区免费在线| 国产麻豆精品久久一二三| 在线播放国产精品二区一二区四区| 成人性生交大合| 色8久久人人97超碰香蕉987| 欧美日韩国产在线播放网站| 日韩一区二区三区四区五区六区| 欧美成人一区二区| 国产精品久久久久久久久晋中| 亚洲制服丝袜在线| 精品一区二区日韩| 91在线国产福利| 色屁屁一区二区| 日韩一卡二卡三卡| 午夜精品福利一区二区三区av| 99精品视频在线观看| 国产日韩欧美麻豆| 无码av中文一区二区三区桃花岛| 不卡一区二区三区四区| 欧美一级专区免费大片| 国产精品毛片久久久久久| 调教+趴+乳夹+国产+精品| 91亚洲午夜精品久久久久久| 中文字幕欧美一| 91小视频免费看| 亚洲女人****多毛耸耸8| 日本成人在线电影网| 成人手机在线视频| 国产嫩草影院久久久久| 成人动漫在线一区| 日韩理论片网站| 色88888久久久久久影院野外| 亚洲免费观看在线视频| 色婷婷国产精品久久包臀| 一区二区三区精品久久久| 欧美在线一二三四区| 欧美经典一区二区| 午夜影视日本亚洲欧洲精品| 国产成a人无v码亚洲福利| 日韩免费福利电影在线观看| 亚洲国产视频直播| 91蝌蚪porny九色| 亚洲一区二区三区自拍| 91.麻豆视频| 韩国中文字幕2020精品| 日韩欧美中文一区| 国产一区二区三区观看| 中文字幕在线一区二区三区| 欧美优质美女网站| 久热成人在线视频| 在线成人av网站| 久久国产乱子精品免费女| 久久精品日韩一区二区三区| 六月丁香婷婷色狠狠久久| 久久天天做天天爱综合色| 狠狠色丁香婷婷综合| 中文字幕av资源一区| 欧美日韩一区在线观看| 一级精品视频在线观看宜春院| 欧美群妇大交群的观看方式| 国内外成人在线视频| 亚洲乱码日产精品bd| 精品欧美乱码久久久久久1区2区| 成人午夜av电影| 首页亚洲欧美制服丝腿| 欧美日韩电影一区| 成人性色生活片免费看爆迷你毛片| 亚洲影院在线观看| 国产调教视频一区| 91精品国产综合久久婷婷香蕉| 国产suv精品一区二区三区| 污片在线观看一区二区| 中文字幕一区二区三区四区| 欧美精品日韩一区| 99视频一区二区| 亚洲综合丝袜美腿| 国产婷婷精品av在线| 欧美夫妻性生活| 97久久超碰国产精品| 精品一区二区三区免费视频| 亚洲国产精品嫩草影院| 国产欧美日韩综合| 日韩一区二区三区av| 精品视频一区三区九区| 成人一区二区三区在线观看| 精品无码三级在线观看视频 | 日韩成人一级片| 亚洲精品一二三四区| 久久精品一二三| www激情久久| 欧美一区二区不卡视频| 欧美午夜理伦三级在线观看| 97久久久精品综合88久久| 成人免费视频免费观看| 国产宾馆实践打屁股91| 精品无人码麻豆乱码1区2区| 青椒成人免费视频| 国产精品无人区| 国产亚洲精品免费| 久久欧美一区二区| 91福利在线观看| bt7086福利一区国产| 国产高清成人在线| 亚洲电影在线免费观看| 亚洲一区二区视频在线观看| 亚洲另类中文字| 亚洲精品五月天| 亚洲精品国产精品乱码不99| 亚洲精品高清视频在线观看| 亚洲乱码中文字幕综合| 亚洲激情图片一区| 香蕉乱码成人久久天堂爱免费| 日韩精品乱码av一区二区| 日韩国产成人精品| 六月丁香综合在线视频| 黑人精品欧美一区二区蜜桃| 国产精品亚洲第一区在线暖暖韩国| 亚洲欧美日韩电影| 亚洲一区视频在线| 午夜影视日本亚洲欧洲精品| 蜜臀99久久精品久久久久久软件| 亚洲欧美日韩国产手机在线| 亚洲激情一二三区| 性做久久久久久久久| 另类成人小视频在线| 国产真实乱子伦精品视频| 成人av午夜电影| 色天天综合久久久久综合片| 欧美精品黑人性xxxx| 日韩网站在线看片你懂的| 久久久久久影视| 国产精品电影一区二区| 亚洲永久免费视频| 韩国一区二区三区| 91在线免费看| 777久久久精品| 国产清纯美女被跳蛋高潮一区二区久久w| 国产精品成人免费精品自在线观看 | 一区二区三区欧美亚洲| 亚洲成人中文在线| 激情国产一区二区| 色悠悠亚洲一区二区| 欧美一级欧美一级在线播放| 国产精品美女一区二区在线观看| 亚洲精品免费在线观看| 麻豆中文一区二区| 色诱视频网站一区| 久久亚洲私人国产精品va媚药| 综合婷婷亚洲小说| 麻豆91在线播放| 色视频一区二区| 国产日韩av一区二区| 日韩精品一二三区| 99re这里都是精品| 精品国产乱码久久久久久蜜臀| 日韩欧美电影在线| 日韩毛片在线免费观看| 国产综合色视频| 欧美私人免费视频| 中文av一区二区| 日韩电影一区二区三区四区| 99re热这里只有精品免费视频| 欧美xxxxx裸体时装秀| 亚洲另类在线一区| 成人av影院在线| 久久蜜桃av一区精品变态类天堂| 亚洲国产精品久久久久秋霞影院| 丁香亚洲综合激情啪啪综合| 欧美成人a视频| 亚洲成人第一页| 91久久奴性调教| 自拍偷拍亚洲欧美日韩| 国产伦精品一区二区三区免费迷| 欧美日本精品一区二区三区| 亚洲精品免费看| 99久久精品国产毛片| 日本一区二区三区高清不卡| 国内国产精品久久| 欧美一区永久视频免费观看| 亚洲综合男人的天堂| 91日韩在线专区| 亚洲欧美自拍偷拍色图| 丁香六月久久综合狠狠色| 精品日韩一区二区三区免费视频| 日韩av一区二区三区四区| 欧美日韩一区二区三区在线| 亚洲精品成a人| 欧美在线观看禁18| 亚洲国产成人高清精品| 欧美亚洲自拍偷拍| 五月综合激情网| 制服丝袜成人动漫|