GPIO lines

This article explains how to manage the general purpose input output (GPIO) lines on the WiFiG25 boards

All the examples are written in C. For the GPIO name, you can check it on the WiFiG25 Pinout page.

WiFiG25 examples

Using this basic example of wiring:

WiFiG25 gpio Output expample

it is possible to define the Pin18 line as an output and turn on/off the red led with the following command:

# cd /sys/class/gpio/
# echo "11">export 
# echo "out">gpio11/direction 
# echo "1">gpio11/value 
# echo "0">gpio11/value 
# echo "11">unexport 

The LED was control by the Pin18, we check the Pinout sheet and know the Pin18 use the PA11 GPIO(the Linux node is 11).

For the LED test demo in C, you can find it at the CD://Linux/example/gpio/output.c

CORE9G25 gpio Input expample

it is possible to define the Pin30 line as an iutput and get the IO status with the following command:

# cd /sys/class/gpio/
# echo "28">export 
# echo "in">gpio28/direction 
# cat gpio28/value 
# echo "28">unexport 

The Button was control by the Pin30, we check the Pinout sheet and know the Pin30 use the PC19 GPIO(the Linux node is 83).

For the LED test demo in C, you can find it at the CD://Linux/example/gpio/input.c

Related links


Market Mail : market@armdevs.com
Support Mail: support@armdevs.com Sales Phone: +86-755-29638421


CoreWind Online Chat>
Work time: 09:00-18:00
Copyright @ 2014 to 2020 - CoreWind Tech.