Following up on the last post “How to get started with Embedded Android on the Wandboard”, this article shows how to use the GPIO Pins of the Wandboard. It is based on the Android setup, however the generic part should run under other Linux based systems as well.
Finding the right GPIO Pin Number
In the userspace you are able to access GPIO functionality through the sysclass interface.
root@android:/ # ll /sys/class/gpio/ --w------- root root 4096 2013-06-20 10:57 export lrwxrwxrwx root root 2013-06-20 10:57 gpio101 -> ../../devices/virtual/gpio/gpio101 lrwxrwxrwx root root 2013-06-20 10:57 gpio200 -> ../../devices/virtual/gpio/gpio200 lrwxrwxrwx root root 2013-06-20 10:57 gpio24 -> ../../devices/virtual/gpio/gpio24 lrwxrwxrwx root root 2013-06-20 10:57 gpio72 -> ../../devices/virtual/gpio/gpio72 lrwxrwxrwx root root 2013-06-20 10:57 gpio75 -> ../../devices/virtual/gpio/gpio75 lrwxrwxrwx root root 2013-06-20 10:57 gpio90 -> ../../devices/virtual/gpio/gpio90 lrwxrwxrwx root root 2013-06-20 10:57 gpio91 -> ../../devices/virtual/gpio/gpio91 lrwxrwxrwx root root 2013-06-20 10:57 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0 lrwxrwxrwx root root 2013-06-20 10:57 gpiochip128 -> ../../devices/virtual/gpio/gpiochip128 lrwxrwxrwx root root 2013-06-20 10:57 gpiochip160 -> ../../devices/virtual/gpio/gpiochip160 lrwxrwxrwx root root 2013-06-20 10:57 gpiochip192 -> ../../devices/virtual/gpio/gpiochip192 lrwxrwxrwx root root 2013-06-20 10:57 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32 lrwxrwxrwx root root 2013-06-20 10:57 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64 lrwxrwxrwx root root 2013-06-20 10:57 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96 --w------- root root 4096 2013-06-20 10:57 unexport