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

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

?? sngks32csio-old.c

?? at91rm9200 bsp at91rm9200 bsp
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* sngks32cSio.c - Samsung KS32C serial driver *//* Copyright 1984-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01c,30nov01,m_h  Save pChan->baudRate when setting baud01b,26apr01,m_h  convert tabs to spaces for readability01a,12apr01,m_h  created from snds100 template.*//*DESCRIPTIONThis is the serial I/O driver for Samsung's KS32C50100 microprocessor which is anARM based processor with several integrated peripherals.  It has an interruptcontroller, two 32-bit timers, one Ethernet controller,two HDLC controllers,one IIC controller, general purpose I/O ports, and a 2 channel DMA controller.The 2 UART channels integrated with the processor are controlled by thisdriver.  Both the UARTs can work in interrupt mode as well as DMA mode.This driver supports only the interrupt mode for the UARTs.All the UART registers are accessible as 32-bit integers from the internalsystem registers.  The macros SNGKS32C_REG_READ and SNGKS32C_REG_WRITE read and write32-bit integers from and to the given addresses.  SNGKS32C_SIO_DEFAULT_BAUD isdefined to 38400 in this file.  This is the default baud rate with which the UART channels will be initialized.  The channels are also initialized with one start bit, one stop bit, 8 bit data and no parity bits.The driver is typically only called only by the BSP. The directly callableroutines in this module are sngks32cDevInit(), sngks32cDevInit2(), sngks32cIntRcv(), sngks32cIntTx(), and sngks32cIntErr().The BSP calls sngks32cDevInit() to initialize or reset the device.It connects the driver's interrupt handlers (sngks32cIntRcv(), sngks32cIntTx(),and sngks32cIntErr()), using intConnect().After connecting the interrupt handlers, the BSP calls sngks32cDevInit2()to inform the driver that interrupt mode operation is now possible.INCLUDES:sngks32cSio.h sioLib.hSEE ALSO:<Samsung KS32C50100 User's Manual>*/#include "vxWorks.h"#include "sioLib.h"#include "intLib.h"#include "errno.h"#include "sngks32cSio.h"#include "ioLib.h"void  myDelay();#define AT91C_BAUD_MIN         1200#define AT91C_BAUD_MAX         230400#define AT91C_SIO_DEFAULT_BAUD 38400/* Hardware abstraction macros *//* local defines  */#ifndef AT91C_SIO_REG_READ#define AT91C_SIO_REG_READ(pChan, reg, result) \    ((result) = (*(volatile UINT32 *)((UINT32)(pChan)->regs + (reg))))#endif    /*AT91C_SIO_REG_READ*/#ifndef AT91C_SIO_REG_WRITE#define AT91C_SIO_REG_WRITE(pChan, reg, data) \    ((*(volatile UINT32 *)((UINT32)(pChan)->regs + (reg))) = (data))#endif    /*AT91C_SIO_REG_WRITE*//* for backward compatibility */#ifndef    SIO_HUP#   define SIO_OPEN    0x100A    /* open channel, raise DTR, RTS */#   define SIO_HUP     0x100B    /* hang-up, lower DTR, RTS */#endif/* forward static declarations */LOCAL int    at91cTxStartup (SIO_CHAN * pSioChan);LOCAL int    at91cCallbackInstall (SIO_CHAN *pSioChan, int callbackType,                                      STATUS (*callback)(), void *callbackArg);LOCAL int    at91cPollOutput (SIO_CHAN *pSioChan, char    outChar);LOCAL int    at91cPollInput (SIO_CHAN *pSioChan, char *thisChar);LOCAL int    at91cIoctl (SIO_CHAN *pSioChan, int request, void *arg);LOCAL STATUS dummyCallback (void);LOCAL void at91cIntRcv(AT91C_CHAN * pChan);LOCAL void at91cIntTx(AT91C_CHAN * pChan);/* local variables */LOCAL    SIO_DRV_FUNCS at91cSioDrvFuncs =    {    at91cIoctl,    at91cTxStartup,    at91cCallbackInstall,    at91cPollInput,    at91cPollOutput    };LOCAL BOOL at91cIntrMode = FALSE;    /* interrupt mode allowed flag *//******************************************************************************** at91cDevInit - initialize a AT91C_DUSART** This routine initializes the driver* function pointers and then resets the chip in a quiescent state.* The BSP must have already initialized all the device addresses and the* baudFreq fields in the AT91C_DUSART structure before passing it to* this routine.** RETURNS: N/A*/void at91cDevInit    (    AT91C_CHAN * pChan    )    {    /* initialize each channel's driver function pointers */    pChan->sio.pDrvFuncs    = &at91cSioDrvFuncs;    /* install dummy driver callbacks */    pChan->getTxChar     = dummyCallback;    pChan->putRcvChar    = dummyCallback;        /* reset the chip */    AT91C_SIO_REG_WRITE(pChan,AT91C_US_CR,(AT91C_US_RSTRX | AT91C_US_RSTTX));/*RESET*/    AT91C_SIO_REG_WRITE(pChan,AT91C_US_CR,(AT91C_US_RXEN | AT91C_US_TXEN));	/*TX&RX ENABLE*/    AT91C_SIO_REG_WRITE(pChan,AT91C_US_MR,(AT91C_US_CLKS_CLOCK | AT91C_US_CHRL_8_BITS |								AT91C_US_PAR_NONE | AT91C_US_NBSTOP_1_BIT));/*MODE*/    /* setting polled mode is one way to make the device quiet */    at91cIoctl ((SIO_CHAN *)pChan, SIO_MODE_SET, (void *)SIO_MODE_POLL);    at91cIoctl ((SIO_CHAN *)pChan, SIO_BAUD_SET, (void *)AT91C_SIO_DEFAULT_BAUD);    }/******************************************************************************** at91cDevInit2 - initialize a AT91C_DUSART, part 2** This routine is called by the BSP after interrupts have been connected.* The driver can now operate in interrupt mode.  Before this routine is* called only polled mode operations should be allowed.** RETURNS: N/A* ARGSUSED*/void at91cDevInit2    (    AT91C_CHAN * pChan        /* device to initialize */    )    {    char      outchar = '\0';    UINT32    status;#if 0	int i;    /* Interrupt mode is allowed */    AT91C_SIO_REG_WRITE(pChan,AT91C_US_CR,(AT91C_US_RSTRX | AT91C_US_RSTTX));/*RESET*/    AT91C_SIO_REG_WRITE(pChan,AT91C_US_CR,(AT91C_US_RXEN | AT91C_US_TXEN));	/*TX&RX ENABLE*/    AT91C_SIO_REG_WRITE(pChan,AT91C_US_MR,(AT91C_US_CLKS_CLOCK | AT91C_US_CHRL_8_BITS |								AT91C_US_PAR_NONE | AT91C_US_NBSTOP_1_BIT));/*MODE*/    AT91C_SIO_REG_WRITE(pChan,AT91C_US_IER,(AT91C_US_RXRDY |AT91C_US_TXRDY));/*INT ENABLE*/    intEnable(pChan->intLevel);    /*      * Dummy write to TXBUF to start TX empty interrupt     */    AT91C_SIO_REG_WRITE(pChan,AT91C_US_THR,outchar);	    AT91C_SIO_REG_READ(pChan,AT91C_US_CSR, status);  	/*    AT91C_SIO_REG_WRITE(pChan,AT91C_AIC_ICCR,(1<<pChan->intLevel));/*clear pend */		*(volatile UINT32 *)0xfffff800 = 0x35;	*(volatile UINT32 *)0xfffff810 = 0x35;		while(1)	{	*(volatile UINT32 *)0xfffff834 = 0x35;/*lit*/		for(i=0;i<1000000;i++);		*(volatile UINT32 *)0xfffff830 = 0x35;		for(i=0;i<1000000;i++);		}	    while ((status & AT91C_US_TXREADY) != AT91C_US_TXREADY)        ;#endif    AT91C_SIO_REG_WRITE(pChan,AT91C_US_IER,AT91C_US_RXRDY |AT91C_US_TXRDY);    at91cIntrMode = TRUE;    }/******************************************************************************** at91cInt - handle a system  interrupt:DBGU or ST_PIT** RETURNS: N/A*/ void sysIntHandler		(	    AT91C_CHAN *    pChan        /* channel generating the interrupt */	){	UINT32 status;	UINT32 mask;	status = *(volatile UINT32 *)AT91C_ST_SR;	mask = *(volatile UINT32 *)AT91C_ST_IMR;		if((status & mask) == 1)	{		sysClkInt();	}	else	{		at91cInt(pChan);	}}/******************************************************************************** at91cInt - handle a channel's Tramsmit or receive-character interrupt** RETURNS: N/A*/ void at91cInt		(	    AT91C_CHAN *    pChan        /* channel generating the interrupt */	){    	UINT32        status;	AT91C_SIO_REG_READ(pChan,AT91C_US_CSR, status);	if((status & AT91C_US_RXREADY ) == AT91C_US_RXREADY )		at91cIntRcv(pChan);	else if((status & AT91C_US_TXREADY) != AT91C_US_TXREADY)		return;		at91cIntTx(pChan);}/******************************************************************************** at91cIntRcv - handle a channel's receive-character interrupt** RETURNS: N/A*/ LOCAL void at91cIntRcv    (    AT91C_CHAN *    pChan        /* channel generating the interrupt */    )    {    char            inChar;    /*     * Grab the input character from the chip and hand it off via a     * callback. For chips with input FIFO's it is more efficient     * to empty the entire FIFO here.     */        AT91C_SIO_REG_READ(pChan,AT91C_US_RHR, inChar);        (*pChan->putRcvChar) (pChan->putRcvArg, inChar);    }/******************************************************************************** at91cIntTx - handle a channels transmitter-ready interrupt** RETURNS: N/A*/ LOCAL void at91cIntTx    (    AT91C_CHAN *    pChan        /* channel generating the interrupt */    )    {    char      outChar;    /*     * If there's a character to transmit then write it out, else reset     * the transmitter. For chips with output FIFO's it is more efficient     * to fill the entire FIFO here.     */    if ((*pChan->getTxChar) (pChan->getTxArg, &outChar) != ERROR)        AT91C_SIO_REG_WRITE(pChan, AT91C_US_THR, outChar);    else        {            AT91C_SIO_REG_WRITE(pChan, AT91C_US_IDR, AT91C_US_TXRDY);/*disable Tx interrupt*/#if 0		        *(volatile UINT32 *) AT91C_AIC_CISR= (1 << pChan->intLevel); /*INT pend clear*/#endif		*(volatile UINT32 *) AT91C_AIC_ICCR= (1 << pChan->intLevel); /*INT pend clear*/        }    }/******************************************************************************** at91cTxStartup - start the interrupt transmitter** RETURNS: OK on success, ENOSYS if the device is polled-only, or* EIO on hardware error.*/LOCAL int at91cTxStartup    (    SIO_CHAN * pSioChan                 /* channel to start */    )    {    AT91C_CHAN * pChan = (AT91C_CHAN *)pSioChan;/*    *(volatile UINT32 *)AT91C_AIC_CISR = (1 << pChan->intLevel);*/    *(volatile UINT32 *) AT91C_AIC_ICCR= (1 << pChan->intLevel); /*INT pend clear*/    AT91C_SIO_REG_WRITE(pChan, AT91C_US_IER,AT91C_US_TXRDY);	    intEnable (pChan->intLevel);    return (OK);    }/******************************************************************************** at91cCallbackInstall - install ISR callbacks to get/put chars** This driver allows interrupt callbacks for transmitting characters* and receiving characters. In general, drivers may support other* types of callbacks too.** RETURNS: OK on success, or ENOSYS for an unsupported callback type.*/ LOCAL int at91cCallbackInstall    (    SIO_CHAN *    pSioChan,               /* channel */    int           callbackType,           /* type of callback */    STATUS        (*callback)(),          /* callback */    void *        callbackArg             /* parameter to callback */    )    {    AT91C_CHAN * pChan = (AT91C_CHAN *)pSioChan;    switch (callbackType)    {    case SIO_CALLBACK_GET_TX_CHAR:        pChan->getTxChar    = callback;        pChan->getTxArg     = callbackArg;        return (OK);    case SIO_CALLBACK_PUT_RCV_CHAR:        pChan->putRcvChar    = callback;        pChan->putRcvArg     = callbackArg;        return (OK);    default:        return (ENOSYS);    }    }/********************************************************************************* at91cPollOutput - output a character in polled mode** RETURNS: OK if a character arrived, EIO on device error, EAGAIN* if the output buffer if full. ENOSYS if the device is* interrupt-only.*/LOCAL int at91cPollOutput    (    SIO_CHAN *pSioChan,    char      outChar    )    {    AT91C_CHAN * pChan = (AT91C_CHAN *)pSioChan;    UINT32    status;    /* is the transmitter ready to accept a character? */    AT91C_SIO_REG_READ (pChan, AT91C_US_CSR, status);    if ((status & AT91C_US_TXREADY) == 0x00)        return (EAGAIN);    /* write out the character */    AT91C_SIO_REG_WRITE(pChan, AT91C_US_THR, outChar);    return (OK);    }/******************************************************************************** at91cPollInput - poll the device for input** RETURNS: OK if a character arrived, EIO on device error, EAGAIN* if the input buffer if empty, ENOSYS if the device is* interrupt-only.*/LOCAL int at91cPollInput    (    SIO_CHAN *    pSioChan,    char *        thisChar    )    {    AT91C_CHAN * pChan = (AT91C_CHAN *)pSioChan;    UINT32    status;    AT91C_SIO_REG_READ (pChan,AT91C_US_CSR, status);    if ((status & AT91C_US_RXREADY) == 0x00)        return (EAGAIN);    /* no input available at this time */    /* got a character */    AT91C_SIO_REG_READ(pChan, AT91C_US_RHR, *thisChar);    return (OK);    }/******************************************************************************** at91cModeSet - toggle between interrupt and polled mode** RETURNS: OK on success, EIO on unsupported mode.*/LOCAL int at91cModeSet    (    AT91C_CHAN * pChan,        /* channel */    uint_t          newMode       /* new mode */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲乱码国产乱码精品精98午夜 | 日韩欧美另类在线| 狠狠色丁香婷婷综合| 亚洲日本护士毛茸茸| 日韩欧美卡一卡二| 在线亚洲人成电影网站色www| 免费精品视频在线| 亚洲欧美一区二区不卡| 精品理论电影在线观看| 欧美军同video69gay| av毛片久久久久**hd| 国内精品伊人久久久久av一坑| 一区二区三区精品在线| 久久精品人人做人人综合| 在线不卡一区二区| 欧美性猛交xxxx黑人交| 91免费国产在线| 国产精品1区2区3区在线观看| 日韩 欧美一区二区三区| 一区二区三区欧美日| 一区视频在线播放| 亚洲国产精品成人久久综合一区| 欧美一级理论性理论a| 欧美日韩国产精品成人| 91黄色免费观看| 91在线看国产| 国产91精品露脸国语对白| 久久成人综合网| 蜜桃久久精品一区二区| 全国精品久久少妇| 日韩av网站免费在线| 亚洲第一在线综合网站| 亚洲自拍偷拍网站| 亚洲精品国产a| 一区二区三区中文字幕电影| 亚洲欧美精品午睡沙发| 国产精品成人一区二区三区夜夜夜| 国产亚洲综合在线| 久久精品欧美一区二区三区麻豆| 精品国产一区a| 精品久久久网站| xfplay精品久久| 久久精品视频一区二区三区| 日本一区二区三区久久久久久久久不| 精品福利av导航| 久久久91精品国产一区二区精品| 久久午夜色播影院免费高清| 久久亚洲一区二区三区明星换脸| 久久精品一区四区| 国产精品乱人伦中文| 国产精品国产精品国产专区不蜜| 中文av字幕一区| 亚洲人成在线观看一区二区| 亚洲精品成人天堂一二三| 亚洲自拍另类综合| 日韩国产一二三区| 国产在线精品免费av| 欧美日韩三级一区| 欧洲一区二区三区免费视频| 欧美午夜精品免费| 欧美一区二区网站| 久久毛片高清国产| 国产精品国产精品国产专区不片 | 一区二区三区国产精品| 亚洲电影视频在线| 蜜臀av一区二区在线观看 | 国内成人精品2018免费看| 国产成人在线网站| 91丨porny丨在线| 欧美视频你懂的| 91精品国产福利| 欧美激情一二三区| 亚洲综合清纯丝袜自拍| 黄色精品一二区| 成人h版在线观看| 欧美唯美清纯偷拍| 欧美精品一区二区在线播放| 亚洲欧洲精品天堂一级 | 蜜桃av噜噜一区二区三区小说| 国产美女精品一区二区三区| 91丨porny丨首页| 91精品国产91久久综合桃花| 国产日韩欧美a| 亚洲成人一二三| 成人午夜激情视频| 欧美日韩精品久久久| 中文字幕欧美区| 亚洲国产aⅴ成人精品无吗| 激情综合亚洲精品| 色吊一区二区三区| xnxx国产精品| 性做久久久久久| 丁香婷婷综合色啪| 色悠久久久久综合欧美99| 日韩av二区在线播放| 91在线视频18| 亚洲精品一区二区三区精华液| 亚洲美女屁股眼交| 激情久久五月天| 欧美精品丝袜中出| 综合网在线视频| 久久成人久久爱| 欧美视频一二三区| 亚洲欧洲无码一区二区三区| 亚洲国产精品自拍| 9人人澡人人爽人人精品| 91精品国产高清一区二区三区| 免费观看久久久4p| 99精品久久免费看蜜臀剧情介绍| 久久久精品欧美丰满| 日韩成人一区二区| 日韩久久精品一区| 亚洲成人www| 欧美一区二区在线播放| 亚洲一区在线观看免费观看电影高清 | 国产亚洲综合在线| 亚洲一区在线播放| 成人性生交大合| 亚洲精品一区二区三区蜜桃下载| 亚洲丰满少妇videoshd| 国产一区二区三区免费在线观看| 婷婷开心久久网| 成人一道本在线| 久久综合久久综合九色| 日韩av一级片| 欧美三级在线播放| 国产精品乱码人人做人人爱| 国产精品中文有码| 精品国产91洋老外米糕| 日韩高清欧美激情| 欧美日韩精品一区二区在线播放| 一级精品视频在线观看宜春院| 国内精品免费**视频| 国产一区二区中文字幕| 亚洲天堂福利av| 欧美大片顶级少妇| 欧美亚洲国产一区二区三区| 中文字幕精品在线不卡| 精品夜夜嗨av一区二区三区| 日韩限制级电影在线观看| 日韩激情中文字幕| 91精选在线观看| 天堂成人免费av电影一区| 欧美亚洲国产一区在线观看网站| 亚洲精品ww久久久久久p站| 在线亚洲+欧美+日本专区| 亚洲尤物在线视频观看| 在线欧美日韩精品| 一区二区三区蜜桃网| 欧美日韩在线精品一区二区三区激情 | 在线视频综合导航| 一区二区欧美在线观看| 欧美亚洲动漫制服丝袜| 亚洲国产成人av网| 日韩一二在线观看| 国产精品一二三四五| 中文字幕av一区二区三区| 99麻豆久久久国产精品免费| 亚洲欧洲一区二区在线播放| 欧美综合天天夜夜久久| 天堂成人免费av电影一区| 精品国产一区二区在线观看| 成人免费看片app下载| 亚洲色图另类专区| 91精品婷婷国产综合久久| 极品美女销魂一区二区三区| 国产精品网曝门| 色婷婷国产精品| 首页综合国产亚洲丝袜| 久久综合色天天久久综合图片| 国产福利精品一区二区| 亚洲欧美日韩国产一区二区三区 | 久久久久亚洲蜜桃| av中文字幕亚洲| 日本伊人色综合网| 国产精品视频一二三| 欧美性大战久久久久久久| 另类小说图片综合网| 欧美激情综合五月色丁香小说| 精品国产三级电影在线观看| 中文一区在线播放| 日韩国产一二三区| 国产98色在线|日韩| av一二三不卡影片| 欧美久久久久久久久| 欧美福利视频导航| 92精品国产成人观看免费 | 婷婷国产v国产偷v亚洲高清| 三级精品在线观看| 色妞www精品视频| 中文字幕一区二区三区在线观看| 麻豆国产一区二区| 精品福利二区三区| 国产精品66部| 亚洲欧洲av色图| 在线观看三级视频欧美| 亚洲大片在线观看| 9191国产精品| 国产一区亚洲一区| 国产精品久久777777|