beautypg.com

9 sysfs support, Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual

Page 32

background image

KTD-S0057-I

Page 28

DebianTM Linux® BSP


KTAM3874/pITX Software Guide

6.9

Sysfs Support

Alternative to the KEAPI interface you can use Sysfs to manipulate the GPIOs or the backlight. The example
reads the content and direction of GPIO0 (GP0[10]) and sets the direction to 'output' and the content to
'high'.

Comment:

root@ubuntu:# echo 10 > /sys/class/gpio/export

enable GP0[10] access

root@ubuntu:# cat /sys/class/gpio/gpio10/value

read content

1

value = high

root@ubuntu:# cat /sys/class/gpio/gpio10/direction

read direction

in

direction = input

root@ubuntu:# echo "out" > /sys/class/gpio/gpio10/direction

set direction to output

root@ubuntu:# echo 1 > /sys/class/gpio/gpio10/value

set content to high

root@ubuntu:# echo 10 > /sys/class/gpio/unexport

disable GP0[10] access


This manual is related to the following products: