Many files you see in the LCD wiki are arduino code (C or C++), so when you see (1<<3)|(1<<6) it means:LCD_WriteReg(0x36,(1<<3)|(1<<6));
1 shifted 3 places to the left = 1000
1 shifted 6 places to the left = 1000000
combine them with OR
=01001000=0x48
You should open the LCD datasheet, look for command 0x36, and see what 01001000 would do.
Keep in mind that the panel-mipi-dbi[-spi] driver is attempted to load if:
* the correct dtoverlay line is inserted in /boot/firmware config.txt
* the dtparam lines point to an existing ST7796S.bin file for the LCD initialization (in the dtparam file, don't add the .bin)
* the dtparam lines don't have any issues with the chosen GPIO
You can check whether this part works with "dmesg | grep panel"
If the kernel driver is loaded correctly, you will see a new /dev/fb0 or /dev/fb1 device file.
Then, if the LCD is not working, you may have a wiring problem, or the ST7796S.bin contains commands that don't configure your LCD correctly.
The linux kernel will not have any feedback from the LCD. That SPI channel is a one way street: master out, slave in.
Read all of this:
https://github.com/notro/panel-mipi-dbi/wiki
PD: oops I didn't see that you got the LCD working, it is glitchy and you need to rotate it. Just one problem at a time.
Use only the dtoverlay=mipi-dbi-spi, abandon all the fbcp and tft35 methods.
Try the GPIO that others have used before. Some GPIOs are native chip selects and you should prefer using them, instead of using whatever you want.
The panel-mipi-dbi[-spi] driver will not rotate the image for you. That's an LCD function that you activate in the txt or bin file.
Change back your config.txt to width=480,height=320 while you are still trying to make it work without rotation and without glitches
Statistics: Posted by robertojguerra — Fri Jan 09, 2026 2:23 am