int main() { int Status; /* * Run the EmacLite Polled example, specify the Device ID that is * generated in xparameters.h. */ Status = EmacLitePolledExample(EMAC_DEVICE_ID); if (Status != XST_SUCCESS) { return XST_FAILURE; } return XST_SUCCESS; }
int main (void) { Xil_ICacheEnableRegion(0x80000000); Xil_DCacheEnableRegion(0x80000000); print("-- Entering main() --\r\n"); /* * Peripheral SelfTest will not be run for RS232 * because it has been selected as the STDOUT device */ { int status; print("\r\nRunning UartLiteSelfTestExample() for RS232_USB...\r\n"); status = UartLiteSelfTestExample(XPAR_RS232_USB_DEVICE_ID); if (status == 0) { print("UartLiteSelfTestExample PASSED\r\n"); } else { print("UartLiteSelfTestExample FAILED\r\n"); } } { u32 status; print("\r\nRunning GpioOutputExample() for LEDs_8Bit...\r\n"); status = GpioOutputExample(XPAR_LEDS_8BIT_DEVICE_ID,8); if (status == 0) { print("GpioOutputExample PASSED.\r\n"); } else { print("GpioOutputExample FAILED.\r\n"); } } { u32 status; print("\r\nRunning GpioInputExample() for DIP_Switches_8Bit...\r\n"); u32 DataRead; status = GpioInputExample(XPAR_DIP_SWITCHES_8BIT_DEVICE_ID, &DataRead); if (status == 0) { xil_printf("GpioInputExample PASSED. Read data:0x%X\r\n", DataRead); } else { print("GpioInputExample FAILED.\r\n"); } } { u32 status; print("\r\nRunning GpioInputExample() for Push_Buttons_3Bit...\r\n"); u32 DataRead; status = GpioInputExample(XPAR_PUSH_BUTTONS_3BIT_DEVICE_ID, &DataRead); if (status == 0) { xil_printf("GpioInputExample PASSED. Read data:0x%X\r\n", DataRead); } else { print("GpioInputExample FAILED.\r\n"); } } { int status; print("\r\nRunning EmacLitePolledExample() for Ethernet_MAC...\r\n"); status = EmacLitePolledExample(XPAR_ETHERNET_MAC_DEVICE_ID); if (status == 0) { print("EmacLite Polled Example PASSED\r\n"); } else { print("EmacLite Polled Example FAILED\r\n"); } } { int status; print("\r\nRunning SysAceSelfTestExample() for SysACE_CompactFlash...\r\n"); status = SysAceSelfTestExample(XPAR_SYSACE_COMPACTFLASH_DEVICE_ID); if (status == 0) { print("SysAceSelfTestExample PASSED\r\n"); } else { print("SysAceSelfTestExample FAILED\r\n"); } } print("-- Exiting main() --\r\n"); Xil_DCacheDisable(); Xil_ICacheDisable(); return 0; }
int main() { static XIntc intc; static XGpio dip_switches_4bits_Gpio; static XTmrCtr axi_timer_0_Timer; Xil_ICacheEnable(); Xil_DCacheEnable(); print("---Entering main---\n\r"); { int status; print("\r\n Running IntcSelfTestExample() for microblaze_0_intc...\r\n"); status = IntcSelfTestExample(XPAR_MICROBLAZE_0_INTC_DEVICE_ID); if (status == 0) { print("IntcSelfTestExample PASSED\r\n"); } else { print("IntcSelfTestExample FAILED\r\n"); } } { int Status; Status = IntcInterruptSetup(&intc, XPAR_MICROBLAZE_0_INTC_DEVICE_ID); if (Status == 0) { print("Intc Interrupt Setup PASSED\r\n"); } else { print("Intc Interrupt Setup FAILED\r\n"); } } { int status; print("\r\nRunning UartLiteSelfTestExample() for debug_module...\r\n"); status = UartLiteSelfTestExample(XPAR_DEBUG_MODULE_DEVICE_ID); if (status == 0) { print("UartLiteSelfTestExample PASSED\r\n"); } else { print("UartLiteSelfTestExample FAILED\r\n"); } } /* * Peripheral SelfTest will not be run for usb_uart * because it has been selected as the STDOUT device */ { u32 status; print("\r\nRunning GpioInputExample() for dip_switches_4bits...\r\n"); u32 DataRead; status = GpioInputExample(XPAR_DIP_SWITCHES_4BITS_DEVICE_ID, &DataRead); if (status == 0) { xil_printf("GpioInputExample PASSED. Read data:0x%X\r\n", DataRead); } else { print("GpioInputExample FAILED.\r\n"); } } { int Status; u32 DataRead; print(" Press button to Generate Interrupt\r\n"); Status = GpioIntrExample(&intc, &dip_switches_4bits_Gpio, \ XPAR_DIP_SWITCHES_4BITS_DEVICE_ID, \ XPAR_MICROBLAZE_0_INTC_DIP_SWITCHES_4BITS_IP2INTC_IRPT_INTR, \ GPIO_CHANNEL1, &DataRead); if (Status == 0 ){ if(DataRead == 0) print("No button pressed. \r\n"); else print("Gpio Interrupt Test PASSED. \r\n"); } else { print("Gpio Interrupt Test FAILED.\r\n"); } } { u32 status; print("\r\nRunning GpioOutputExample() for leds_4bits...\r\n"); status = GpioOutputExample(XPAR_LEDS_4BITS_DEVICE_ID,4); if (status == 0) { print("GpioOutputExample PASSED.\r\n"); } else { print("GpioOutputExample FAILED.\r\n"); } } { int status; print("\r\nRunning EmacLitePolledExample() for ethernet_mac...\r\n"); status = EmacLitePolledExample(XPAR_ETHERNET_MAC_DEVICE_ID); if (status == 0) { print("EmacLite Polled Example PASSED\r\n"); } else { print("EmacLite Polled Example FAILED\r\n"); } } { int status; print("\r\n Running TmrCtrSelfTestExample() for axi_timer_0...\r\n"); status = TmrCtrSelfTestExample(XPAR_AXI_TIMER_0_DEVICE_ID, 0x0); if (status == 0) { print("TmrCtrSelfTestExample PASSED\r\n"); } else { print("TmrCtrSelfTestExample FAILED\r\n"); } } { int Status; print("\r\n Running Interrupt Test for axi_timer_0...\r\n"); Status = TmrCtrIntrExample(&intc, &axi_timer_0_Timer, \ XPAR_AXI_TIMER_0_DEVICE_ID, \ XPAR_MICROBLAZE_0_INTC_AXI_TIMER_0_INTERRUPT_INTR, 0); if (Status == 0) { print("Timer Interrupt Test PASSED\r\n"); } else { print("Timer Interrupt Test FAILED\r\n"); } } { XStatus status; print("\r\n Runnning SpiSelfTestExample() for spi_flash...\r\n"); status = SpiSelfTestExample(XPAR_SPI_FLASH_DEVICE_ID); if (status == 0) { print("SpiSelfTestExample PASSED\r\n"); } else { print("SpiSelfTestExample FAILED\r\n"); } } print("---Exiting main---\n\r"); Xil_DCacheDisable(); Xil_ICacheDisable(); return 0; }
int main() { static XIntc intc; Xil_ICacheEnable(); Xil_DCacheEnable(); print("---Entering main---\n\r"); { int status; print("\r\n Running IntcSelfTestExample() for xps_intc_0...\r\n"); status = IntcSelfTestExample(XPAR_XPS_INTC_0_DEVICE_ID); if (status == 0) { print("IntcSelfTestExample PASSED\r\n"); } else { print("IntcSelfTestExample FAILED\r\n"); } } { int Status; Status = IntcInterruptSetup(&intc, XPAR_XPS_INTC_0_DEVICE_ID); if (Status == 0) { print("Intc Interrupt Setup PASSED\r\n"); } else { print("Intc Interrupt Setup FAILED\r\n"); } } { u32 status; print("\r\nRunning GpioInputExample() for dip_switches_8bit...\r\n"); u32 DataRead; status = GpioInputExample(XPAR_DIP_SWITCHES_8BIT_DEVICE_ID, &DataRead); if (status == 0) { xil_printf("GpioInputExample PASSED. Read data:0x%X\r\n", DataRead); } else { print("GpioInputExample FAILED.\r\n"); } } { u32 status; print("\r\nRunning GpioOutputExample() for leds_8bit...\r\n"); status = GpioOutputExample(XPAR_LEDS_8BIT_DEVICE_ID,8); if (status == 0) { print("GpioOutputExample PASSED.\r\n"); } else { print("GpioOutputExample FAILED.\r\n"); } } { u32 status; print("\r\nRunning GpioOutputExample() for leds_positions...\r\n"); status = GpioOutputExample(XPAR_LEDS_POSITIONS_DEVICE_ID,5); if (status == 0) { print("GpioOutputExample PASSED.\r\n"); } else { print("GpioOutputExample FAILED.\r\n"); } } { u32 status; print("\r\nRunning GpioInputExample() for push_buttons_5bit...\r\n"); u32 DataRead; status = GpioInputExample(XPAR_PUSH_BUTTONS_5BIT_DEVICE_ID, &DataRead); if (status == 0) { xil_printf("GpioInputExample PASSED. Read data:0x%X\r\n", DataRead); } else { print("GpioInputExample FAILED.\r\n"); } } { int status; print("\r\nRunning EmacLitePolledExample() for ethernet_mac...\r\n"); status = EmacLitePolledExample(XPAR_ETHERNET_MAC_DEVICE_ID); if (status == 0) { print("EmacLite Polled Example PASSED\r\n"); } else { print("EmacLite Polled Example FAILED\r\n"); } } { int status; print("\r\n Running IicSelfTestExample() for iic_eeprom...\r\n"); status = IicSelfTestExample(XPAR_IIC_EEPROM_DEVICE_ID); if (status == 0) { print("IicSelfTestExample PASSED\r\n"); } else { print("IicSelfTestExample FAILED\r\n"); } } { int status; print("\r\nRunning UartLiteSelfTestExample() for mdm_0...\r\n"); status = UartLiteSelfTestExample(XPAR_MDM_0_DEVICE_ID); if (status == 0) { print("UartLiteSelfTestExample PASSED\r\n"); } else { print("UartLiteSelfTestExample FAILED\r\n"); } } /* * Peripheral SelfTest will not be run for rs232_uart_1 * because it has been selected as the STDOUT device */ { int status; print("\r\nRunning UartLiteSelfTestExample() for rs232_uart_2...\r\n"); status = UartLiteSelfTestExample(XPAR_RS232_UART_2_DEVICE_ID); if (status == 0) { print("UartLiteSelfTestExample PASSED\r\n"); } else { print("UartLiteSelfTestExample FAILED\r\n"); } } { XStatus status; print("\r\n Running PCIeTestAppExample for pcie_bridge...\r\n"); status = PCIeTestAppExample(XPAR_PCIE_BRIDGE_DEVICE_ID); if (status == 0) { print("PCIeTestAppExample PASSED\r\n"); } else { print("PCIeTestAppExample FAILED\r\n"); } } { int status; print("\r\nRunning SysAceSelfTestExample() for sysace_compactflash...\r\n"); status = SysAceSelfTestExample(XPAR_SYSACE_COMPACTFLASH_DEVICE_ID); if (status == 0) { print("SysAceSelfTestExample PASSED\r\n"); } else { print("SysAceSelfTestExample FAILED\r\n"); } } print("---Exiting main---\n\r"); Xil_DCacheDisable(); Xil_ICacheDisable(); return 0; }