UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
765 Views
Registered: ‎10-19-2017

Accessing Zynq 7100 LEDS from Linux

I have been reading about the Linux GPIO interface. I was wondering if there was a way to know which number GPIO to append to the /sys/class/gpio/export file in PetaLinux to access the GPIOs controlling the three LEDs on the Zynq 7100 board.

 

 

exportfd = open("/sys/class/gpio/export", O_WRONLY);

 if(exportfd < 0)
 {
  printf("Cannot open GPIO to export it\n");
  exit(1);
 }

 write(exportfd, "<WHAT NUMBER CORRESPONDS TO LEDS?>", 4);
 close(exportfd);

 

 

Tags (3)
0 Kudos
1 Reply
Moderator
Moderator
646 Views
Registered: ‎09-12-2007

Re: Accessing Zynq 7100 LEDS from Linux

There is a brief description at the wiki here that is very helpfull:

http://www.wiki.xilinx.com/Linux+GPIO+Driver

 

 

0 Kudos