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

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

?? xuartlite.c

?? 關于xilinx大學計劃配需教程實驗五源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Id: xuartlite.c,v 1.3 2006/05/08 22:27:40 wyang Exp $ *//*******************************************************************************       XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"*       AS A COURTESY TO YOU, SOLELY FOR USE IN DEVELOPING PROGRAMS AND*       SOLUTIONS FOR XILINX DEVICES.  BY PROVIDING THIS DESIGN, CODE,*       OR INFORMATION AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE,*       APPLICATION OR STANDARD, XILINX IS MAKING NO REPRESENTATION*       THAT THIS IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,*       AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE*       FOR YOUR IMPLEMENTATION.  XILINX EXPRESSLY DISCLAIMS ANY*       WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE*       IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR*       REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF*       INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS*       FOR A PARTICULAR PURPOSE.**       (c) Copyright 2002-2005 Xilinx Inc.*       All rights reserved.******************************************************************************//****************************************************************************//**** @file xuartlite.c** Contains required functions for the XUartLite driver. See the xuartlite.h* header file for more details on this driver.** <pre>* MODIFICATION HISTORY:** Ver   Who  Date     Changes* ----- ---- -------- -----------------------------------------------* 1.00a ecm  08/31/01 First release* 1.00b jhl  02/21/02 Repartitioned the driver for smaller files* 1.00b rmm  05/13/03 Fixed diab compiler warnings relating to asserts* 1.01a jvb  12/13/05 I changed Initialize() into CfgInitialize(), and made*                     CfgInitialize() take a pointer to a config structure*                     instead of a device id. I moved Initialize() into*                     xgpio_sinit.c, and had Initialize() call CfgInitialize()*                     after it retrieved the config structure using the device*                     id. I removed include of xparameters.h along with any*                     dependencies on xparameters.h and the _g.c config table.* 1.01a wsy  05/08/06 fix CR220811 and CR224103.** </pre>******************************************************************************//***************************** Include Files ********************************/#include "xbasic_types.h"#include "xstatus.h"#include "xuartlite.h"#include "xuartlite_i.h"#include "xio.h"/************************** Constant Definitions ****************************//**************************** Type Definitions ******************************//***************** Macros (Inline Functions) Definitions ********************//************************** Variable Definitions ****************************//************************** Function Prototypes *****************************/static void StubHandler(void *CallBackRef, unsigned int ByteCount);/****************************************************************************//**** Initialize a XUartLite instance.  The receive and transmit FIFOs of the* UART are not flushed, so the user may want to flush them. The hardware* device does not have any way to disable the receiver such that any valid* data may be present in the receive FIFO.  This function disables the UART* interrupt. The baudrate and format of the data are fixed in the hardware* at hardware build time.** @param InstancePtr is a pointer to the XUartLite instance to be worked on.* @param Config is a reference to a structure containing information about*        a specific UART Lite device. This function initializes an*        InstancePtr object for a specific device specified by the contents*        of Config. This function can initialize multiple instance objects*        with the use of multiple calls giving different Config information*        on each call.* @param EffectiveAddr is the device base address in the virtual memory address*        space. The caller is responsible for keeping the address mapping*        from EffectiveAddr to the device physical base address unchanged*        once this function is invoked. Unexpected errors may occur if the*        address mapping changes after this function is called. If address*        translation is not used, use Config->BaseAddress for this parameters,*        passing the physical address instead.** @return** - XST_SUCCESS if everything starts up as expected.** @note** The Config pointer argument is not used by this function, but is provided* to keep the function signature consistent with other drivers.******************************************************************************/XStatus XUartLite_CfgInitialize(XUartLite *InstancePtr, XUartLite_Config *Config,                                Xuint32 EffectiveAddr){    /*     * Assert validates the input arguments     */    XASSERT_NONVOID(InstancePtr != XNULL);    /*     * Set some default values, including setting the callback     * handlers to stubs.     */    InstancePtr->SendBuffer.NextBytePtr = XNULL;    InstancePtr->SendBuffer.RemainingBytes = 0;    InstancePtr->SendBuffer.RequestedBytes = 0;    InstancePtr->ReceiveBuffer.NextBytePtr = XNULL;    InstancePtr->ReceiveBuffer.RemainingBytes = 0;    InstancePtr->ReceiveBuffer.RequestedBytes = 0;    InstancePtr->IsReady = XCOMPONENT_IS_READY;    InstancePtr->RegBaseAddress = EffectiveAddr;    InstancePtr->RecvHandler = StubHandler;    InstancePtr->SendHandler = StubHandler;    /* Write to the control register to disable the interrupts, don't     * reset the FIFOs are the user may want the data that's present     */    XIo_Out32(InstancePtr->RegBaseAddress + XUL_CONTROL_REG_OFFSET, 0);    /*     * Clear the statistics for this driver     */    XUartLite_mClearStats(InstancePtr);    return XST_SUCCESS;}/****************************************************************************//**** This functions sends the specified buffer of data using 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. If the UART is busy* sending data, it will return and indicate zero bytes were sent.** In a polled mode, this function will only send as much data as the UART can* buffer in the FIFO. 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 sending data 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.* @param    BufferPtr is pointer to a buffer of data to be sent.* @param    NumBytes contains the number of bytes to be sent. A value of zero*           will stop a previous send operation that is in progress in interrupt*           mode. Any data that was already put into the transmit FIFO will be*           sent.** @return** The number of bytes actually sent.** @note** The number of bytes is not asserted so that this function may be called with* a value of zero to stop an operation that is already in progress.*******************************************************************************/unsigned int XUartLite_Send(XUartLite *InstancePtr, Xuint8 *DataBufferPtr,                            unsigned int NumBytes){    unsigned int BytesSent;    Xuint32 StatusRegister;    /*     * Assert validates the input arguments     */    XASSERT_NONVOID(InstancePtr != XNULL);    XASSERT_NONVOID(DataBufferPtr != XNULL);    XASSERT_NONVOID(InstancePtr->IsReady == XCOMPONENT_IS_READY);    XASSERT_NONVOID(((signed)NumBytes) >= 0);    /* Enter a critical region by disabling 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);    /* Setup the specified buffer to be sent by setting the instance     * variables so it can be sent with polled or interrupt mode     */    InstancePtr->SendBuffer.RequestedBytes = NumBytes;    InstancePtr->SendBuffer.RemainingBytes = NumBytes;    InstancePtr->SendBuffer.NextBytePtr = DataBufferPtr;    /* Restore the interrupt enable register to it's previous value such     * that the critical region is exited.     * This is done here to minimize the amount of time the interrupt is     * disabled since there is only one interrupt and the receive could     * be filling up while interrupts are blocked.     */    StatusRegister &= XUL_CR_ENABLE_INTR;    XIo_Out32(InstancePtr->RegBaseAddress + XUL_CONTROL_REG_OFFSET, StatusRegister);    /* Send the buffer using the UART and return the number of bytes sent */    BytesSent = XUartLite_SendBuffer(InstancePtr);    return BytesSent;}/****************************************************************************//**** 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 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 in the FIFO. 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 receiving data 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.* @param    BufferPtr is pointer to buffer for data to be received into* @param    NumBytes is the number of bytes to be received. A value of zero will*           stop a previous receive operation that is in progress in interrupt mode.** @return** The number of bytes received.** @note** The number of bytes is not asserted so that this function may be called with* a value of zero to stop an operation that is already in progress.******************************************************************************/unsigned int XUartLite_Recv(XUartLite *InstancePtr, Xuint8 *DataBufferPtr,                            unsigned int NumBytes){    unsigned int ReceivedCount;    Xuint32 StatusRegister;    /*     * Assert validates the input arguments     */    XASSERT_NONVOID(InstancePtr != XNULL);    XASSERT_NONVOID(DataBufferPtr != XNULL);    XASSERT_NONVOID(InstancePtr->IsReady == XCOMPONENT_IS_READY);    XASSERT_NONVOID(((signed)NumBytes) >= 0);    /* 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);    /* Setup the specified buffer to be received by setting the instance     * variables so it can be received with polled or interrupt mode     */    InstancePtr->ReceiveBuffer.RequestedBytes = NumBytes;    InstancePtr->ReceiveBuffer.RemainingBytes = NumBytes;    InstancePtr->ReceiveBuffer.NextBytePtr = DataBufferPtr;    /* 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);    /* Receive the data from the UART and return the number of bytes     * received     * This is done here to minimize the amount of time the interrupt is     * disabled since there is only one interrupt and the transmit could     * be emptying out while interrupts are blocked.     */    ReceivedCount = XUartLite_ReceiveBuffer(InstancePtr);    return ReceivedCount;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美另类久久久精品2019| 色欲综合视频天天天| 蜜臀va亚洲va欧美va天堂| 亚洲国产综合在线| 亚洲国产中文字幕在线视频综合| 亚洲激情图片一区| 亚洲精品日韩综合观看成人91| 中文字幕在线观看不卡| 1000部国产精品成人观看| 成人免费小视频| 亚洲综合丝袜美腿| 亚洲不卡av一区二区三区| 视频一区二区三区中文字幕| 日本午夜一区二区| 久久99蜜桃精品| 国产精品456露脸| 成人亚洲一区二区一| 99精品国产视频| 欧洲精品中文字幕| 欧美一区二区精品| 精品国产一区二区在线观看| 国产亚洲精品免费| 亚洲精品你懂的| 日韩主播视频在线| 国产一区二区精品久久91| 成人国产在线观看| 欧美色视频在线观看| 日韩精品一区二区三区视频| 日本一区免费视频| 一区二区三区四区不卡视频| 日韩有码一区二区三区| 韩国女主播一区| 99精品国产一区二区三区不卡| 欧美日韩一区二区三区在线 | 久久精品日韩一区二区三区| 国产清纯白嫩初高生在线观看91 | 亚洲mv在线观看| 精品一区二区三区蜜桃| 成人性生交大合| 欧美色综合网站| ww亚洲ww在线观看国产| 亚洲精品美国一| 激情综合色丁香一区二区| 不卡av电影在线播放| 欧美精品电影在线播放| 日本一二三不卡| 午夜精品一区二区三区免费视频 | 国产综合色视频| 91麻豆福利精品推荐| 欧美一区二区三区在线电影| 国产亚洲精品aa午夜观看| 亚洲国产精品一区二区尤物区| 极品少妇xxxx精品少妇偷拍 | 日韩一区二区三区在线视频| 久久久蜜臀国产一区二区| 一级日本不卡的影视| 国内精品伊人久久久久av影院| 91捆绑美女网站| 欧美成人精品高清在线播放| 一区二区三区日韩| 国产精品白丝av| 在线观看91av| 亚洲视频一区二区在线| 国产做a爰片久久毛片| 欧美卡1卡2卡| 亚洲日本成人在线观看| 国产在线精品国自产拍免费| 欧美精品在线观看一区二区| 国产精品久久久爽爽爽麻豆色哟哟| 日韩av电影天堂| 日本精品一区二区三区四区的功能| 精品精品国产高清a毛片牛牛| 一区二区三区在线视频观看| 丰满白嫩尤物一区二区| 日韩精品一区二区三区在线| 亚欧色一区w666天堂| 色婷婷一区二区| 亚洲欧洲色图综合| 成人在线视频一区二区| 精品国产乱码久久久久久牛牛 | 日日噜噜夜夜狠狠视频欧美人| 国产99久久精品| 精品国产亚洲在线| 免费欧美高清视频| 欧美日韩精品欧美日韩精品一| 亚洲色图在线播放| 成人蜜臀av电影| 国产亲近乱来精品视频 | 日韩欧美色综合网站| 亚洲永久免费av| 99精品欧美一区二区蜜桃免费 | 蜜桃视频一区二区三区| 欧美日韩一二三| 亚洲一区二区在线观看视频| 99re视频这里只有精品| 亚洲少妇中出一区| 91网站在线播放| 亚洲精品你懂的| 在线观看日韩高清av| 有码一区二区三区| 欧美午夜一区二区三区| 一区二区三区四区不卡视频 | 中文av一区二区| 成人午夜视频网站| 1000精品久久久久久久久| 99精品热视频| 亚洲一区二区三区不卡国产欧美| 日本二三区不卡| 亚洲综合免费观看高清完整版在线 | 色综合天天天天做夜夜夜夜做| 欧美国产一区二区在线观看| 国产一区二区三区在线观看精品| 精品国产91洋老外米糕| 国产毛片一区二区| 中文字幕巨乱亚洲| 色先锋资源久久综合| 亚洲免费在线看| 欧美日韩高清在线播放| 亚洲18色成人| 精品久久久久久最新网址| 精品写真视频在线观看| 国产视频一区二区在线| 成人丝袜18视频在线观看| 亚洲日本在线视频观看| 欧美三级一区二区| 日本在线不卡一区| 久久精品人人做人人爽人人| 99久久精品国产麻豆演员表| 一区二区视频在线看| 欧美二区三区91| 精品在线播放免费| 国产精品国产馆在线真实露脸| 欧美性视频一区二区三区| 日韩精品亚洲一区二区三区免费| 欧美一二三四区在线| 国产成人精品免费在线| 亚洲激情图片一区| 日韩欧美一级在线播放| 豆国产96在线|亚洲| 亚洲午夜羞羞片| 久久一区二区三区四区| 91欧美一区二区| 美女视频黄 久久| 国产精品国产三级国产aⅴ中文 | 欧美国产欧美综合| 在线免费观看视频一区| 久久av资源网| 自拍偷拍欧美精品| 日韩免费高清电影| 97精品电影院| 寂寞少妇一区二区三区| 一区二区三国产精华液| 精品久久人人做人人爽| 日本精品免费观看高清观看| 久久99国产精品久久| 亚洲天堂网中文字| 精品国产伦理网| 欧美吞精做爰啪啪高潮| 国产成人av一区二区三区在线| 亚洲一区二区三区小说| 国产视频视频一区| 91精品国产综合久久久蜜臀粉嫩| 成人免费毛片嘿嘿连载视频| 日本一区中文字幕| 亚洲欧美韩国综合色| 久久精品夜夜夜夜久久| 91麻豆精品国产| 91欧美一区二区| 国产v日产∨综合v精品视频| 天天av天天翘天天综合网色鬼国产| 国产精品色婷婷| 久久久三级国产网站| 日韩亚洲欧美在线| 欧美羞羞免费网站| 91在线观看视频| 成人黄色a**站在线观看| 精品亚洲成a人| 免费观看91视频大全| 亚洲一线二线三线视频| 国产精品美女久久久久久久网站| 日韩欧美高清dvd碟片| 欧美三日本三级三级在线播放| 成人深夜在线观看| 国产在线播放一区| 蜜桃在线一区二区三区| 午夜精品福利久久久| 一区二区日韩电影| 亚洲欧美日韩国产中文在线| 国产欧美一区二区三区鸳鸯浴| 精品久久久久99| 这里只有精品99re| 欧美女孩性生活视频| 欧美视频你懂的| 在线观看日韩高清av| 91一区二区在线观看| 91伊人久久大香线蕉| 色综合网站在线| 色噜噜久久综合| 在线观看成人免费视频| 欧美亚洲综合在线|