How to read the Arietta on-board button

The P1 push button mounted on Arietta G25 is wired between the PC17 GPIO line of the Atmel CPU and the ground as visible on the Arietta G25 schematic.

Like any other GPIOs it is possible to read its value using the sysfs user interface.

The Kernel ID to use to select this GPIO is 81.

Export the GPIO line 81 by typing:

# echo "81" > /sys/class/gpio/export

Read the actual button state:

# cat /sys/class/gpio/pioC17/value

Now try to press the button and type again:

# cat /sys/class/gpio/pioC17/value