#include #include #include "xparameters.h" #define LED_DELAY 100000 int main() { XGpio output_one; XGpio output_two; int led_data = 0; volatile int Delay; XGpio_Initialize(&output_one, XPAR_AXI_GPIO_0_DEVICE_ID); //initialize output XGpio variable XGpio_Initialize(&output_two, XPAR_AXI_GPIO_0_DEVICE_ID); XGpio_SetDataDirection(&output_one, 1, 0x0); //set first channel tristate buffer to output XGpio_SetDataDirection(&output_two, 2, 0x0); //set first channel tristate buffer to output while(1){ led_data = XGpio_DiscreteRead(&output_one, 1); //get led data XGpio_DiscreteWrite(&output_one, 1, led_data); //write switch data to the LEDs XGpio_DiscreteWrite(&output_two, 2, led_data); //write switch data to the LEDs for (Delay = 0; Delay < LED_DELAY; Delay++); // Wait a small amount of time so the LED is visible XGpio_DiscreteWrite(&output_one, 1, ~led_data); //write switch data to the LEDs XGpio_DiscreteWrite(&output_two, 2, ~led_data); //write switch data to the LEDs for (Delay = 0; Delay < LED_DELAY; Delay++); // Wait a small amount of time so the LED is visible XGpio_DiscreteWrite(&output_one, 1, led_data); //write switch data to the LEDs XGpio_DiscreteWrite(&output_two, 2, led_data); //write switch data to the LEDs for (Delay = 0; Delay < LED_DELAY; Delay++); // Wait a small amount of time so the LED is visible XGpio_DiscreteWrite(&output_one, 1, ~led_data); //write switch data to the LEDs XGpio_DiscreteWrite(&output_two, 2, ~led_data); //write switch data to the LEDs for (Delay = 0; Delay < LED_DELAY; Delay++); // Wait a small amount of time so the LED is visible } return 0; }