notro / panel-mipi-dbi

14 stars 2 forks source link

ST7796S #8

Open rhgndf opened 11 months ago

rhgndf commented 11 months ago

This init command sequence works on this ST7796S lcd: http://www.lcdwiki.com/4.0inch_SPI_Module_ST7796 It is taken from: https://github.com/Bodmer/TFT_eSPI/blob/master/TFT_Drivers/ST7796_Init.h

delay 120
command 0x01
delay 120
command 0x11
delay 120
command 0xF0 0xC3
command 0xF0 0x96
command 0x36 0x48
command 0x3A 0x55
command 0xB4 0x01
command 0xB6 0x80 0x02 0x3B
command 0xE8 0x40 0x8A 0x00 0x00 0x29 0x19 0xA5 0x33
command 0xC1 0x06
command 0xC2 0xA7
command 0xC5 0x18
delay 120
command 0xE0 0xF0 0x09 0x0b 0x06 0x04 0x15 0x2F 0x54 0x42 0x3C 0x17 0x14 0x18 0x1B
command 0xE1 0xE0 0x09 0x0B 0x06 0x04 0x03 0x2B 0x43 0x42 0x3B 0x16 0x14 0x17 0x1B
delay 120
command 0xF0 0x3C
command 0xF0 0x69
delay 120
command 0x29

This works nicely with xfce4 on a RPI4, but I have some questions related to this driver:

notro commented 11 months ago

How do I set the rotation using the dts file? I have been modifying the command sequence above

The driver doesn't support that, command 0x36 in the firmware file controls rotation (plus width/height) so it's one firmware file per rotation.

Is any of the firmware files upstreamed?

No.

Please add your display to the wiki: https://github.com/notro/panel-mipi-dbi/wiki/Displays