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

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

?? st16c554sio.c

?? vxworks下的16c554驅動
?? C
?? 第 1 頁 / 共 2 頁
字號:
        mask = ((*pChan->inByte) (pChan->msr)) & ST16C554_MSR_CTS;        /* if the CTS is asserted enable Tx interrupt */        if (mask & ST16C554_MSR_CTS)                ier |= ST16C554_IER_TBE;        else                ier &= (~ST16C554_IER_TBE);         }    else         ier &= ~ST16C554_IER_MSI; /* disable modem status interrupt */     oldlevel = intLock ();    (*pChan->outByte) (pChan->lcr, lcr);    (*pChan->outByte) (pChan->mdc, mcr);    /* now clear the port */    (*pChan->inByte) (pChan->data);    if (options & CREAD)          ier |= ST16C554_IER_RXRDY;    if (pChan->channelMode == SIO_MODE_INT)        {        (*pChan->outByte) (pChan->ier, ier);        }    intUnlock (oldlevel);    pChan->options = options;    return OK;    }/********************************************************************************* ST16C554Ioctl - special device control** Includes commands to get/set baud rate, mode(INT, POLL), hardware options(* parity, number of data bits), and modem control(RTS/CTS and DTR/DSR).* The ioctl commands SIO_HUP and SIO_OPEN are implemented to provide the * HUPCL( hang up on last close) function.** RETURNS: OK on success, EIO on device error, ENOSYS on unsupported*          request.*/static int ST16C554Ioctl    (    ST16C554_CHAN *  pChan,        /* device to control */    int request,                /* request code */    int arg                     /* some argument */    )    {    int test_ier;    int ix;    int baudH;    int baudL;    int oldlevel;    UINT8 lcr;    int status = OK;    switch (request)        {        case SIO_BAUD_SET:            status = (ST16C554BaudSet(pChan, arg) == OK) ? OK : EIO;            break;        case SIO_BAUD_GET:                        oldlevel = intLock();            status = EIO;            lcr = (*pChan->inByte) (pChan->lcr);            (*pChan->outByte) (pChan->lcr, (char)( lcr));            baudH = (*pChan->inByte)(pChan->brdh);            baudL = (*pChan->inByte)(pChan->brdl);            (*pChan->outByte) (pChan->lcr, lcr);            for (ix = 0; ix < NELEMENTS (baudTable); ix++)                {                if ( baudH  == MSB (baudTable[ix].preset) &&                     baudL  == LSB (baudTable[ix].preset) )                    {                    *(int *)arg = baudTable[ix].rate;                    status = OK;                    }                }            intUnlock(oldlevel);            break;        case SIO_MODE_SET:            status = (ST16C554ModeSet (pChan, arg) == OK) ? OK : EIO;            break;        case SIO_MODE_GET:            *(int *)arg = pChan->channelMode;            return (OK);        case SIO_AVAIL_MODES_GET:            *(int *)arg = SIO_MODE_INT | SIO_MODE_POLL;            return (OK);        case SIO_HW_OPTS_SET:            status = (ST16C554OptsSet (pChan, arg) == OK) ? OK : EIO;            break;        case SIO_HW_OPTS_GET:            *(int *)arg = pChan->options;            break;        case SIO_HUP:            /* check if hupcl option is enabled */            if (pChan->options & HUPCL)                 status = ST16C554Hup (pChan);            break;                case SIO_OPEN:            /* check if hupcl option is enabled */            if (pChan->options & HUPCL)                 status = ST16C554Open (pChan);            break;	case SIO_INIT_IER:	    (*pChan->outByte) (pChan->ier, ST16C554_IER_RXRDY);	    test_ier = (*pChan->inByte)(pChan->ier);	    printf("\nier=%d",test_ier);	    	    (*pChan->outByte) (pChan->fcr, 0x00);	    test_ier = (*pChan->inByte)(pChan->fcr);	    printf("\nfcr=%d",test_ier);	    	    test_ier = (*pChan->inByte)(pChan->mdc);	    printf("\nMCR=%d",test_ier);	    	    test_ier = (*pChan->inByte)(pChan->msr);	    printf("\nmsr=%d",test_ier);	    	    test_ier = (*pChan->inByte)(pChan->lst);	    printf("\nlst=%d",test_ier);	    	    test_ier = (*pChan->inByte)(pChan->data);	    printf("\ndata=%d",test_ier);	    break;	            default:            status = ENOSYS;            break;        }    return (status);    }/********************************************************************************* ST16C554Int - handle a receiver/transmitter interrupt** This routine handles four sources of interrupts from the UART.  If there is* another character to be transmitted, the character is sent.  When a modem* status interrupt occurs, the transmit interrupt is enabled if the CTS signal* is TRUE.** INTERNAL* The UART interrupts are prioritized in the following order by the Interrupt* Identification Register:**     Bit 2    bit 1    bit 0    Priority        Interrupt ID*     -------------------------------------------------------*     0        0        1        none            none*     1        1        0        0               serialization error or BREAK*     1        0        0        1               received data*     0        1        0        2               transmitter buffer empty*     0        0        0        3               RS-232 input**** In the table, priority level 0 is the highest priority.  These priorities* are not typically configurable via software.  The interrupt is expressed as* a two-bit integer.  Bit 0, the pending bit, is negative logic - a value 0* means that an interrupt is pending.** When nested interrupts occur, the second interrupt is identified in the* Interrupt Identification Register (IIR) as soon as the first interrupt is* cleared. Therefore, the interrupt service routine must continue to read IIR* until bit-0 is 1.** When the 8250 generates an interrupt, all interrupts with an equal or* lower priority are locked out until the current interrupt has been cleared.* The operation required to clear an interrupt varies according to the source.* The actions typically required to clear an interrupt are as follows:**    Source of interrupt                Response required to reset*    ---------------------------------------------------------------------*    receiver error or BREAK            read serialization status register*    received data                      read data from receiver register*    transmit buffer empty              write to the transmitter or read*                                       the interrupt ID register*    RS-232 input                       read the RS-232 status register** In response to an empty transmit buffer (TBE), the interrupt can be* cleared by writing a byte to the transmitter buffer register.  It can* also be cleared by reading the interrupt identification register.** Failure to clear all interrupts before returning will leave an interrupt* pending and prevent the UART from generating further interrupt requests* to the CPU.** RETURNS: N/A*/void ST16C554Int    (    ST16C554_CHAN  *  pChan    )    {    char outChar;       /* store a byte for transmission */    char interruptID;   /* store contents of interrupt ID register */    char lineStatus;    /* store contents of line status register */    char ier;           /* store contents of interrupt enable register */    char rec_data;    int  ix = 0;        /* allows us to return just in case IP never clears */    ier = (*pChan->inByte) (pChan->ier);    /* service UART interrupts until IP bit set or read counter expires */    FOREVER        {        interruptID = ((*pChan->inByte)(pChan->iid) & ST16C554_IIR_MASK);	/*printf("\nafter int id=%d",interruptID);        printf("\nafter int ix=%d",ix);*/                if ((interruptID == ST16C554_IIR_IP) || (++ix > ST16C554_IIR_READ_MAX))            {            break;  /* interrupt cleared or loop counter expired */             }        /* filter possible anomalous interrupt ID from PC87307VUL (SPR 26117) */        interruptID &= 0x0e;  /* clear odd-bit to find interrupt ID */        if (interruptID == ST16C554_IIR_SEOB)            {            lineStatus = (*pChan->inByte) (pChan->lst);            }        else if (interruptID == ST16C554_IIR_RBRF)            {                        if (pChan->putRcvChar != NULL)              {              	                	  (*pChan->putRcvChar)(pChan->putRcvArg,                               (*pChan->inByte) (pChan->data));              }            else              {                (*pChan->inByte) (pChan->data);                              }            /*printf("\nafter int id=%d",interruptID);*/            }        else if (interruptID == ST16C554_IIR_THRE)            {            if ((pChan->getTxChar != NULL) &&                (*pChan->getTxChar) (pChan->getTxArg, &outChar) == OK               )                {                (*pChan->outByte) (pChan->data, outChar);                }            /* There are no bytes available for transmission.  Reading             * the IIR at the top of this loop will clear the interrupt.             */            }        else if (interruptID == ST16C554_IIR_MSTAT) /* modem status register */            {                        char msr = (*(pChan)->inByte) (pChan->msr);	    printf("\ninterrupt msr!");            /* (|=) ... DON'T CLOBBER BITS ALREADY SET IN THE IER */            ier |= (ST16C554_IER_RXRDY | ST16C554_IER_MSI);            /* if CTS is asserted by modem, enable tx interrupt */            if ((msr & ST16C554_MSR_CTS) && (msr & ST16C554_MSR_DCTS))                {                (*pChan->outByte) (pChan->ier, (ST16C554_IER_TBE | ier));                }            else  /* turn off TBE interrupt until CTS from modem */                {                (*pChan->outByte) (pChan->ier, (ier & (~ST16C554_IER_TBE)));                }            }	 /*         else if(interruptID == ST16C554_IIR_TOUT)  receive data time out              {             	             }        */	        }  /* FOREVER */    }/********************************************************************************* ST16C554Startup - transmitter startup routine** Call interrupt level character output routine and enable interrupt if it is* in interrupt mode with no hardware flow control.* If the option for hardware flow control is enabled and CTS is set TRUE,* then the Tx interrupt is enabled.** RETURNS: OK*/LOCAL int ST16C554Startup    (    ST16C554_CHAN *  pChan         /* tty device to start up */    )    {    char  ier = ST16C554_IER_RXRDY;    char  mask;    if (pChan->channelMode == SIO_MODE_INT)        {        if (pChan->options & CLOCAL)            {            /* No modem control */            ier |= ST16C554_IER_TBE;            }        else            {            mask = ((*pChan->inByte) (pChan->msr)) & ST16C554_MSR_CTS;            /* if the CTS is asserted enable Tx interrupt */            if (mask & ST16C554_MSR_CTS)                ier |= (ST16C554_IER_TBE | ST16C554_IER_MSI);            else                ier |= (ST16C554_IER_MSI);            }        (*pChan->outByte) (pChan->ier, ier);        }    return (OK);    }/******************************************************************************** ST16C554PRxChar - poll the device for input.** RETURNS: OK if a character arrived, EIO on device error, EAGAIN* if the input buffer if empty.*/LOCAL int ST16C554PRxChar    (    ST16C554_CHAN *    pChan,      /* pointer to channel */    char *          pChar       /* pointer to char */    )    {    char pollStatus;    pollStatus = ( *(pChan)->inByte) (pChan->lst);    if ((pollStatus & ST16C554_LSR_RXRDY) == 0x00)        return (EAGAIN);    /* got a character */    *pChar = ( *(pChan)->inByte) (pChan->data);    printf("\npoll the device for input!");    return (OK);    }/******************************************************************************** ST16C554PTxChar - output a character in polled mode.* * Checks if the transmitter is empty. If empty, a character is written to* the data register. ** If the hardware flow control is enabled the handshake signal CTS has to be* asserted in order to send a character.** RETURNS: OK if a character arrived, EIO on device error, EAGAIN* if the output buffer if full.*/LOCAL int ST16C554PTxChar    (    ST16C554_CHAN *  pChan,        /* pointer to channel */    char          outChar       /* char to send */    )    {    char pollStatus;    char msr;    pollStatus = ( *(pChan)->inByte) (pChan->lst);    msr = (*(pChan)->inByte) (pChan->msr);    /* is the transmitter ready to accept a character? */    if ((pollStatus & ST16C554_LSR_TEMT) == 0x00)        return (EAGAIN);    if (!(pChan->options & CLOCAL))      /* modem flow control ? */        {        if (msr & ST16C554_MSR_CTS)            (*(pChan)->outByte) ((pChan)->data, outChar);        else            return (EAGAIN);        }    else        (*(pChan)->outByte) ((pChan)->data, outChar);    return (OK);    }/*rec_data = (*pChan->inByte) (pChan->fcr);              	  printf("\nfcr = %d", rec_data);              	  rec_data = (*pChan->inByte) (pChan->lst);              	  printf("\nlst = %d", rec_data);              	  rec_data = (*pChan->inByte) (pChan->data);              	  printf("\nreceive data: %c", rec_data);              	  printf("\nreceive data: %d\n\n", rec_data);*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一卡二卡| 一区二区三区视频在线看| 男男gaygay亚洲| 555www色欧美视频| 麻豆精品视频在线观看免费| 日韩一二三四区| 国产一区二区久久| 国产精品久久久久久久久久久免费看 | 国产精品18久久久| 国产精品久久久久久一区二区三区| a级高清视频欧美日韩| 亚洲精品国产精华液| 91麻豆精品国产自产在线 | 亚洲一区二区三区视频在线| 欧美日韩高清影院| 国产揄拍国内精品对白| 国产清纯在线一区二区www| 成人黄色av电影| 亚洲精品久久7777| 精品国产凹凸成av人导航| 国产99久久久精品| 亚洲午夜精品在线| 精品av久久707| 99久久99久久综合| 免费在线观看精品| 国产精品妹子av| 欧美人与z0zoxxxx视频| 国模套图日韩精品一区二区| 国产精品国产三级国产普通话99 | 在线一区二区视频| 精品一区二区日韩| 亚洲人成在线播放网站岛国| 欧美日韩国产综合久久| 国产传媒一区在线| 亚洲国产毛片aaaaa无费看| 精品盗摄一区二区三区| av一二三不卡影片| 午夜精品成人在线| 中文字幕制服丝袜一区二区三区 | 国产在线一区二区综合免费视频| 中文字幕人成不卡一区| 日韩美女视频在线| 欧美午夜精品久久久久久超碰| 国产一区二区三区日韩| 亚洲国产一区在线观看| 国产精品久久久99| 日韩精品中文字幕一区| 欧美午夜不卡视频| aaa亚洲精品一二三区| 麻豆91在线看| 亚洲午夜精品17c| 中文字幕精品在线不卡| 精品国产1区二区| 5566中文字幕一区二区电影 | 亚洲国产日韩综合久久精品| 国产精品白丝在线| 欧美韩国日本综合| 久久青草欧美一区二区三区| 日韩视频在线你懂得| 欧美视频一区二区三区| 91亚洲永久精品| eeuss鲁片一区二区三区 | 欧美二区在线观看| 在线观看av一区二区| 99re这里只有精品首页| 国产v综合v亚洲欧| 国产一区二区免费视频| 国产永久精品大片wwwapp| 日本成人在线一区| 日本美女视频一区二区| 日韩av网站免费在线| 日本色综合中文字幕| 亚洲成年人影院| 偷拍一区二区三区四区| 亚洲www啪成人一区二区麻豆| 一区二区三区在线观看国产| 中文字幕一区二区三区乱码在线| 欧美国产日韩亚洲一区| 国产精品视频九色porn| 中文字幕一区三区| 亚洲色欲色欲www| 亚洲欧美日韩国产手机在线| 亚洲欧美在线视频| 亚洲免费观看高清完整版在线| 亚洲人妖av一区二区| 亚洲精品菠萝久久久久久久| 洋洋av久久久久久久一区| 亚洲永久免费av| 日韩av在线播放中文字幕| 久草这里只有精品视频| 国产原创一区二区三区| 成人av网在线| 欧美性猛交xxxx乱大交退制版| 欧美日韩二区三区| 欧美tickling网站挠脚心| 国产夜色精品一区二区av| 国产精品福利影院| 亚洲福利一区二区三区| 青青草原综合久久大伊人精品优势 | 精品国产一区二区三区av性色| 精品国产91久久久久久久妲己 | 亚洲制服丝袜在线| 日韩黄色免费网站| 精品一区二区三区在线观看| 成人高清伦理免费影院在线观看| 日本韩国欧美在线| 51精品国自产在线| 国产三级一区二区| 一区二区三区在线视频免费| 三级欧美在线一区| 国产suv精品一区二区三区| 色综合天天综合狠狠| 欧美日本国产视频| 久久久久久免费| 亚洲综合一二三区| 国内精品在线播放| 91免费版在线| 欧美mv和日韩mv国产网站| 国产精品久久久久影视| 日韩综合在线视频| 国产.欧美.日韩| 91精品综合久久久久久| 国产精品久久久久永久免费观看| 香蕉成人啪国产精品视频综合网 | eeuss鲁片一区二区三区在线观看| 欧洲精品一区二区三区在线观看| xnxx国产精品| 一区二区三区蜜桃网| 久久精品国产精品亚洲红杏| 懂色中文一区二区在线播放| 欧美一区二区福利在线| 一区二区三区中文字幕精品精品 | 国产在线精品一区二区| 日韩午夜在线影院| 成人免费在线播放视频| 国产在线麻豆精品观看| 欧美揉bbbbb揉bbbbb| 国产欧美一区二区精品婷婷| 午夜精品一区在线观看| 91免费国产视频网站| 日本一区二区视频在线观看| 婷婷丁香久久五月婷婷| 色哟哟精品一区| 中文字幕在线一区| 国产一区二区日韩精品| 制服丝袜激情欧洲亚洲| 亚洲精品自拍动漫在线| 国产91对白在线观看九色| 欧美一区二区三区免费观看视频| 亚洲一区二区av电影| av电影在线观看完整版一区二区| 亚洲精品一区二区三区蜜桃下载| 午夜精品123| 欧美日韩一本到| 亚洲国产婷婷综合在线精品| 91蜜桃视频在线| 中文字幕一区二区三| 粉嫩av一区二区三区粉嫩| 久久综合久久鬼色中文字| 麻豆91小视频| 欧美一区二区在线免费播放| 亚洲va欧美va人人爽午夜| 欧美在线观看18| 亚洲精选视频在线| 在线视频欧美精品| 亚洲免费av高清| 色婷婷亚洲综合| 一区二区三区欧美久久| 欧美在线免费视屏| 亚洲国产色一区| 欧美疯狂做受xxxx富婆| 亚洲成av人片| 欧美一区二区免费视频| 蜜桃久久久久久| 精品免费国产二区三区| 国模大尺度一区二区三区| 久久精品视频免费| 成人午夜看片网址| 国产精品国产三级国产三级人妇| 成人在线综合网站| 18成人在线观看| 欧美色窝79yyyycom| 婷婷久久综合九色综合绿巨人| 欧美理论在线播放| 久久国内精品视频| 2024国产精品视频| www.亚洲免费av| 亚洲精选视频在线| 欧美一区二区黄| 久久9热精品视频| 中文字幕欧美日韩一区| 一本到不卡精品视频在线观看 | 日本欧美一区二区在线观看| 欧美α欧美αv大片| 高清不卡一二三区| 一区二区三区蜜桃| 精品理论电影在线| www.久久精品| 日韩av一二三| 自拍偷拍亚洲激情|