-
Notifications
You must be signed in to change notification settings - Fork 2
SYSFS
The FBTFT drivers exposes some files in the sysfs filesystem.
Directory: /sys/class/graphics/fbX
Source code: https://github.com/notro/fbtft/blob/master/fbtft-sysfs.c
Supported by some drivers. Driver specific, see Gamma
Read:
000F 0000 0007 0002 0000 0000 0006 0005 0004 0001
0004 0016 0002 0007 0006 0003 0002 0001 0007 0007
Source code: http://lxr.free-electrons.com/source/drivers/video/fbsysfs.c
Read: fb_info->var.bits_per_pixel 16
Write: not supported by FBTFT
Read: (can be read, but returns nothing)
Write: Currently only supported by ssd1351fb
# blank display
echo "4" | sudo tee blank
# unblank display
echo "0" | sudo tee blank
Only works with drivers that have registered a backlight device. Not used by FBTFT, as it doesn't support PWM.
(does nothing)
(does nothing)
Read: If set: fb_info->mode
Write: does not apply to FBTFT
Read: fb_info->modelist U:128x128p-0
Write: does not apply to FBTFT
Read: fb_info->fix.id (driver name) ssd1351fb
Read: fb_info->var.xoffset, fb_info->var.yoffset 0,0
Write: not supported by FBTFT
Read: fb_info->var.rotate 0
Write: not supported by FBTFT
Read: fb_info->state 0
Write: Calls fb_set_suspend()
Read: fb_info->fix.line_length 256
Read: fb_info->var.xres_virtual, fb_info->var.yres_virtual 128,128
Write: not supported by FBTFT
Read: 29:1
(empty directory)
Read:
MAJOR=29
MINOR=1
DEVNAME=fb1
Write: don't know
Many FBTFT drivers have backlight support
Directory: /sys/backlight/{driver}/
Source code: http://lxr.free-electrons.com/source/drivers/video/backlight/backlight.c
Ref: https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-class-backlight
Turn backlight on/off
# backlight off
echo "1" | sudo tee bl_power
# backlight on
echo "0" | sudo tee bl_power
Read: backlight_types[bd->props.type] raw
Does not apply to FBTFT
- brightness
- actual_brightness
- max_brightness
pi@raspberrypi /sys/class/graphics/fb1 $ ls -l
total 0
-rw-r--r-- 1 root root 4096 Jul 2 23:15 bits_per_pixel
-rw-r--r-- 1 root root 4096 Jul 2 23:15 blank
-rw-r--r-- 1 root root 4096 Jul 2 23:15 bl_curve
-rw-r--r-- 1 root root 4096 Jul 2 23:15 console
-rw-r--r-- 1 root root 4096 Jul 2 23:15 cursor
-r--r--r-- 1 root root 4096 Jul 2 23:15 dev
lrwxrwxrwx 1 root root 0 Jul 2 23:15 device -> ../../../spi0.0
-rw-rw-rw- 1 root root 4096 Jul 2 23:15 gamma
-rw-r--r-- 1 root root 4096 Jul 2 23:15 mode
-rw-r--r-- 1 root root 4096 Jul 2 23:15 modes
-r--r--r-- 1 root root 4096 Jul 2 23:15 name
-rw-r--r-- 1 root root 4096 Jul 2 23:15 pan
drwxr-xr-x 2 root root 0 Jul 2 23:15 power
-rw-r--r-- 1 root root 4096 Jul 2 23:15 rotate
-rw-r--r-- 1 root root 4096 Jul 2 23:15 state
-r--r--r-- 1 root root 4096 Jul 2 23:15 stride
lrwxrwxrwx 1 root root 0 Jul 2 23:15 subsystem -> ../../../../../../../../class/graphics
-rw-r--r-- 1 root root 4096 Jul 2 23:15 uevent
-rw-r--r-- 1 root root 4096 Jul 2 23:15 virtual_size