Posts Tagged ‘BCM2708’

Backlight of the Raspberry TFT Touchscreen

Wednesday, May 14th, 2014

The instructions on the Adafruit website may only work on some versions – apparently the the GPIO can be #250 instead of #252. Don’t know why, it’s a Raspberry Version B (and they seem to refer to a slightly different PCB revision).

ls -la /sys/class/gpio

gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
gpiochip250 -> ../../devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/stmpe-gpio.0/gpio/gpiochip250

In order to enable the GPIO and set direction to “out”:

echo 250 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio250/direction
ls -la /sys/class/gpio

gpio250 -> ../../devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/stmpe-gpio.0/gpio/gpio250
gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
gpiochip250 -> ../../devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/stmpe-gpio.0/gpio/gpiochip250

While this has no effect at all:

echo "1" > /sys/class/gpio/gpio250/value
echo "0" > /sys/class/gpio/gpio250/value

But one can switch it on/off, when assigning it as GPiO backlight device:

echo "0" > /sys/class/backlight/gpio-backlight.0/brightness
echo "1" > /sys/class/backlight/gpio-backlight.0/brightness