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

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

?? xuartlite.c

?? 關于xilinx大學計劃配需教程實驗五源代碼
?? 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一区二区三区免费野_久草精品视频
欧美午夜免费电影| 国产suv精品一区二区6| 日本精品一区二区三区高清| 亚洲一区二区在线观看视频 | 99国产精品久| 亚洲不卡av一区二区三区| 精品国产伦一区二区三区观看方式| 国产福利一区二区三区在线视频| 亚洲免费观看高清完整版在线观看 | 免费在线观看日韩欧美| 91精品久久久久久久久99蜜臂| 免费看黄色91| 蓝色福利精品导航| 亚洲日本丝袜连裤袜办公室| 正在播放亚洲一区| 日韩午夜三级在线| 在线一区二区视频| 欧美美女直播网站| 麻豆成人免费电影| 亚洲午夜在线视频| 亚洲欧洲国产日韩| 久久久99精品免费观看不卡| 欧美亚洲高清一区| 欧美精品久久久久久久多人混战 | www.激情成人| 国内精品自线一区二区三区视频| 有码一区二区三区| 国产精品拍天天在线| 7777精品伊人久久久大香线蕉的| 91精品免费在线| 亚洲精品一区二区三区四区高清| 国产色91在线| 亚洲不卡一区二区三区| 国产综合色在线视频区| av电影一区二区| 欧美日韩极品在线观看一区| 久久免费美女视频| xf在线a精品一区二区视频网站| 欧美日韩国产影片| 久久久久久久久一| 亚洲综合免费观看高清完整版在线| 日韩精品欧美精品| 日日摸夜夜添夜夜添精品视频| 免费高清在线视频一区·| 盗摄精品av一区二区三区| 亚洲伦理在线精品| 另类小说欧美激情| 色一情一乱一乱一91av| 国产精品18久久久久久vr| 日本一区中文字幕| 日本中文字幕不卡| 91精品办公室少妇高潮对白| 久久天天做天天爱综合色| 亚洲女人小视频在线观看| 免费久久99精品国产| 在线视频观看一区| 在线观看成人免费视频| 久久亚洲精品国产精品紫薇| 三级影片在线观看欧美日韩一区二区| 国产成人av福利| 精品久久久久一区二区国产| 久久精品一区蜜桃臀影院| 天堂va蜜桃一区二区三区| 在线亚洲高清视频| 亚洲免费视频中文字幕| 成人免费视频国产在线观看| 久久综合色一综合色88| 日韩不卡一二三区| 色老头久久综合| 亚洲人成在线播放网站岛国| 国产高清不卡二三区| 国产视频在线观看一区二区三区 | 国产精品国产馆在线真实露脸| 国产精品视频观看| 国产精品影视网| 久久久久免费观看| 国产成人一区在线| 精品国产伦一区二区三区观看方式 | 看片网站欧美日韩| 欧美理论在线播放| 日韩成人av影视| 欧美一区二区高清| 国产精品久久久久三级| 成人久久视频在线观看| 国产精品国产自产拍在线| 91麻豆免费观看| 精品国产一区二区精华| 麻豆一区二区99久久久久| 日韩精品综合一本久道在线视频| 国产精品伦一区| 91视频com| 亚洲一区二区精品久久av| 欧美网站大全在线观看| 天天色图综合网| 成人a级免费电影| 欧美精品一区在线观看| 国产一区二区精品久久91| 欧美电影影音先锋| 蜜臀av一级做a爰片久久| 2023国产一二三区日本精品2022| 国产精品小仙女| 中文字幕色av一区二区三区| 欧美熟乱第一页| 麻豆精品久久久| 欧美激情在线看| 亚洲色图欧美激情| 欧美视频精品在线| 国产在线麻豆精品观看| 国产精品久久久久久久岛一牛影视| 色激情天天射综合网| 美洲天堂一区二卡三卡四卡视频| 久久午夜老司机| 色哟哟亚洲精品| 激情五月婷婷综合网| 日韩理论片网站| 日韩精品一区二区三区视频在线观看| 国产一区二区三区电影在线观看 | 麻豆成人久久精品二区三区红 | 欧美日韩国产片| 国产不卡在线视频| 午夜激情综合网| 国产欧美一二三区| 免费视频一区二区| 国产精品国产三级国产aⅴ入口| 欧美精品久久一区二区三区| 91香蕉视频在线| 国产综合色在线视频区| 天天综合色天天综合| 亚洲女人****多毛耸耸8| 精品国产一区二区三区av性色| 欧美系列一区二区| 成人97人人超碰人人99| 国产最新精品免费| 美女精品自拍一二三四| 一区二区激情视频| 5858s免费视频成人| 99视频精品在线| 国产成人福利片| 人人超碰91尤物精品国产| 亚洲制服欧美中文字幕中文字幕| 国产精品欧美经典| 精品播放一区二区| 日韩欧美自拍偷拍| 欧美日韩免费电影| 欧美日韩一级二级| 久久国产三级精品| 丝袜美腿成人在线| 亚洲成人1区2区| 亚洲国产视频a| 亚洲视频网在线直播| 国产精品毛片高清在线完整版| 国产亚洲欧美激情| 国产亚洲视频系列| 国产午夜亚洲精品不卡| 久久精品人人做人人爽人人| 欧美刺激午夜性久久久久久久| 欧美丰满嫩嫩电影| 日韩视频免费观看高清完整版在线观看| 欧美日韩综合一区| 欧美久久久久久蜜桃| 欧美精品视频www在线观看| 91.xcao| 日韩一级免费观看| 日韩欧美的一区| 欧美精品一区视频| 中文字幕欧美国产| 亚洲欧美日韩国产综合| 亚洲乱码日产精品bd| 亚洲高清不卡在线观看| 亚洲3atv精品一区二区三区| 午夜成人在线视频| 九九精品一区二区| 亚洲一区日韩精品中文字幕| 亚洲综合激情网| 日本不卡一区二区三区高清视频| 麻豆精品新av中文字幕| 懂色av一区二区三区免费观看| 成人99免费视频| 欧美人妇做爰xxxⅹ性高电影 | 久久久精品国产99久久精品芒果| 欧美精品一区二区久久婷婷| 久久久久青草大香线综合精品| 中文字幕一区不卡| 偷窥少妇高潮呻吟av久久免费| 免费一级欧美片在线观看| 国产91高潮流白浆在线麻豆| 色婷婷久久99综合精品jk白丝| 欧美精品久久久久久久多人混战| 26uuu国产在线精品一区二区| 亚洲欧美自拍偷拍| 蜜臀精品一区二区三区在线观看| www.亚洲精品| 欧美一级久久久| 成人免费一区二区三区在线观看| 偷拍自拍另类欧美| 成人99免费视频| 亚洲精品一区二区三区影院| 亚洲精品成人天堂一二三| 狠狠色丁香九九婷婷综合五月| 色素色在线综合|