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

📄 testapp_peripheral.c

📁 本系统由服务器软件控制平台和fpga硬件处理系统组成
💻 C
字号:
/* * * 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 8.2.02 EDK_Im_Sp2.4 * * 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: *    C:\myproj2\firewall\myxps\ */
// Located in: ppc405_0/include/xparameters.h#include "xparameters.h"
#include "stdio.h"
#include "xbasic_types.h"
#include "xgpio.h"
#include "gpio_header.h"
//====================================================int main (void) {
   print("-- Entering main() --\r\n");
   /*    * Peripheral SelfTest will not be run for RS232_Uart_1    * because it has been selected as the STDOUT device    */
   {      Xuint32 status;            print("\r\nRunning GpioOutputExample() for LEDs_4Bit...\r\n");      status = GpioOutputExample(XPAR_LEDS_4BIT_DEVICE_ID,4);            if (status == 0) {         print("GpioOutputExample PASSED.\r\n");      }      else {         print("GpioOutputExample FAILED.\r\n");      }   }
   {      Xuint32 status;            print("\r\nRunning GpioInputExample() for DIPSWs_4Bit...\r\n");      Xuint32 DataRead;            status = GpioInputExample(XPAR_DIPSWS_4BIT_DEVICE_ID, &DataRead);            if (status == 0) {         xil_printf("GpioInputExample PASSED. Read data:0x%X\r\n", DataRead);      }      else {         print("GpioInputExample FAILED.\r\n");      }   }
   {      Xuint32 status;            print("\r\nRunning GpioInputExample() for PushButtons_5Bit...\r\n");      Xuint32 DataRead;            status = GpioInputExample(XPAR_PUSHBUTTONS_5BIT_DEVICE_ID, &DataRead);            if (status == 0) {         xil_printf("GpioInputExample PASSED. Read data:0x%X\r\n", DataRead);      }      else {         print("GpioInputExample FAILED.\r\n");      }   }
   print("-- Exiting main() --\r\n");   return 0;}

⌨️ 快捷键说明

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