If you only wish to flip a pin or check its value etc. You can do as follows
Request / Release
You first have to request a GPIO. So if you wanted to request say GPIO 12, you would do
# echo 12 > /sys/class/gpio/export
If this is successful, you will find a /sys/class/gpio/gpio12/ directory.
When you have finnished using it, release it so other drivers can use it.
# echo 12 > /sys/class/gpio/unexport
In the specific GPIO directory, there will be two files: directory and value. Reading from them returns the current state (direction / value). Writing to them sets the current state.
high Set GPIO to an output with a starting value of 1
low Set GPIO to an output with a starting value of 0
out Same as 'low'
in Set GPIO to an input
Possible states for direction
The value field simply uses numeric values, that is 0 and 1.
To set GPIO 12 to an input
# echo in > /sys/class/gpio/gpio12/direction
To set GPIO 12 to a high output
echo high > /sys/class/gpio/gpio12/direction
To set GPIO 12's value to 0
echo 0 > /sys/class/gpio/gpio12/value
To read GPIO 12's current value
When you connect the C.H.I.P and check the /sys/class/gpio directory you will notice that gpiochip0 and gpiochip408 already present. These you most likely don't won't to fiddle with.
Also, please read up on how muxing works on the chip
Warning: incorrect usage of gpio pins can be dangerous
Form @renzo post http://bbs.nextthing.co/t/buttons-and-leds-on-xio/630 I see that the gpiochip408 is the PCF8574A expander, So it should be safe to use. Lesson learned (hopefully).