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

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

?? xuartlite.c

?? 本程序用xilinx EDK9.1運行
?? 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一区二区三区免费野_久草精品视频
6080午夜不卡| 成人av免费在线| 成人黄色小视频在线观看| 色系网站成人免费| 日韩欧美激情一区| 一区二区三区资源| 国内偷窥港台综合视频在线播放| 99久久免费视频.com| 欧美电影一区二区| 国产亚洲欧美日韩俺去了| 亚洲国产裸拍裸体视频在线观看乱了 | 日韩中文字幕一区二区三区| 国产一区 二区| 欧美精品免费视频| 中文字幕日韩一区二区| 蜜臀av性久久久久蜜臀aⅴ流畅| 成人午夜在线免费| 日韩欧美视频一区| 亚洲国产日产av| av成人免费在线| 2023国产精品| 日韩精品欧美成人高清一区二区| 国产99久久久国产精品免费看| 欧美综合天天夜夜久久| 国产精品私人自拍| 久久爱www久久做| 精品视频一区三区九区| 日韩毛片视频在线看| 韩国成人福利片在线播放| 在线不卡的av| 亚洲最大的成人av| 成人激情开心网| 久久毛片高清国产| 久久国产尿小便嘘嘘尿| 欧美日韩一区二区三区四区五区| 中文字幕字幕中文在线中不卡视频| 韩国午夜理伦三级不卡影院| 91精品国产色综合久久不卡蜜臀 | 欧美在线看片a免费观看| 国产亚洲一二三区| 精品制服美女丁香| 日韩午夜在线观看视频| 日韩中文字幕亚洲一区二区va在线| 欧美综合一区二区| 一区二区三区丝袜| 色视频欧美一区二区三区| 1000部国产精品成人观看| 成人av在线网站| 亚洲国产精品二十页| 国产91精品精华液一区二区三区| 久久久美女艺术照精彩视频福利播放| 久久国产福利国产秒拍| 日韩精品一区二区三区四区视频| 人人狠狠综合久久亚洲| 91精品欧美福利在线观看| 三级成人在线视频| 这里只有精品99re| 免费观看在线色综合| 日韩欧美色电影| 激情综合五月天| www久久久久| 国产精品亚洲а∨天堂免在线| 久久久久久久久久久久久夜| 国产乱对白刺激视频不卡| 国产日韩欧美不卡在线| 成人国产精品视频| 国产精品电影一区二区| 91蝌蚪porny成人天涯| 最新国产成人在线观看| 欧日韩精品视频| 一区二区三区四区中文字幕| 欧美性极品少妇| 调教+趴+乳夹+国产+精品| 欧美一级生活片| 日韩av在线播放中文字幕| 精品国产青草久久久久福利| 国产尤物一区二区在线| 国产精品亲子伦对白| 色嗨嗨av一区二区三区| 日韩制服丝袜av| 精品国产乱码久久久久久牛牛 | 国产拍欧美日韩视频二区| 成人av网址在线| 国产精品美女一区二区在线观看| 高清国产一区二区| 综合电影一区二区三区 | 亚洲国产综合色| 欧美一级高清大全免费观看| 激情六月婷婷久久| 国产精品久久久久一区二区三区共 | 亚洲精品一区在线观看| 成人亚洲一区二区一| 一区二区视频在线| 欧美精品色一区二区三区| 美女免费视频一区二区| 久久精品人人做人人爽人人| 国产精品亚洲а∨天堂免在线| 午夜精品成人在线| 久久综合成人精品亚洲另类欧美| 99视频精品在线| 午夜视频一区二区| 久久久一区二区三区| 日本电影欧美片| 婷婷一区二区三区| 久久九九国产精品| 欧美视频一区二区三区四区| 久久精品国产亚洲aⅴ| 亚洲欧洲一区二区在线播放| 91精品久久久久久久99蜜桃| 国产91对白在线观看九色| 亚洲成在人线免费| 国产日韩av一区二区| 欧美日韩高清不卡| 国产成人av福利| 无吗不卡中文字幕| 欧美国产精品劲爆| 正在播放亚洲一区| 91性感美女视频| 国产一区二区三区免费播放| 一区二区视频在线看| 国产视频在线观看一区二区三区| 欧美性大战久久| 成人午夜碰碰视频| 日韩电影在线看| 亚洲欧洲精品一区二区三区 | 国产精品99久久久久久有的能看 | 日韩精品最新网址| 色婷婷综合久久久久中文 | 国产精品嫩草99a| 欧美一卡2卡3卡4卡| 91高清视频在线| 国产aⅴ综合色| 久久精品国产色蜜蜜麻豆| 亚洲国产裸拍裸体视频在线观看乱了 | 亚洲综合一区二区| 久久久精品免费网站| 欧美一卡在线观看| 欧美三级视频在线| 不卡影院免费观看| 国产一区二区三区精品欧美日韩一区二区三区| 一区二区高清在线| 国产精品久久久久精k8| 久久―日本道色综合久久| 欧美一区二区三区免费在线看 | 另类小说视频一区二区| 亚洲国产精品一区二区久久| 亚洲欧洲日韩综合一区二区| 一区二区高清免费观看影视大全 | 亚洲视频 欧洲视频| 精品久久久久久亚洲综合网| 欧美日韩一区二区三区在线| 99re热视频精品| 成人免费观看av| 成人激情小说乱人伦| 国产高清不卡二三区| 久久国产综合精品| 亚洲成人免费av| 亚洲欧洲另类国产综合| 精品少妇一区二区三区日产乱码 | 国产传媒一区在线| 精品制服美女久久| 美女网站色91| 男女性色大片免费观看一区二区| 亚洲6080在线| 亚洲成人久久影院| 亚洲图片欧美色图| 亚洲国产wwwccc36天堂| 亚洲成人免费在线| 五月婷婷综合网| 天堂精品中文字幕在线| 三级亚洲高清视频| 青青草原综合久久大伊人精品优势| 五月婷婷综合激情| 热久久久久久久| 美脚の诱脚舐め脚责91| 免费成人小视频| 国产一区二区不卡在线| 成人福利在线看| 色欧美片视频在线观看| 欧美精品v国产精品v日韩精品| 日韩免费高清av| 久久精品人人做| 亚洲激情六月丁香| 日韩激情视频网站| 国产高清成人在线| 色综合av在线| 欧美一区二区三区在| 国产欧美精品一区| 亚洲免费观看高清完整| 天堂在线亚洲视频| 国产suv一区二区三区88区| 色婷婷国产精品综合在线观看| 欧美日韩日日夜夜| 国产偷v国产偷v亚洲高清| 一区二区三区在线看| 久久电影国产免费久久电影| 成人免费电影视频| 欧美男同性恋视频网站| 国产欧美日本一区二区三区| 亚洲国产中文字幕在线视频综合|