#include "xparameters.h"
#include "xgpio.h"
#include "xutil.h"
//====================================================
int main (void)
{
XGpio push;
int i, psb_check;
// define instance pointer for LEDs_8Bit device
XGpio LEDs8_Bit;
xil_printf("start of the program...\r\n");
// initialize and set data direction for PUSH_BUTTONS device
XGpio_Initialize(&push, XPAR_PUSH_BUTTONS_DEVICE_ID);
XGpio_SetDataDirection(&push, 1, 0xffffffff);
// initialize and set data direction for LEDs_8Bit device
XGpio_Initialize(&LEDs8_Bit, XPAR_LEDS_DEVICE_ID);
XGpio_SetDataDirection(&LEDs8_Bit, 1, 0x0);
while (1)
{
psb_check = XGpio_DiscreteRead(&push, 1);
xil_printf("pushbutton status %x\r\n",psb_check);
// output push switches value on LEDs_8Bit device
XGpio_DiscreteWrite(&LEDs8_Bit, 1, ~psb_check);
for (i=0; i<99999999; i++);
}
}