ここを参考に
http://nahitafu.cocolog-nifty.com/nahitafu/2013/07/zynqpspl4-gpio-.html
gpio.xdc
set_property PACKAGE_PIN R12 [get_ports gpio_io_o] set_property IOSTANDARD LVCMOS33 [get_ports gpio_io_o]
helloworld.c
/* * helloworld.c: simple test application * * This application configures UART 16550 to baud rate 9600. * PS7 UART (Zynq) is not initialized by this application, since * bootrom/bsp configures it to baud rate 115200 * * ------------------------------------------------ * | UART TYPE BAUD RATE | * ------------------------------------------------ * uartns550 9600 * uartlite Configurable only in HW design * ps7_uart 115200 (configured by bootrom/bsp) */ #include <stdio.h> #include "platform.h" #include "xil_printf.h" #include "xgpio.h" #include "xparameters.h" int main() { init_platform(); print("Hello World\n\r"); XGpio xgpout; XGpio_Config xcfg_out; xcfg_out.DeviceId = XPAR_AXI_GPIO_0_DEVICE_ID; XGpio_CfgInitialize(&xgpout, &xcfg_out, XPAR_AXI_GPIO_0_BASEADDR); XGpio_SetDataDirection(&xgpout, 1, 0); while(1){ print("LED ON\n\r"); XGpio_DiscreteWrite(&xgpout,1,1); for(int i=0;i<100000000;i++){ } print("LED OFF\n\r"); XGpio_DiscreteWrite(&xgpout,1,0); for(int i=0;i<100000000;i++){ } } cleanup_platform(); return 0; }