亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲福利视频三区| 欧美成人a视频| 日日欢夜夜爽一区| 久久精品欧美一区二区三区不卡 | 成人性色生活片免费看爆迷你毛片| 综合分类小说区另类春色亚洲小说欧美| 欧美另类一区二区三区| 国产白丝网站精品污在线入口| 亚洲gay无套男同| 国产精品无人区| 精品国产伦一区二区三区观看方式 | 欧美一级日韩不卡播放免费| eeuss鲁片一区二区三区在线看| 蜜桃av一区二区| 一区二区三区在线播| 国产喂奶挤奶一区二区三区| 91精品国产综合久久国产大片| 在线看国产日韩| 国内久久婷婷综合| 国产一区二区三区免费播放| 亚洲一区av在线| 狠狠色伊人亚洲综合成人| 91精品国产91久久久久久最新毛片 | 精品理论电影在线| 手机精品视频在线观看| 日韩一级黄色大片| 国产麻豆9l精品三级站| 美女视频第一区二区三区免费观看网站| 欧美极品aⅴ影院| 久久久精品国产免大香伊 | 成人永久aaa| 国产精品一区2区| 麻豆91免费观看| 日韩1区2区日韩1区2区| 粉嫩aⅴ一区二区三区四区| 一区二区三区av电影| 欧美精品日韩一区| 欧美日韩国产中文| 在线观看国产一区二区| 91小宝寻花一区二区三区| 成人的网站免费观看| 国产福利一区二区三区视频| 狠狠色2019综合网| 久久成人av少妇免费| 毛片av一区二区| 久88久久88久久久| 精品在线你懂的| 国产一区在线视频| 国模娜娜一区二区三区| 国产一级精品在线| 成人久久18免费网站麻豆| 国产成人在线影院| gogogo免费视频观看亚洲一| av成人老司机| 在线免费观看成人短视频| 欧美日韩夫妻久久| 久久久久久**毛片大全| 26uuu欧美| 中文字幕av一区二区三区 | 亚洲成人在线免费| 亚洲一区二区不卡免费| 美女网站色91| 国产一区 二区| 丁香桃色午夜亚洲一区二区三区| 成人免费毛片高清视频| 色诱视频网站一区| 欧美日韩国产一级片| 欧美成人一级视频| 国产欧美一区二区精品性色超碰| 亚洲色图欧美偷拍| 午夜视频在线观看一区| 久久99国产精品免费| 国产成人av电影在线观看| 91亚洲男人天堂| 欧美一区二区私人影院日本| 久久―日本道色综合久久| 亚洲丝袜美腿综合| 视频一区在线视频| 国产成人在线视频网址| 欧美中文一区二区三区| 久久免费视频一区| 亚洲精品欧美专区| 国产伦理精品不卡| 91精品福利视频| 欧美一区二区三区四区久久| 久久久久久一级片| 亚洲国产裸拍裸体视频在线观看乱了 | 久久午夜电影网| 亚洲欧美另类图片小说| 另类欧美日韩国产在线| 91美女视频网站| 日韩一区二区免费在线电影| 中文字幕色av一区二区三区| 日韩高清一区二区| 成人一级黄色片| 7777女厕盗摄久久久| 国产精品―色哟哟| 日韩电影免费在线| 99国内精品久久| 亚洲精品在线电影| 亚洲成人动漫精品| 97se亚洲国产综合自在线不卡| 日韩欧美第一区| 亚洲美女免费视频| 国产91色综合久久免费分享| 在线观看91精品国产麻豆| 亚洲欧洲一区二区在线播放| 韩国成人福利片在线播放| 欧美日韩另类一区| 中文字幕欧美一| 国产一区二区在线看| 91精品午夜视频| 一区二区久久久久久| 成人性色生活片| 国产亚洲精品免费| 美国精品在线观看| 91精品婷婷国产综合久久竹菊| 亚洲精选视频在线| 成人激情av网| 久久精品视频免费观看| 狠狠色丁香久久婷婷综合丁香| 日韩欧美国产1| 日韩专区一卡二卡| 欧美日韩国产欧美日美国产精品| 悠悠色在线精品| 99久久精品99国产精品| 国产精品久久久久aaaa| 国产宾馆实践打屁股91| 国产欧美中文在线| 国产剧情一区在线| 久久天天做天天爱综合色| 久久不见久久见中文字幕免费| 欧美丰满嫩嫩电影| 视频一区在线播放| 欧美一级日韩免费不卡| 美女看a上一区| 日韩视频一区二区| 老司机免费视频一区二区三区| 91精品国产91久久久久久最新毛片| 婷婷国产在线综合| 51精品视频一区二区三区| 日韩综合一区二区| 亚洲图片欧美综合| 在线观看一区二区视频| 国产欧美一区二区三区鸳鸯浴| 国内精品视频666| 久久久久久久综合| 成人黄页在线观看| 亚洲品质自拍视频| 欧美日韩一区在线| 免费在线观看一区| 精品日韩在线观看| 国产福利视频一区二区三区| 国产嫩草影院久久久久| 91原创在线视频| 偷拍亚洲欧洲综合| 日韩欧美自拍偷拍| 高清shemale亚洲人妖| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 成人h动漫精品| 亚洲一二三四区不卡| 日韩一级大片在线| 国产成人av电影在线观看| 亚洲免费看黄网站| 欧美一级久久久久久久大片| 国产伦理精品不卡| 亚洲在线成人精品| 日韩精品一区二区在线观看| 国产精品66部| 亚洲一二三区不卡| 欧美成人女星排名| 91在线一区二区| 日韩激情av在线| 国产精品美女久久久久久久 | 成人污污视频在线观看| 亚洲国产欧美另类丝袜| 久久久久久电影| 欧美色涩在线第一页| 韩国三级中文字幕hd久久精品| 国产精品福利一区二区三区| 欧美日韩国产综合草草| 高潮精品一区videoshd| 一区二区三区国产| 成人妖精视频yjsp地址| 欧美亚洲免费在线一区| 国产91精品久久久久久久网曝门| 国产精品午夜久久| 97久久精品人人做人人爽50路| 日韩中文字幕不卡| 国产日产精品一区| 欧美绝品在线观看成人午夜影视| 国产高清视频一区| 图片区日韩欧美亚洲| 国产精品狼人久久影院观看方式| 欧美丰满少妇xxxbbb| aa级大片欧美| 国产自产v一区二区三区c| 亚洲图片自拍偷拍| 国产精品久久夜| 欧美r级在线观看|