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

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

?? s3c2410xsio.c

?? s3c2410的vxworksBSP
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* s3c2410xSio.c - Samsung s3c2410x UART tty driver */

/* Copyright 2004 HITSAT, Inc. */

#include "copyright_wrs.h"

/*
DESCRIPTION
This is the device driver for the Advanced RISC Machines (ARM) s3c2410x
UART. This is a generic design of UART used within a number of chips
containing (or for use with) ARM CPUs such as in the Digital Semiconductor
21285 chip as used in the EBSA-285 BSP.

This design contains a universal asynchronous receiver/transmitter, a
baud-rate generator, and an InfraRed Data Association (IrDa) Serial
InfraRed (SiR) protocol encoder. The Sir encoder is not supported by
this driver. The UART contains two 16-entry deep FIFOs for receive and
transmit: if a framing, overrun or parity error occurs during
reception, the appropriate error bits are stored in the receive FIFO
along with the received data. The FIFOs can be programmed to be one
byte deep only, like a conventional UART with double buffering, but the
only 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 not
support the modem control inputs: DCD, CTS and DSR.

The UART design can generate four interrupts: Rx, Tx, modem status
change and a UART disabled interrupt (which is asserted when a start
bit is detected on the receive line when the UART is disabled). The
implementation in the 21285 chip has only two interrupts: Rx and Tx,
but the Rx interrupt is a combination of the normal Rx interrupt status
and the UART disabled interrupt status.

Only asynchronous serial operation is supported by the UART which
supports 5 to 8 bit bit word lengths with or without parity and with
one or two stop bits. The only serial word format supported by the
driver is 8 data bits, 1 stop bit, no parity,  The default baud rate is
determined by the BSP by filling in the s3c2410x_CHAN structure before
calling s3c2410xDevInit().

The exact baud rates supported by this driver will depend on the
crystal fitted (and consequently the input clock to the baud-rate
generator), but in general, baud rates from about 300 to about 115200
are possible.

In theory, any number of UART channels could be implemented within a
chip. This driver has been designed to cope with an arbitrary number of
channels, but at the time of writing, has only ever been tested with
one channel.

.SH DATA STRUCTURES
An s3c2410x_CHAN data structure is used to describe each channel, this
structure is described in h/drv/sio/s3c2410xSio.h.

.SH CALLBACKS
Servicing a "transmitter ready" interrupt involves making a callback to
a higher level library in order to get a character to transmit.  By
default, 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_CALLBACK
ioctl command.  Likewise, a receiver interrupt handler makes a callback
to pass the character to the higher layer library.
 
.SH MODES
This driver supports both polled and interrupt modes.

.SH USAGE
The driver is typically only called by the BSP. The directly callable
routines in this modules are s3c2410xDevInit(), s3c2410xIntTx() and
s3c2410xIntRx().

The BSP's sysHwInit() routine typically calls sysSerialHwInit(), which
initialises the hardware-specific fields in the s3c2410x_CHAN structure
(e.g. register I/O addresses etc) before calling s3c2410xDevInit() which
resets the device and installs the driver function pointers.  After
this the UART will be enabled and ready to generate interrupts, but
those 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]);
	}
    }
.CE

The BSP's sysHwInit2() routine typically calls sysSerialHwInit2(),
which connects the chips interrupts via intConnect() (the two
interrupts `s3c2410xIntTx' and `s3c2410xIntRx') and enables those interrupts,
as shown in the following example:

.CS

void 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 BSP
By convention all the BSP-specific serial initialisation is performed
in 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 first
two have been described above, the others work as follows:

sysSerialChanGet is called by usrRoot to get the serial channel
descriptor associated with a serial channel number. The routine takes a
single parameter which is a channel number ranging between zero and
NUM_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 the
serial devices to an inactive state (prevent them from generating any
interrupts).

.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 Data
Sheet,"
.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


#define rEXTINT0   (*(volatile unsigned *)0x56000088) 
#define rEXTINT1   (*(volatile unsigned *)0x5600008c)
#define rEXTINT2   (*(volatile unsigned *)0x56000090) 


#define rGPGCON    (*(volatile unsigned *)0x56000060) 
#define rGPGDAT    (*(volatile unsigned *)0x56000064) 
#define rGPGUP     (*(volatile unsigned *)0x56000068) 
                        
#define rSRCPND     (*(volatile unsigned *)0x4a000000) 
#define rINTMOD     (*(volatile unsigned *)0x4a000004) 
#define rINTMSK     (*(volatile unsigned *)0x4a000008) 
#define rPRIORITY   (*(volatile unsigned *)0x4a00000c)
#define rINTPND     (*(volatile unsigned *)0x4a000010) 
#define rINTOFFSET  (*(volatile unsigned *)0x4a000014) 
#define rSUBSRCPND  (*(volatile unsigned *)0x4a000018) 
#define rINTSUBMSK  (*(volatile unsigned *)0x4a00001c) 

#define rEINTMASK  (*(volatile unsigned *)0x560000a4) 
#define rEINTPEND  (*(volatile unsigned *)0x560000a8) 




#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);




      rGPGCON = 0x00000000;	
      rEXTINT1 = 0x11111140; 
      rEINTMASK=(rEINTMASK&(~( 1<<9) ));
      rGPGCON = 0x0000000a; 
 
     

	/* 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;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级中文字幕| 成人性色生活片| 欧美精品v日韩精品v韩国精品v| 成人免费在线观看入口| av一二三不卡影片| 亚洲精品欧美综合四区| 91成人免费网站| 婷婷成人综合网| 精品剧情在线观看| 国产成人精品www牛牛影视| 一区在线观看免费| 欧美性感一类影片在线播放| 亚洲成人av电影在线| 日韩亚洲欧美综合| 国产精品88888| **网站欧美大片在线观看| 日本高清不卡在线观看| 性欧美大战久久久久久久久| 欧美一级高清片在线观看| 国产一区二区三区美女| 中文字幕一区二| 欧美性生活一区| 极品少妇一区二区三区精品视频 | 国产精品久久夜| 色av综合在线| 精品一区二区影视| 中文字幕日本不卡| 91麻豆精品国产91久久久 | 欧美一区三区二区| 国产精品一卡二卡在线观看| 一区二区三区国产精华| 欧美白人最猛性xxxxx69交| 成人av免费在线| 日韩激情一二三区| 成人欧美一区二区三区| 日韩欧美电影一二三| 97久久久精品综合88久久| 日韩高清一区在线| 亚洲欧美偷拍另类a∨色屁股| 91精品国产91久久综合桃花| av中文字幕不卡| 国内精品在线播放| 亚洲综合视频在线观看| 国产午夜亚洲精品午夜鲁丝片| aaa欧美日韩| 精品一区二区三区久久| 亚洲成人免费在线观看| 国产精品美女视频| 精品免费国产一区二区三区四区| 色天使色偷偷av一区二区| 国产一区二区在线观看视频| 五月综合激情婷婷六月色窝| 亚洲同性同志一二三专区| 久久久久一区二区三区四区| 欧美日本一区二区在线观看| caoporn国产精品| 日本亚洲天堂网| 亚洲另类中文字| 国产精品午夜久久| 久久免费看少妇高潮| 欧美一区二区福利在线| 欧美三级午夜理伦三级中视频| 国产成人在线看| 国产一区二区精品在线观看| 日本不卡不码高清免费观看| 亚洲动漫第一页| 亚洲日本丝袜连裤袜办公室| 国产精品久久久久久亚洲伦 | 中国av一区二区三区| 日韩欧美成人激情| 日韩一区二区三免费高清| 欧美狂野另类xxxxoooo| 欧美性欧美巨大黑白大战| 久久综合九色综合97_久久久| 欧美老女人第四色| 7777精品伊人久久久大香线蕉的 | 欧美网站大全在线观看| 91免费版在线| 色婷婷精品大视频在线蜜桃视频| 成人永久aaa| 成人av网址在线| 99免费精品在线| 91麻豆国产自产在线观看| 91香蕉视频污| 一本色道a无线码一区v| 97久久精品人人澡人人爽| 99热99精品| 欧美视频一区二| 欧美巨大另类极品videosbest| 欧美日韩国产片| 欧美一区二区三区在线观看视频| 欧美一区二区三区视频免费| 日韩欧美在线1卡| 欧美不卡一二三| 亚洲精品一区二区三区香蕉| 国产亚洲精品aa| 国产精品国产三级国产| 亚洲精选在线视频| 天天综合网天天综合色| 麻豆成人91精品二区三区| 国内精品久久久久影院色| 成人免费毛片片v| 色猫猫国产区一区二在线视频| 欧美精品丝袜中出| 精品99一区二区| 国产女主播一区| 亚洲久草在线视频| 麻豆国产91在线播放| 成人精品视频.| 精品视频在线免费看| 日韩女优av电影在线观看| 国产精品国产自产拍高清av王其| 亚洲主播在线观看| 激情综合网激情| 一本一道久久a久久精品 | 日韩美一区二区三区| 国产精品免费久久| 视频在线观看一区| 从欧美一区二区三区| 欧美日韩三级在线| 国产肉丝袜一区二区| 亚洲综合av网| 紧缚捆绑精品一区二区| 日本韩国欧美国产| 欧美精品一区二区高清在线观看 | 国产精品伊人色| 欧美伊人久久久久久午夜久久久久| 精品国产第一区二区三区观看体验 | 狠狠色丁香婷婷综合| 91在线视频播放| 精品久久99ma| 亚洲午夜视频在线观看| 国产suv一区二区三区88区| 欧美日韩精品专区| 《视频一区视频二区| 韩国av一区二区三区在线观看| 91麻豆产精品久久久久久| 日韩欧美国产一区二区三区| 亚洲另类色综合网站| 国产二区国产一区在线观看| 在线不卡的av| 亚洲精品国产精品乱码不99| 国产一区二区在线观看免费| 91精品国产高清一区二区三区蜜臀| 中文字幕一区二区三区乱码在线| 麻豆国产欧美一区二区三区| 欧美亚洲动漫制服丝袜| 国产精品国产a| 美洲天堂一区二卡三卡四卡视频| 色琪琪一区二区三区亚洲区| 中文字幕第一区二区| 国内成人精品2018免费看| 欧美一区二区三区四区五区| 一区二区三区在线免费视频| 成人不卡免费av| 日本一区二区三区电影| 韩国理伦片一区二区三区在线播放| 欧美日韩午夜在线| 一区二区三区成人| 99re66热这里只有精品3直播| 亚洲国产成人在线| 东方aⅴ免费观看久久av| 久久午夜色播影院免费高清| 久久99最新地址| 日韩一区二区三区精品视频| 蜜芽一区二区三区| 日韩一级片在线播放| 日本欧美一区二区三区乱码 | 日本不卡一区二区三区高清视频| 欧美天天综合网| 亚洲精品国产成人久久av盗摄 | 国内成人精品2018免费看| 日韩午夜激情免费电影| 日本中文字幕一区二区视频 | 国产一区二区三区免费在线观看| 精品久久久久久久久久久久久久久 | 日韩欧美高清在线| 麻豆成人久久精品二区三区小说| 日韩视频在线观看一区二区| 美女www一区二区| 日韩精品资源二区在线| 麻豆高清免费国产一区| 2023国产精品自拍| 成人免费看视频| 成人亚洲一区二区一| 国产精品乱码一区二区三区软件| av男人天堂一区| 亚洲综合一二三区| 337p亚洲精品色噜噜| 麻豆久久久久久| 久久久午夜精品| eeuss鲁一区二区三区| 亚洲摸摸操操av| 欧美三级电影在线观看| 奇米精品一区二区三区四区| 久久青草国产手机看片福利盒子| av在线播放一区二区三区| 午夜亚洲福利老司机| 欧美videos大乳护士334| 成人综合婷婷国产精品久久蜜臀 |