亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久综合九色综合久久久精品综合 | 久久伊人蜜桃av一区二区| 欧美xxxxxxxx| 亚洲老司机在线| 黄色小说综合网站| 欧美日韩午夜在线| 国产精品国产三级国产普通话三级 | 国产福利91精品一区| 欧美综合一区二区| 国产欧美日韩三级| 日日夜夜精品免费视频| 99天天综合性| 久久久久99精品一区| 午夜精品久久久久久久99樱桃| 成人福利视频网站| 久久久久久久久99精品| 视频一区中文字幕| 欧美无乱码久久久免费午夜一区| 国产视频一区不卡| 韩日欧美一区二区三区| 91精品久久久久久久久99蜜臂| 亚洲人成精品久久久久久| 国产精品资源站在线| 欧美一区日本一区韩国一区| 亚洲一区二区综合| av电影天堂一区二区在线观看| 欧美精品一区二区三区四区| 日本不卡在线视频| 欧美日韩mp4| 亚洲国产精品尤物yw在线观看| 色综合久久久久久久| 自拍av一区二区三区| 成人av网站在线观看| 国产色91在线| 成人免费精品视频| 国产精品九色蝌蚪自拍| 97国产精品videossex| 国产精品久久综合| 91社区在线播放| 一区二区三区四区乱视频| 91免费视频网| 亚洲自拍欧美精品| 欧美放荡的少妇| 青青草国产精品97视觉盛宴| 日韩亚洲欧美成人一区| 免费成人在线视频观看| 欧美精品一区二区久久婷婷 | 成人激情开心网| 亚洲摸摸操操av| 欧美在线免费播放| 日本中文在线一区| 精品国产亚洲在线| 不卡区在线中文字幕| 亚洲天堂精品在线观看| 欧美在线免费观看亚洲| 免费成人在线观看视频| 国产午夜精品久久| 色av成人天堂桃色av| 午夜精品福利一区二区蜜股av | 欧美视频一二三区| 日韩精品一二三四| 国产日韩欧美a| 欧美在线999| 精品在线亚洲视频| 亚洲欧洲精品一区二区三区| 欧美亚洲国产一卡| 国精产品一区一区三区mba视频 | 色综合视频在线观看| 亚洲第一二三四区| 精品国产乱码久久久久久图片| 成人av在线一区二区| 五月天婷婷综合| 国产女主播在线一区二区| 色综合久久久久网| 国产乱一区二区| 一区二区三区蜜桃网| 精品成人私密视频| 欧美性猛交xxxx乱大交退制版| 久久国产剧场电影| 亚洲综合成人在线| 欧美国产日韩一二三区| 6080日韩午夜伦伦午夜伦| 国产成人综合自拍| 毛片av中文字幕一区二区| 国产精品二三区| 欧美成人精品1314www| 91论坛在线播放| 高清免费成人av| 日韩av一区二区在线影视| 日韩一区欧美小说| 久久久久久久久岛国免费| 91精品国产91久久综合桃花| 91小视频免费看| 国产不卡在线一区| 欧美aⅴ一区二区三区视频| 亚洲乱码精品一二三四区日韩在线| 日韩小视频在线观看专区| 欧美性生活久久| 99视频在线精品| 丁香啪啪综合成人亚洲小说 | 色综合久久久久久久久| 国产成+人+日韩+欧美+亚洲| 久久99这里只有精品| 亚洲国产aⅴ成人精品无吗| 国产精品高清亚洲| 国产精品拍天天在线| 精品少妇一区二区三区免费观看| 欧美性猛交一区二区三区精品| 91日韩一区二区三区| 成人久久久精品乱码一区二区三区| 美女视频一区二区三区| 午夜精品福利一区二区三区av | 亚洲图片欧美激情| 国产精品视频看| 日本一区二区免费在线观看视频| 日韩女优av电影在线观看| 欧美精品vⅰdeose4hd| 欧美色视频在线观看| 欧美日韩国产经典色站一区二区三区| 99精品久久免费看蜜臀剧情介绍 | 国产一二三精品| 国产制服丝袜一区| 国产一区二区精品久久99| 狠狠狠色丁香婷婷综合激情| 国产在线播放一区| 国产高清在线观看免费不卡| 成人免费视频视频| a级精品国产片在线观看| 91色porny在线视频| 在线视频国内自拍亚洲视频| 91国产丝袜在线播放| 欧美精品日韩一本| 欧美电影免费观看高清完整版在| 日韩精品一区二区三区中文精品| 日韩一区二区精品| 久久综合久久综合久久综合| 国产欧美日韩三级| 亚洲国产另类精品专区| 日韩av电影天堂| 成人久久视频在线观看| 欧美天堂亚洲电影院在线播放| 日韩一区二区三区电影在线观看| 久久久国产综合精品女国产盗摄| 中文字幕精品三区| 亚洲一区av在线| 九九九久久久精品| 99精品视频一区二区三区| 欧美视频第二页| 欧美精品一区二区三区蜜桃视频| 欧美激情一区二区在线| 一级做a爱片久久| 免费看黄色91| 粉嫩在线一区二区三区视频| 色噜噜狠狠成人网p站| 欧美图片一区二区三区| 99久久综合狠狠综合久久| 不卡av在线免费观看| 色妹子一区二区| 在线看不卡av| 日韩欧美国产综合一区 | 久久精品夜色噜噜亚洲aⅴ| 国产精品乱码一区二区三区软件| 亚洲一区二区三区四区不卡| 麻豆精品在线播放| www.66久久| 56国语精品自产拍在线观看| 国产欧美日韩综合精品一区二区 | 亚洲国产成人高清精品| 久久不见久久见免费视频7| 色婷婷久久综合| 精品国产一区二区精华| 一区二区三区欧美| 麻豆一区二区在线| 欧美日韩成人激情| 亚洲国产精品成人综合| 亚洲va天堂va国产va久| 久久99九九99精品| 欧美午夜电影网| 中文一区在线播放| 日韩精品免费视频人成| 色综合一个色综合| 26uuu久久综合| 午夜精品福利视频网站| 高清国产一区二区| 久久久久久久久岛国免费| 午夜伊人狠狠久久| 91在线观看下载| 欧美精品v国产精品v日韩精品| 亚洲区小说区图片区qvod| 国内精品久久久久影院一蜜桃| 在线视频一区二区三区| 国产午夜精品在线观看| 秋霞影院一区二区| 欧美探花视频资源| 日韩毛片精品高清免费| 成人黄色在线网站| 国产亚洲自拍一区| 久久99久久久欧美国产| 精品少妇一区二区三区日产乱码 | 亚洲国产一区二区在线播放|