From 45b7b7452d4ce8c79eeae20bd322758ad11afee6 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 17 Dec 2020 11:26:43 +0000 Subject: [PATCH] Added support for the LCD32 display on RPi Model B Rev1 --- LCD32-B-Rev1-show | 71 +++++++++++++++++++++++++++++++++ README.md | 4 +- usr/tft9341-overlay-b-rev1.dtb | Bin 0 -> 2305 bytes 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100755 LCD32-B-Rev1-show create mode 100644 usr/tft9341-overlay-b-rev1.dtb diff --git a/LCD32-B-Rev1-show b/LCD32-B-Rev1-show new file mode 100755 index 0000000..35e0fb8 --- /dev/null +++ b/LCD32-B-Rev1-show @@ -0,0 +1,71 @@ +#!/bin/bash + +sudo ./system_backup.sh + +if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then +sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf +fi +if [ ! -d /etc/X11/xorg.conf.d ]; then +sudo mkdir -p /etc/X11/xorg.conf.d +fi +sudo cp ./usr/tft9341-overlay-b-rev1.dtb /boot/overlays/ +sudo cp ./usr/tft9341-overlay-b-rev1.dtb /boot/overlays/tft9341-b-rev1.dtbo +root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'` +if test "$root_dev" = "/dev/mmcblk0p7";then +sudo cp -rf ./boot/config-noobs-nomal.txt ./boot/config.txt.bak +else +sudo cp -rf ./boot/config-nomal.txt ./boot/config.txt.bak +sudo echo "hdmi_force_hotplug=1" >> ./boot/config.txt.bak +fi +sudo echo "dtparam=i2c_arm=on" >> ./boot/config.txt.bak +sudo echo "dtparam=spi=on" >> ./boot/config.txt.bak +sudo echo "enable_uart=1" >> ./boot/config.txt.bak +sudo echo "dtoverlay=tft9341-b-rev1:rotate=270" >> ./boot/config.txt.bak +sudo cp -rf ./boot/config.txt.bak /boot/config.txt +sudo cp -rf ./usr/99-calibration.conf-32-270 /etc/X11/xorg.conf.d/99-calibration.conf +sudo cp -rf ./usr/99-fbturbo.conf /usr/share/X11/xorg.conf.d/99-fbturbo.conf +if test "$root_dev" = "/dev/mmcblk0p7";then +sudo cp ./usr/cmdline.txt-noobs /boot/cmdline.txt +else +sudo cp ./usr/cmdline.txt /boot/ +fi +sudo cp ./usr/inittab /etc/ +#sudo cp ./boot/config-32.txt /boot/config.txt +sudo touch ./.have_installed +echo "gpio:resistance:32:270:320:240" > ./.have_installed +#evdev install +#nodeplatform=`uname -n` +#kernel=`uname -r` +version=`uname -v` +#if test "$nodeplatform" = "raspberrypi";then +#echo "this is raspberrypi kernel" +version=${version##* } +#version=${version#*#} +echo $version +if test $version -lt 2017;then +echo "reboot" +else +echo "need to update touch configuration" +sudo dpkg -i -B ./xserver-xorg-input-evdev_1%3a2.10.6-1+b1_armhf.deb 2> error_output.txt +#sudo apt-get install xserver-xorg-input-evdev 2> error_output.txt +result=`cat ./error_output.txt` +echo -e "\033[31m$result\033[0m" +grep -q "error:" ./error_output.txt && exit +sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf +#echo "reboot" +fi +#else +#echo "this is not raspberrypi kernel, no need to update touch configure, reboot" +#fi + +sudo sync +sudo sync +sleep 1 +if [ $# -eq 1 ]; then +sudo ./rotate.sh $1 +elif [ $# -gt 1 ]; then +echo "Too many parameters" +fi + +echo "reboot now" +sudo reboot diff --git a/README.md b/README.md index 5abc325..eb49ee9 100755 --- a/README.md +++ b/README.md @@ -89,7 +89,9 @@ EN: http://www.lcdwiki.com/2.8inch_RPi_Display # 3.2” RPi Display (MPI3201): ### Driver install: -sudo ./LCD32-show +sudo ./LCD32-show +### For RPi Model B Rev1: +sudo ./LCD32-B-Rev1-show ### WIKI: CN: http://www.lcdwiki.com/zh/3.2inch_RPi_Display
EN: http://www.lcdwiki.com/3.2inch_RPi_Display diff --git a/usr/tft9341-overlay-b-rev1.dtb b/usr/tft9341-overlay-b-rev1.dtb new file mode 100644 index 0000000000000000000000000000000000000000..8eab56e40d7db60c24330815a954ae39376a7ffb GIT binary patch literal 2305 zcma)7y>HV%6n{xUP)Y?Y0s#X91r?!KO+TP*gw!sq`~eI^PJBtNI=1nh+k~k@2i9&3 z46F={Y^W1E{R=8amWqXykN5N4*-lCcC%yRIyWjhMcR8B=bwV^*A)+;+3!nJ=fN6&5 zDig2DQ=bX$S&G89p@gk3Z; z*gFdge5RAfsI|t$SWz9dzPz&7jQvoS{9NY!Ehg0TI@1j%*n)hHsl2QYctm|IziN0J z+i-kKnF)*iR}E3)4P(pVpJm$Y&%|#Fit{Tt^8;Ur?HYeLz2Sa6H@d)HWP0I=j++Jw zVrxI(eL0sM`f;y({+ej7%pWiVyH@`V?@>R?zvVra<=^ohzQLoW@68OM*48iNAB`OK z$Fll|n$3CC9`&{7sJ*Sbt&yYTCU985O<|+_n(N8cwUx)ynGzZxDmEXaXBp(kK-{wMv;dH6z%z=FUd7pt4+r0-h7mr3f|rZG1; z>}keV`JOpFx9@Zk@iG-*d(g;+0Cq4R+&`+Sek<(+BGgBj59l7?EQyq>ggMc+FR>hb zt#)E*4`2^+^tamTCS^HlfId|{(Mr4e1bFsQxyIiKx$DMGe}LJ>LT>zq$U(0a1tu%t z@3Z*!LUFMdO7G0V8Ta=t>&zEAOMlZT-x>H=7=tg*kBPP8_tV%m0I@z~JB`9ly`kKs zD-WYv|e@^Y>c;Su7xh@QfrHiI74$-Pn)NmhpJ6{lDNW%}7UqTMiarn{f_IEdPA&>X6suEP=6Z)1E4{93nF5;%3lGISLhG8V!+EiTRa zh(bQ;BXT|EBSJmmBSJghBVvqq-`qQUZztPPFLssBe|4lsgCt+HRO-Lm>|ZGROYWqc zp&x}5_+i?w#anLZvCf?9dE9U5v_%j|nv?!3VfKmWlC4YV_Jqv2I-PnA$ku~&`o!51 zCr7PR?)skEqS926ofyh8rFti{=vDv# literal 0 HcmV?d00001