Closed zwccai closed 9 years ago
First you have to do this: https://learn.adafruit.com/adafruit-2-8-pitft-capacitive-touch?view=all#backlight-control
Then enable FBTFT backlight support by setting the 'led' gpio:
options fbtft_device name=adafruitct28 rotate=90 frequency=32000000 gpios=dc:25,led=18
X windows can't turn off the backlight because fb_blank() is not supported in FBTFT. This is a workaround: https://github.com/notro/fbtft-spindle/wiki/Appendix#x-windows-backlight-script
I don't have this display so this is not tested.
I think I have an older version of the display, I don't see the #18 backlight jumper. (Please see the attachment). What I should I do?
This is the resistive version of the display. Use led=252: https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi?view=all#controlling-the-backlight
What if I am on the console, not running X? Is possible to create some custom kernel module for this?
Didn't this work?
options fbtft_device name=adafruitct28 rotate=90 frequency=32000000 gpios=dc:25,led=252
This should give you an entry under /sys/class/backlight.
From SSH, you can change the console blanking timeout to speed up testing:
sudo sh -c "TERM=linux setterm -blank 1 >/dev/tty0"
I tried "options fbtft_device name=adafruitct28 rotate=90 frequency=32000000 gpios=dc:25,led=252", but the "/sys/class/backlight" is empty, "tee: /sys/class/backlight/*/bl_power: No such file or directory"
Is backlight support enabled in the kernel?
$ zgrep BACKLIGHT /proc/config.gz
CONFIG_FB_BACKLIGHT=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
[...]
$zgrep BACKLIGHT /proc/config.gz CONFIG_FB_BACKLIGHT=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
Ok, let's turn on some debug output to see more of what's going on: add option debug=3
'led' should show up here:
$ dmesg | grep fbtft_request_gpios
Tried "options fbtft_device name=adafruitct28 rotate=90 frequency=32000000 gpios=dc:25,led=252 debug=3" $ dmesg | grep fbtft_request_gpios No result
If I do "options fbtft_device name=adafruitct28 rotate=90 frequency=32000000 debug=3" $dmesg | grep fbtft_request_gpios [ 12.274670] fb_ili9340 spi0.0: fbtft_request_gpios: 'dc' = GPIO25
My kernel version: Linux rpi 3.12.26+ #7 PREEMPT Wed Sep 17 14:25:24 EDT 2014 armv6l GNU/Linux
Oh, I'm sorry, it should be led:252 (colon not equal):
options fbtft_device name=adafruitct28 rotate=90 frequency=32000000 gpios=dc:25,led:252
Cool, now I am seeing the result. $ dmesg | grep fbtft_request_gpios [ 12.226363] fb_ili9340 spi0.0: fbtft_request_gpios: 'dc' = GPIO25 [ 12.319619] fb_ili9340 spi0.0: fbtft_request_gpios: 'led' = GPIO252
$ ls -la /sys/class/backlight/ fb_ili9340 -> ../../devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/backlight/fb_ili9340
Thanks for your timely response!
Closing issue since there has been no activity for more than 2 months. Reopen if needed.
I got the Adafruit 2.8" PiTFT Capacitive Touch setup working from this guide: https://learn.adafruit.com/adafruit-2-8-pitft-capacitive-touch/capacitive-touchscreen
The display turn off after 30 minutes, but the back light still on. Is there a way to configure it so that the back light turn off completely after certain minutes and wakeup with any key press?