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

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

?? xuartlite.c

?? <基于fpga的嵌入式設計上的光盤的第四章第二個實驗
?? C
?? 第 1 頁 / 共 2 頁
字號:
}/****************************************************************************//**** This function resets the FIFOs, both transmit and receive, of the UART such* that they are emptied.  Since the UART does not have any way to disable it* from receiving data, it may be necessary for the application to reset the* FIFOs to get rid of any unwanted data.** @param    InstancePtr is a pointer to the XUartLite instance to be worked on.** @return** None.** @note** None.******************************************************************************/void XUartLite_ResetFifos(XUartLite *InstancePtr){    Xuint32 Register;    XASSERT_VOID(InstancePtr != XNULL);    XASSERT_VOID(InstancePtr->IsReady == XCOMPONENT_IS_READY);    /* Read the status register 1st such that the next write to the control     * register won't destroy the state of the interrupt enable bit     */    Register =        XIo_In32(InstancePtr->RegBaseAddress + XUL_STATUS_REG_OFFSET);    /*     * Mask off the interrupt enable bit to maintain it's state.     */    Register &= XUL_SR_INTR_ENABLED;    /* Write to the control register to reset both FIFOs, these bits are     * self-clearing such that there's no need to clear them     */    XIo_Out32(InstancePtr->RegBaseAddress + XUL_CONTROL_REG_OFFSET,              Register | XUL_CR_FIFO_TX_RESET | XUL_CR_FIFO_RX_RESET);}/****************************************************************************//**** This function determines if the specified UART is sending data. If the* transmitter register is not empty, it is sending data.** @param    InstancePtr is a pointer to the XUartLite instance to be worked on.** @return** A value of XTRUE if the UART is sending data, otherwise XFALSE.** @note** None.******************************************************************************/Xboolean XUartLite_IsSending(XUartLite *InstancePtr){    Xuint32 StatusRegister;    /*     * Assert validates the input arguments     */    XASSERT_NONVOID(InstancePtr != XNULL);    /* Read the status register to determine if the transmitter is     * empty     */    StatusRegister = XIo_In32(InstancePtr->RegBaseAddress + XUL_STATUS_REG_OFFSET);    /* If the transmitter is not empty then indicate that the UART is still     * sending some data     */    return ((StatusRegister & XUL_SR_TX_FIFO_EMPTY) == 0);}/****************************************************************************** This function provides a stub handler such that if the application does not* define a handler but enables interrupts, this function will be called.** @param    CallBackRef has no purpose but is necessary to match the*           interface for a handler.* @param    ByteCount has no purpose but is necessary to match the*           interface for a handler.** @return** None.** @note** None.******************************************************************************/static void StubHandler(void *CallBackRef, unsigned int ByteCount){    /*     * Assert occurs always since this is a stub and should never be called     */    XASSERT_VOID_ALWAYS();}/****************************************************************************//**** This function sends a buffer that has been previously specified by setting* up the instance variables of the instance. This function is designed to be* an internal function for the XUartLite component such that it may be called* from a shell function that sets up the buffer or from an interrupt handler.** This function sends the specified buffer of data to the UART in either* polled or interrupt driven modes. This function is non-blocking such that* it will return before the data has been sent by the UART.** In a polled mode, this function will only send as much data as the UART can* buffer, either in the transmitter or in the FIFO if present and enabled.* The application may need to call it repeatedly to send a buffer.** In interrupt mode, this function will start sending the specified buffer and* then the interrupt handler of the driver will continue until the buffer* has been sent. A callback function, as specified by the application, will* be called to indicate the completion of sending the buffer.** @param    InstancePtr is a pointer to the XUartLite instance to be worked on.** @return** NumBytes is the number of bytes actually sent (put into the UART transmitter* and/or FIFO).** @note** None.******************************************************************************/unsigned int XUartLite_SendBuffer(XUartLite *InstancePtr){    unsigned int SentCount = 0;    Xuint8 StatusRegister;    /* Read the line status register to determine if the transmitter is     * full     */    StatusRegister = XUartLite_mGetStatusReg(InstancePtr->RegBaseAddress);    /*     * Fill the FIFO from the the buffer that was specified     */    while (((StatusRegister & XUL_SR_TX_FIFO_FULL) == 0) &&           (SentCount < InstancePtr->SendBuffer.RemainingBytes))    {        XIo_Out32(InstancePtr->RegBaseAddress + XUL_TX_FIFO_OFFSET,                  InstancePtr->SendBuffer.NextBytePtr[SentCount]);        SentCount++;        StatusRegister = XUartLite_mGetStatusReg(InstancePtr->RegBaseAddress);    }    /* Enter a critical region by disabling all the UART interrupts to allow     * this call to stop a previous operation that may be interrupt driven     */    StatusRegister = XUartLite_mGetStatusReg(InstancePtr->RegBaseAddress);    XIo_Out32(InstancePtr->RegBaseAddress + XUL_CONTROL_REG_OFFSET, 0);    /*     * Update the buffer to reflect the bytes that were sent from it     */    InstancePtr->SendBuffer.NextBytePtr += SentCount;    InstancePtr->SendBuffer.RemainingBytes -= SentCount;    /*     * Increment associated counters     */     InstancePtr->Stats.CharactersTransmitted += SentCount;    /* Restore the interrupt enable register to it's previous value such     * that the critical region is exited     */    StatusRegister &= XUL_CR_ENABLE_INTR;    XIo_Out32(InstancePtr->RegBaseAddress + XUL_CONTROL_REG_OFFSET, StatusRegister);    /*     * Return the number of bytes that were sent, althought they really were     * only put into the FIFO, not completely sent yet     */    return SentCount;}/****************************************************************************//**** This function receives a buffer that has been previously specified by setting* up the instance variables of the instance. This function is designed to be* an internal function for the XUartLite component such that it may be called* from a shell function that sets up the buffer or from an interrupt handler.** This function will attempt to receive a specified number of bytes of data* from the UART and store it into the specified buffer. This function is* designed for either polled or interrupt driven modes. It is non-blocking* such that it will return if there is no data has already received by the* UART.** In a polled mode, this function will only receive as much data as the UART* can buffer, either in the receiver or in the FIFO if present and enabled.* The application may need to call it repeatedly to receive a buffer. Polled* mode is the default mode of operation for the driver.** In interrupt mode, this function will start receiving and then the interrupt* handler of the driver will continue until the buffer has been received. A* callback function, as specified by the application, will be called to indicate* the completion of receiving the buffer or when any receive errors or timeouts* occur. Interrupt mode must be enabled using the SetOptions function.** @param    InstancePtr is a pointer to the XUartLite instance to be worked on.** @return** The number of bytes received.** @note** None.******************************************************************************/unsigned int XUartLite_ReceiveBuffer(XUartLite *InstancePtr){    Xuint8 StatusRegister;    unsigned int ReceivedCount = 0;    /* Loop until there is not more data buffered by the UART or the specified     * number of bytes is received     */    while (ReceivedCount < InstancePtr->ReceiveBuffer.RemainingBytes)    {        /* Read the Status Register to determine if there is any data in         * the receiver/FIFO         */        StatusRegister = XUartLite_mGetStatusReg(InstancePtr->RegBaseAddress);        /* If there is data ready to be removed, then put the next byte         * received into the specified buffer and update the stats to reflect         * any receive errors for the byte         */        if (StatusRegister & XUL_SR_RX_FIFO_VALID_DATA)        {            InstancePtr->ReceiveBuffer.NextBytePtr[ReceivedCount++] =                XIo_In32(InstancePtr->RegBaseAddress + XUL_RX_FIFO_OFFSET);            XUartLite_mUpdateStats(InstancePtr, StatusRegister);        }        /* There's no more data buffered, so exit such that this function does         * not block waiting for data         */        else        {            break;        }    }    /* Enter a critical region by disabling all the UART interrupts to allow     * this call to stop a previous operation that may be interrupt driven     */    StatusRegister = XUartLite_mGetStatusReg(InstancePtr->RegBaseAddress);    XIo_Out32(InstancePtr->RegBaseAddress + XUL_CONTROL_REG_OFFSET, 0);    /* Update the receive buffer to reflect the number of bytes that was     * received     */    InstancePtr->ReceiveBuffer.NextBytePtr += ReceivedCount;    InstancePtr->ReceiveBuffer.RemainingBytes -= ReceivedCount;    /*     * Increment associated counters in the statistics     */    InstancePtr->Stats.CharactersReceived += ReceivedCount;    /* Restore the interrupt enable register to it's previous value such     * that the critical region is exited     */    StatusRegister &= XUL_CR_ENABLE_INTR;    XIo_Out32(InstancePtr->RegBaseAddress + XUL_CONTROL_REG_OFFSET, StatusRegister);    return ReceivedCount;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色素色在线综合| 精品99一区二区三区| 国产精品久久久久桃色tv| 精品一区二区三区免费观看| 欧美日韩精品一区视频| 三级在线观看一区二区| 欧美精品乱人伦久久久久久| 亚洲主播在线播放| 欧美在线一区二区| 天堂va蜜桃一区二区三区| 欧美三级电影网站| 日韩va欧美va亚洲va久久| 欧美精品乱人伦久久久久久| 九九在线精品视频| 久久―日本道色综合久久| 国产激情精品久久久第一区二区| 欧美日韩亚洲丝袜制服| 奇米在线7777在线精品| 欧美不卡一区二区三区四区| 韩国精品一区二区| 一区二区三区产品免费精品久久75| 色av成人天堂桃色av| 亚洲福利一二三区| 在线播放国产精品二区一二区四区 | 奇米精品一区二区三区四区| 久久综合九色综合欧美就去吻| 久久99久久99小草精品免视看| 久久先锋资源网| 99re热视频这里只精品| 亚洲一区中文日韩| 91精品黄色片免费大全| 日韩不卡一区二区| 国产免费久久精品| 在线观看欧美日本| 日韩精品久久久久久| 久久精品夜夜夜夜久久| 91免费视频大全| 免费成人结看片| 亚洲色图一区二区三区| 欧美日本一区二区三区四区| 国产又粗又猛又爽又黄91精品| 亚洲毛片av在线| 日韩限制级电影在线观看| thepron国产精品| 免费成人av在线| 最新高清无码专区| 日韩一级免费一区| 一本一道综合狠狠老| 麻豆精品一二三| 亚洲乱码中文字幕综合| 欧美激情资源网| 欧美日韩国产一二三| 国产福利不卡视频| 一区在线观看免费| 欧美成人性福生活免费看| 一本久道中文字幕精品亚洲嫩| 美女爽到高潮91| 伊人色综合久久天天| 久久老女人爱爱| 日韩欧美国产一区二区在线播放| 色综合天天在线| 韩国一区二区三区| 免费在线观看视频一区| 亚洲在线视频网站| 国产精品对白交换视频 | 欧美日韩久久久| 成人av电影观看| 国产91精品精华液一区二区三区 | 久久嫩草精品久久久精品| av中文字幕在线不卡| 国产成a人亚洲| 久久99国产精品麻豆| 午夜a成v人精品| 亚洲综合在线第一页| 国产精品素人视频| 中文字幕一区二区不卡| 26uuu亚洲| 日韩欧美一区电影| 日韩欧美一卡二卡| 日韩一二三四区| 欧美日本一道本在线视频| 欧美色图激情小说| 欧美日韩精品欧美日韩精品 | 亚洲一区二区3| 午夜视频在线观看一区二区| 成人欧美一区二区三区白人| 亚洲精品在线电影| 久久一日本道色综合| 日韩视频永久免费| 日韩视频免费观看高清完整版 | 成人自拍视频在线观看| 国产精品影音先锋| 国产成a人亚洲| 成人免费黄色大片| 福利91精品一区二区三区| 成人深夜福利app| 国产精品88av| 国产成人精品aa毛片| 97se亚洲国产综合自在线观| 99视频一区二区| 99免费精品在线观看| 在线日韩一区二区| 成人免费看片app下载| 成人午夜激情在线| 欧美自拍丝袜亚洲| 欧美精品1区2区| 欧美一级高清片| 国产欧美视频在线观看| 亚洲国产精品激情在线观看| 亚洲国产电影在线观看| 亚洲精品一卡二卡| 亚洲丰满少妇videoshd| 日本怡春院一区二区| 精品午夜一区二区三区在线观看| 蜜桃视频第一区免费观看| 极品少妇xxxx偷拍精品少妇| 99精品视频在线免费观看| 在线视频欧美区| 在线观看91精品国产麻豆| 国产午夜一区二区三区| 亚洲精品中文在线观看| 日韩成人免费看| 成人av网站免费| 欧美亚洲国产bt| 日韩视频国产视频| 亚洲精品少妇30p| 蜜桃久久久久久久| 精品一区二区三区影院在线午夜 | 另类小说图片综合网| 国产精品亚洲午夜一区二区三区| 免费在线观看成人| 色就色 综合激情| 26uuu亚洲综合色欧美| 亚洲色图欧美偷拍| 精品一区二区免费在线观看| 成人av网址在线观看| 3d动漫精品啪啪| 亚洲女同ⅹxx女同tv| 久久精品国产亚洲a| 欧美性受极品xxxx喷水| 国产亚洲短视频| 爽好多水快深点欧美视频| 99久久综合精品| 日韩欧美二区三区| 一区二区三区在线看| 国产福利一区二区三区视频| 欧美日韩黄色一区二区| 国产精品区一区二区三区| 日韩和欧美的一区| 91女人视频在线观看| 精品999久久久| 秋霞电影网一区二区| 91福利精品第一导航| 亚洲欧洲精品一区二区三区不卡 | 色婷婷久久久久swag精品| 久久久噜噜噜久久人人看 | 亚洲欧美aⅴ...| av电影在线观看一区| 精品久久五月天| 亚洲欧洲av一区二区三区久久| 天天操天天干天天综合网| 欧美亚洲另类激情小说| 18欧美乱大交hd1984| 激情综合亚洲精品| 777午夜精品视频在线播放| 亚洲精品久久久久久国产精华液| 国产精品国产成人国产三级| 视频在线在亚洲| 欧美三级三级三级爽爽爽| 亚洲人精品午夜| 91麻豆6部合集magnet| 国产欧美日本一区视频| 久草这里只有精品视频| 欧美男女性生活在线直播观看| 亚洲国产欧美一区二区三区丁香婷| 成人免费看黄yyy456| 欧美国产综合一区二区| 不卡区在线中文字幕| 欧美韩国日本综合| 美腿丝袜亚洲一区| 欧美日本国产视频| 亚洲成人www| 色婷婷av久久久久久久| 亚洲乱码中文字幕| 成人福利视频在线| 国产精品久久夜| youjizz国产精品| 久久久蜜桃精品| 粉嫩在线一区二区三区视频| 欧美sm极限捆绑bd| 国内成人精品2018免费看| 久久亚洲欧美国产精品乐播 | 97久久精品人人爽人人爽蜜臀 | 高清不卡在线观看| 中文字幕第一区综合| bt7086福利一区国产| 一区二区三区精品久久久| 欧美喷水一区二区| 狠狠色狠狠色综合日日91app| 久久综合色天天久久综合图片|