GPIO lines --- CORE9G25
Feature Hardware ref Linux Tutorials Debian Tutorials pinout

GPIO lines

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

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

CORE9G25 examples

Using this basic example of wiring:

CORE9G25 gpio Output expample

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

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

The LED was control by the W9, we check the Pinout sheet and know the W9 use the PA22 GPIO(the Linux node is 22).

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 W15 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 W15, we check the Pinout sheet and know the W15 use the PA28 GPIO(the Linux node is 28).

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

Related links


  Tel: +86-755-29638421  |    Sales Email: market@armdevs.com |  Support Email: support@armdevs.com | Gtalk: armdevs@gmail.com  
www.armdevs.com | Copyright @2013 - CoreWind Technology Co.,Limited