亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品国产伦一区二区三区观看体验 | 亚洲精品高清视频在线观看| 亚洲精品国产高清久久伦理二区| 婷婷综合另类小说色区| 国产一区二区精品久久91| 欧美色爱综合网| 亚洲国产精华液网站w| 青娱乐精品视频| 欧美私人免费视频| 中文字幕在线一区免费| 激情久久五月天| 欧美日韩国产成人在线免费| 18涩涩午夜精品.www| 久久er99精品| 欧美二区乱c少妇| 亚洲一区在线观看视频| 99精品视频一区二区| 国产性色一区二区| 国产在线播放一区三区四| 91麻豆精品国产91久久久久久久久| 中文字幕亚洲在| 国产伦精品一区二区三区免费 | 午夜久久久久久| 91久久国产综合久久| 国产精品理论片在线观看| 国产高清久久久久| 久久综合色婷婷| 国模无码大尺度一区二区三区| 91精品国产综合久久精品| 午夜精品一区二区三区电影天堂| 欧美午夜精品理论片a级按摩| 亚洲激情自拍视频| 一本到不卡免费一区二区| 国产精品久久久久影院色老大| 国产精品一色哟哟哟| 国产亚洲成aⅴ人片在线观看| 狠狠色丁香久久婷婷综| 欧美精品一区二区精品网| 久久99精品国产.久久久久| 欧美成人精品3d动漫h| 美女视频网站黄色亚洲| 26uuu另类欧美亚洲曰本| 国产激情一区二区三区四区| 国产香蕉久久精品综合网| 国产成人午夜视频| 1000精品久久久久久久久| 日本韩国欧美国产| 视频一区视频二区中文| 日韩欧美不卡在线观看视频| 国产一区二区三区免费播放| 久久伊99综合婷婷久久伊| 成人高清免费观看| 亚洲最大成人网4388xx| 欧美另类z0zxhd电影| 韩国三级电影一区二区| 国产精品天天看| 欧美午夜精品免费| 国产综合久久久久影院| 国产精品视频免费| 精品视频在线免费| 激情偷乱视频一区二区三区| 亚洲欧洲日产国码二区| 欧美日韩国产天堂| 国产91精品一区二区麻豆亚洲| 中文字幕亚洲一区二区av在线| 日本精品视频一区二区三区| 久久精品国产亚洲5555| 自拍偷拍国产精品| 91精品国产色综合久久不卡蜜臀 | 99精品国产视频| 日韩高清中文字幕一区| 国产亚洲精久久久久久| 欧美日韩在线电影| 国产 日韩 欧美大片| 五月天国产精品| 国产精品剧情在线亚洲| 欧美一区二区三区精品| 99久久精品费精品国产一区二区| 日韩不卡一区二区三区| 亚洲伦理在线精品| 久久久夜色精品亚洲| 在线播放亚洲一区| 色先锋aa成人| 国产成人99久久亚洲综合精品| 午夜精品久久久久| 亚洲欧洲av另类| 久久综合丝袜日本网| 欧美二区三区91| 色88888久久久久久影院按摩| 国产一区二区在线视频| 日韩精品一二三四| 亚洲综合一二三区| 最新不卡av在线| 国产婷婷色一区二区三区在线| 欧美日韩国产首页| 欧美亚洲一区二区在线| 色欧美片视频在线观看| 成人夜色视频网站在线观看| 久久国产精品一区二区| 日韩激情视频网站| 视频一区在线播放| 三级亚洲高清视频| 亚洲www啪成人一区二区麻豆| 日韩理论片一区二区| 亚洲国产精品国自产拍av| 精品国产欧美一区二区| 欧美一区午夜视频在线观看| 欧美日韩在线播放三区| 欧美一a一片一级一片| 91国在线观看| 欧美午夜电影在线播放| 欧美做爰猛烈大尺度电影无法无天| 成人免费毛片嘿嘿连载视频| 国产精品正在播放| 国产1区2区3区精品美女| 高清不卡一区二区| 国产成人综合视频| 成人高清免费观看| 91麻豆精东视频| 欧美亚洲一区二区三区四区| 欧美视频自拍偷拍| 欧美精品tushy高清| 91精品国产色综合久久不卡蜜臀| 欧美一激情一区二区三区| 日韩欧美在线1卡| 国产欧美日韩亚州综合| 国产精品毛片高清在线完整版| 中文字幕色av一区二区三区| 亚洲欧洲韩国日本视频| 亚洲成年人网站在线观看| 日韩精品高清不卡| 精品午夜久久福利影院| 国产成人精品一区二区三区四区 | 国产999精品久久久久久| 成人一区二区三区在线观看| 91久久精品一区二区二区| 欧美另类高清zo欧美| 国产亚洲1区2区3区| 亚洲资源中文字幕| 精品制服美女丁香| 91丝袜美女网| 91精品国产色综合久久不卡电影 | 精品国产一区二区三区不卡 | 精品一区二区三区久久| 成人精品一区二区三区四区| 91免费视频网址| 欧美一级二级在线观看| 国产精品久久看| 五月天久久比比资源色| 国产很黄免费观看久久| 色综合天天做天天爱| 日韩午夜电影av| 亚洲欧洲精品天堂一级| 蜜臂av日日欢夜夜爽一区| 成人午夜激情片| 欧美一区三区四区| 亚洲欧美在线视频观看| 蜜臀av性久久久久蜜臀aⅴ流畅 | 国内精品久久久久影院一蜜桃| 成人福利电影精品一区二区在线观看 | 国产不卡一区视频| 欧美日韩视频在线第一区| 蜜桃视频免费观看一区| 成人黄色一级视频| 日韩欧美电影一区| 亚洲电影视频在线| 成人app在线| 久久久夜色精品亚洲| 日韩一区欧美二区| 欧美综合在线视频| 国产精品进线69影院| 久久97超碰国产精品超碰| 欧美亚洲高清一区二区三区不卡| 中文av一区二区| 狠狠色综合色综合网络| 91 com成人网| 亚洲一区在线看| 色综合久久88色综合天天| 国产午夜精品在线观看| 精品一区二区三区免费观看| 欧美精品丝袜久久久中文字幕| 亚洲欧美福利一区二区| 国产精品99久| 久久男人中文字幕资源站| 久久精品72免费观看| 欧美日韩综合在线免费观看| 亚洲色图另类专区| 国产99久久久国产精品| 国产亚洲婷婷免费| 国产麻豆精品95视频| 精品电影一区二区三区| 久久不见久久见中文字幕免费| 欧美日韩一二三区| 夜夜精品浪潮av一区二区三区| 91亚洲精品乱码久久久久久蜜桃| 国产精品无人区| 9i在线看片成人免费| 亚洲区小说区图片区qvod| 91色视频在线| 一区二区三区在线免费播放|