notro / panel-mipi-dbi

13 stars 1 forks source link

Is it possible to specify firmware in config.txt #3

Closed hwmland closed 1 year ago

hwmland commented 1 year ago

I defined content of firmware for ST7796S driver (included - could be usefull for someone):

# ST7796S 
# 480x320
command 0xB0 0x00
command 0x11
delay 255
command 0x3a 0x55 # pixel format RGB565
command 0x36 0x28 # address mode (madctl)
command 0xe0 0xf 0x1f 0x1c 0xc 0xf 0x8 0x48 0x98 0x37 0xa 0x13 0x4 0x11 0xd 0x0 
command 0xe1 0xf 0x32 0x2e 0xb 0xd 0x5 0x47 0x75 0x37 0x6 0x10 0x3 0x24 0x20 0x0 
command 0xe2 0xf 0x32 0x2e 0xb 0xd 0x5 0x47 0x75 0x37 0x6 0x10 0x3 0x24 0x20 0x0 
#found not needed: command 0x36 0x28 # address mode (madctl) again?
command 0x11 
command 0x29

I defined following fragment in config.txt

#
dtoverlay=mipi-dbi-spi,spi0-0,speed=32000000
dtparam=width=480,height=320,width-mm=85,height-mm=57
dtparam=write-only
dtparam=reset-gpio=25,dc-gpio=24

When I copy st7796.bin into /lib/firmware as panel.bin, all is fine. However I see in mipi-dbi-spi-overlay.dts that it's possible to override as well 'compatible'. I hoped that with this I can have my firmware named st96.bin I'm not able to make it working. Once i write compatible=st7796 (using coma to dtoverlay or as dtparam) - LCD is not initialized, nothing in dmesg. Is it possible to specify name of firmware in config.txt? (how?)

notro commented 1 year ago

Due to "reasons" you need to specify both compatible strings with a NUL character as separator. A DT overlay would have had this as: compatible = "rpi-display", "panel-mipi-dbi-spi"; This is one incantation that I have used (rpi-display.bin):

dtoverlay=mipi-dbi-spi,spi0-0,speed=70000000
dtparam=compatible=rpi-display\0panel-mipi-dbi-spi
dtparam=width=320,height=240,width-mm=58,height-mm=43
dtparam=reset-gpio=23,dc-gpio=24
dtparam=backlight-gpio=18
dtparam=backlight-pwm
dtoverlay=ads7846,penirq=25,penirq_pull=2,xohms=60,pmax=255
hwmland commented 1 year ago

Thank you, this does the trick. So I report ST2296S (4" LCD) working as I wish. BTW: thank you for all your grad work with small LCD in RPi!