Skip to content
notro edited this page Jul 7, 2013 · 5 revisions

The FBTFT drivers exposes some files in the sysfs filesystem.

Directory: /sys/class/graphics/fbX

FBTFT

Source code: https://github.com/notro/fbtft/blob/master/fbtft-sysfs.c

gamma

Supported by some drivers. Driver specific, see Gamma

0005 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0002 0002 0001 0001 0001 0002 0002 0002 0002 0002 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0004 0004 0004 0004 0004 0004 0004 0004 0004 0004 0004 0004 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005

Framebuffer subsystem

Source code: http://lxr.free-electrons.com/source/drivers/video/fbsysfs.c

bits_per_pixel

Read: fb_info->var.bits_per_pixel 16
Write: not supported by FBTFT

blank

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
bl_curve

Only works with drivers that have registered a backlight device. Not used by FBTFT, as it doesn't support PWM.

console

(does nothing)

cursor

(does nothing)

mode

Read: If set: fb_info->mode
Write: does not apply to FBTFT

modes

Read: fb_info->modelist U:128x128p-0
Write: does not apply to FBTFT

name

Read: fb_info->fix.id (driver name) ssd1351fb

pan

Read: fb_info->var.xoffset, fb_info->var.yoffset 0,0
Write: not supported by FBTFT

rotate

Read: fb_info->var.rotate 0
Write: not supported by FBTFT

state

Read: fb_info->state 0
Write: Calls fb_set_suspend()

stride

Read: fb_info->fix.line_length 256

virtual_size

Read: fb_info->var.xres_virtual, fb_info->var.yres_virtual 128,128
Write: not supported by FBTFT

OTHER

dev

Read: 29:1

device -> ../../../spi0.0
power/

(empty directory)

subsystem -> ../../../../../../../../class/graphics
uevent

Read:

MAJOR=29
MINOR=1
DEVNAME=fb1

Write: don't know

Backlight

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

bl_power

Turn backlight on/off

# backlight off
echo "1" | sudo tee bl_power

# backlight on
echo "0" | sudo tee bl_power
type

Read: backlight_types[bd->props.type] raw

Brightness

Does not apply to FBTFT

  • brightness
  • actual_brightness
  • max_brightness

Appendix

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

piwik

Clone this wiki locally