⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testapp.c

📁 Xilinx XC4VSX35为核心的 XtremeDSP Development Kit-IV 开发板的例程
💻 C
字号:
/* *  * Copyright (c) 2004 Xilinx, Inc.  All rights reserved. * * Xilinx, Inc. * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A  * COURTESY TO YOU.  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. *//* * Xilinx EDK 6.3 EDK_Gmm.11.2 * * This file is a sample test application * * This application is intended to test and/or illustrate some  * functionality of your system.  The contents of this file may * vary depending on the IP in your system and may use existing * IP driver functions.  These drivers will be generated in your * XPS project when you run the "Generate Libraries" menu item * in XPS. * * Your XPS project directory is at: *    D:\wip\BenADDA_IV_Tests\Examples\edk_example */
// Located in: microblaze_0/include/xparameters.h#include "xparameters.h"
#include "xutil.h"
#include "xgpio_l.h"
/* * Routine to write a pattern out to a GPIO * which is configured as an output *   PARAMETER C_ALL_INPUTS = 0 */ void WriteToGPOutput(Xuint32 BaseAddress, int gpio_width) {   int i=0, j=0, k=0;   int numTimes = 5;    XGpio_mSetDataDirection(BaseAddress, 1, 0x00000000);   /* Set as outputs */   while (numTimes > 0) {      j = 1;      for(i=0; i<(gpio_width-1); i++) {         XGpio_mSetDataReg(BaseAddress, 1, j);         j = j << 1;         for (k=0; k<1000000; k++) {            ; //wait         }      }      j = 1;      j = ~j;      for(i=0; i<(gpio_width-1); i++) {         XGpio_mSetDataReg(BaseAddress, 1, j);         j = j << 1;         for (k=0; k<1000000; k++) {            ; //wait         }      }      numTimes--;   }}
//====================================================int main (void) {
   print("-- Entering main() --\r\n");
   /*     * MemoryTest routine will not be run for the memory at     * dlmb_cntlr.C_BASEADDR    * because it is being used to hold a part of this application program    */
   /*     * MemoryTest routine will not be run for the memory at     * ilmb_cntlr.C_BASEADDR    * because it is being used to hold a part of this application program    */
   /* Testing EMC Memory (Generic_External_Memory)*/   {      XStatus status;      print("Starting MemoryTest for Generic_External_Memory:\r\n");      print("  Running 32-bit test...");      status = XUtil_MemoryTest32((Xuint32*)XPAR_GENERIC_EXTERNAL_MEMORY_MEM0_BASEADDR, 1024, 0xAAAA5555, XUT_ALLMEMTESTS);      if (status == XST_SUCCESS) {         print("PASSED!\r\n");      }      else {         print("FAILED!\r\n");      }   }
   /* Testing EMC Memory (Generic_External_Memory_1)*/   {      XStatus status;      print("Starting MemoryTest for Generic_External_Memory_1:\r\n");      print("  Running 32-bit test...");      status = XUtil_MemoryTest32((Xuint32*)XPAR_GENERIC_EXTERNAL_MEMORY_1_MEM0_BASEADDR, 1024, 0xAAAA5555, XUT_ALLMEMTESTS);      if (status == XST_SUCCESS) {         print("PASSED!\r\n");      }      else {         print("FAILED!\r\n");      }   }
   WriteToGPOutput(XPAR_LEDS_BASEADDR, 4);
   print("-- Exiting main() --\r\n");   return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -