--
Device Configuration ->Update Bitstream
Device Configuration ->Download Bitstream
下载完成后,板子的GOLEND DONE 亮,表示下载完成,但按键,LED灯没有一点反应,不知道问题出在哪里??
C代码如下:
#include "xgpio.h"
#include "xparameters.h"
int main(void)
{
XGpio gpLED;
XGpio gpPB;
// Initialise the peripherals
XGpio_Initialize(&gpLED, XPAR_LEDS_4BIT_DEVICE_ID);
XGpio_Initialize(&gpPB, XPAR_PUSHBUTTONS_5BIT_DEVICE_ID);
// Set the LED peripheral to outputs
XGpio_SetDataDirection(&gpLED, 1,0x00000000);
// Set the Push Button peripheral to inputs
XGpio_SetDataDirection(&gpPB, 1,0xffffffff);
Xuint32 data = 0;
while(1)
{
// Read the state of the push buttons
data = XGpio_DiscreteRead(&gpPB, 1);
// Set the LED state
XGpio_DiscreteWrite(&gpLED, 1, data);
}
}