https://www.lcdwiki.com/3.5inch_IPS_SPI_Module_ST7796
Orange Pi Zero 2W wiring:
SDI(MOSI) PH7 SPI1_MOSI
SDO(MISO) PH8 SPI1_MISO
SCK PH6 SPI1_CLK
LCD_CS PH5
LCD_RS PH4
LCD_RST PI0
CTP_SCL PI7
CTP_RST PH2
CTP_SDA PI8
CTP_INT PH3
Install kernel headers
sudo dpkg -i /opt/linux-headers*.deb
on armbian install header via armbian-config
Then clone repo
git clone https://github.com/rumidom/st7796s.git
cd st7796s/kernel_module/
Build kernel module and install it
make
sudo make install
make clean
sudo depmod -A
sudo bash -c 'echo "fb_st7796s" >> /etc/initramfs-tools/modules'
sudo update-initramfs -u
Then install dts and reboot device.
cd ../dts/
sudo orangepi-add-overlay sun50i-h618-st7796s-w2.dts
sudo reboot
Check framebuffer port
ls /dev/fb*
Create new file
sudo vim /etc/X11/xorg.conf.d/99-fbdev.conf
Copy paste this content and remember to change framebuffer port
Section "Device"
Identifier "myfb"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
EndSection
Build kernel module and install it
cd st7796s/touchscreen_kernel_module/
make
sudo make install
make clean
sudo depmod -A
sudo bash -c 'echo "ft6236" >> /etc/initramfs-tools/modules'
sudo update-initramfs -u
Then install dts and reboot device.
cd ../dts/
sudo orangepi-add-overlay sun50i-h618-FT6336.dts
sudo reboot
