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

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

?? xuartlite.c

?? <基于fpga的嵌入式設計上的光盤的第四章第二個實驗
?? 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一区二区三区免费野_久草精品视频
亚洲免费大片在线观看| 久久影院视频免费| 亚洲国产精品视频| 日韩一区二区视频| 日本在线不卡视频| 精品嫩草影院久久| 久久精品噜噜噜成人av农村| 欧美理论片在线| 久久99久久99精品免视看婷婷 | 久久精子c满五个校花| 久草在线在线精品观看| 在线免费观看不卡av| 91精品国产高清一区二区三区蜜臀 | 99久久777色| 久久中文字幕电影| 国产精品美女久久久久高潮| 精品一区二区三区免费播放| 久久久午夜电影| 成人综合在线观看| 久久久www成人免费无遮挡大片 | 久久久午夜精品| 色婷婷一区二区| 日韩欧美在线影院| 天堂久久一区二区三区| 欧美精品丝袜中出| 国产一区欧美日韩| 亚洲色大成网站www久久九九| 91免费小视频| 亚洲国产婷婷综合在线精品| 欧美久久久久久久久中文字幕| 蜜臀久久99精品久久久画质超高清| 欧美日本一区二区三区| 国产揄拍国内精品对白| 亚洲女性喷水在线观看一区| 91精品国产一区二区人妖| 免费观看久久久4p| 久久久久国产精品人| 国产乱码精品一区二区三| 中文字幕一区二区三区在线观看| 欧美情侣在线播放| 成a人片亚洲日本久久| 麻豆一区二区三| 一卡二卡欧美日韩| 国产精品久久久久久久裸模| 7777精品伊人久久久大香线蕉完整版 | 麻豆精品一区二区三区| 亚洲一区二区中文在线| 国产精品国产自产拍在线| 欧美一区二区三区男人的天堂| 99久久综合国产精品| 国产一区二区三区不卡在线观看 | 色94色欧美sute亚洲线路二| 奇米影视一区二区三区| 亚洲精品成人精品456| 成人免费一区二区三区视频| 国产亚洲欧美中文| 久久免费精品国产久精品久久久久| 欧美日本国产一区| 欧美日韩国产片| 欧美另类久久久品| 欧美一级黄色大片| 日韩免费观看高清完整版| 欧美精品v日韩精品v韩国精品v| 色婷婷国产精品| 欧美日韩免费高清一区色橹橹| www.66久久| 欧美午夜精品一区| 91精品国产综合久久精品app| 91精品国产品国语在线不卡| 欧美乱妇15p| 久久久精品国产免费观看同学| 国产婷婷色一区二区三区四区| 日本一区二区三区四区| 亚洲人精品一区| 青草av.久久免费一区| 粉嫩av一区二区三区在线播放| 成人激情动漫在线观看| 欧美午夜精品久久久久久孕妇 | 欧美日韩国产电影| 久久亚洲欧美国产精品乐播| 亚洲人成网站在线| 麻豆国产欧美日韩综合精品二区| 国产乱码精品1区2区3区| 91麻豆国产在线观看| 日韩女优制服丝袜电影| 最新国产成人在线观看| 免费观看日韩电影| 欧美伊人久久久久久久久影院 | 国产精品乱码一区二三区小蝌蚪| 亚洲色图都市小说| 国产精品综合在线视频| 91麻豆精品国产自产在线观看一区 | 久久精品国产一区二区| 91麻豆高清视频| 国产欧美一二三区| 国产最新精品免费| 欧美电视剧在线观看完整版| 亚洲欧美aⅴ...| 99re8在线精品视频免费播放| 婷婷中文字幕综合| 精品一区二区三区欧美| 91久久国产综合久久| 欧美精品xxxxbbbb| 中国色在线观看另类| 亚洲国产精品一区二区尤物区| 亚洲欧洲综合另类| 欧美中文字幕亚洲一区二区va在线| 欧美一级午夜免费电影| 亚洲免费观看高清在线观看| 成人高清视频免费观看| 中文字幕在线观看一区二区| 色综合久久综合网欧美综合网| 国产精品久久久久久久久果冻传媒| 国产91精品一区二区麻豆亚洲| 欧美一区二区三区啪啪| 日本亚洲视频在线| 欧美自拍丝袜亚洲| 麻豆精品视频在线| 国产无遮挡一区二区三区毛片日本 | 一区二区三区av电影| 欧美日免费三级在线| 日韩中文字幕区一区有砖一区| 欧美久久久久久蜜桃| 久久国产剧场电影| 欧美高清一级片在线观看| 99久久婷婷国产综合精品电影| 日韩毛片精品高清免费| 欧美日韩五月天| 香蕉成人啪国产精品视频综合网| 国产欧美一二三区| 欧美亚洲日本一区| 国产一区二区三区在线观看免费 | 一区二区三区欧美日韩| 蜜臀久久99精品久久久久久9| 亚洲欧美一区二区三区久本道91| 97精品国产97久久久久久久久久久久| 香蕉久久夜色精品国产使用方法 | 国产综合成人久久大片91| 欧美大片在线观看一区| 蜜桃视频在线观看一区| 精品精品欲导航| 精彩视频一区二区三区| 国产精品国产三级国产aⅴ原创| 欧美精品xxxxbbbb| 在线免费观看成人短视频| 欧美老年两性高潮| 波多野结衣视频一区| 91极品美女在线| 欧美日韩一区高清| 日韩一区二区三区四区五区六区| 精品久久久久99| 亚洲男人的天堂一区二区| 五月天精品一区二区三区| av午夜一区麻豆| 99re免费视频精品全部| 国产一区二区三区久久悠悠色av| 一二三四区精品视频| 亚洲欧洲三级电影| 亚洲资源中文字幕| 国产精品私人自拍| 中文字幕二三区不卡| 色婷婷综合激情| 欧美日韩高清不卡| 欧美一区二区啪啪| 欧美精品第1页| 久久综合999| 亚洲午夜羞羞片| 国产精品免费视频一区| 日本精品免费观看高清观看| 91视频在线观看| 在线免费精品视频| 欧美美女一区二区| 久久网站热最新地址| 国产精品免费久久久久| 国产女同互慰高潮91漫画| 欧美成人乱码一区二区三区| 欧美三级中文字幕| 91麻豆精品国产| 欧美变态凌虐bdsm| 中文字幕精品一区二区三区精品| 日韩午夜在线影院| 欧美大片在线观看一区二区| 欧美一区二区三区日韩视频| 久久亚洲一区二区三区四区| 亚洲狠狠丁香婷婷综合久久久| 精品一区二区在线看| 欧洲精品在线观看| 亚洲综合一区二区三区| 一本大道综合伊人精品热热| 中文字幕佐山爱一区二区免费| 成人在线综合网站| 亚洲一区二区三区四区不卡| 欧美性猛交xxxx黑人交| 另类的小说在线视频另类成人小视频在线 | 亚洲国产wwwccc36天堂| 视频在线观看91| 欧美区一区二区三区| 日韩电影在线一区二区三区| 国产91精品精华液一区二区三区| 久久人人超碰精品|