- UID
- 806961
|
本人用的是Virtex II Pro的开发板,想利用xilinx的EDK开发平台实现小程序,就是按键点亮LED灯,硬件系统生成后,在建立软件系统,C代码编译通过后就:
--Software -> Generate Libraries and BSPs
接下来
--
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);
}
}
|
|