标签:函数 oop zynq mic lock ima drive 随笔 example
1. 硬件平台搭建具体代码如下,
int main(void)
{
int Status;
volatile int Delay;
/* Initialize the GPIO driver */
Status = XGpio_Initialize(&Gpio, GPIO_EXAMPLE_DEVICE_ID);
if (Status != XST_SUCCESS) {
xil_printf("Gpio Initialization Failed\r\n");
return XST_FAILURE;
}
/* Set the direction for all signals as inputs except the LED output */
XGpio_SetDataDirection(&Gpio, LED_CHANNEL, ~LED);
xil_printf("Gpio Example\r\n");
/* Loop forever blinking the LED */
while (1) {
/* Set the LED to High */
XGpio_DiscreteWrite(&Gpio, LED_CHANNEL, LED);
/* Wait a small amount of time so the LED is visible */
for (Delay = 0; Delay < LED_DELAY; Delay++);
/* Clear the LED bit */
XGpio_DiscreteClear(&Gpio, LED_CHANNEL, LED);
/* Wait a small amount of time so the LED is visible */
for (Delay = 0; Delay < LED_DELAY; Delay++);
}
xil_printf("Successfully ran Gpio Example\r\n");
return XST_SUCCESS;
}
3. 编译运行
下载FPGA代码,以Hardware运行软件后,在终端打印了GPIO Example,外部LED不停闪烁。
标签:函数 oop zynq mic lock ima drive 随笔 example
原文地址:https://blog.51cto.com/shugenyin/2427320