From c08a01eb362668b375082988498aa7e16d3e4de4 Mon Sep 17 00:00:00 2001 From: Ladyada Date: Sat, 31 Aug 2019 00:54:57 -0400 Subject: [PATCH] add initial support (framebuffer creation) --- adafruit-pitft.sh | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/adafruit-pitft.sh b/adafruit-pitft.sh index e8b7c0f..07e9a66 100755 --- a/adafruit-pitft.sh +++ b/adafruit-pitft.sh @@ -75,7 +75,7 @@ selectN() { function print_version() { - echo "Adafruit PiTFT Helper v2.0.0" + echo "Adafruit PiTFT Helper v2.1.0" exit 1 } @@ -220,6 +220,24 @@ function update_configtxt() { overlay="dtoverlay=pitft35-resistive,rotate=${pitftrot},speed=20000000,fps=20" fi + if [ "${pitfttype}" == "st7789_240x240" ]; then + cat >> /etc/modprobe.d/fbtft.conf <> /etc/modules + echo "fbtft_device" >> /etc/modules + echo "spi-bcm2835" >> /etc/modules + overlay="" + else + rm -f /etc/modprobe.d/fbtft.conf + sed -i 's/flexfb//g' "/etc/modules" + sed -i 's/fbtft_device//g' "/etc/modules" + sed -i 's/spi-bcm2835//g' "/etc/modules" + fi + date=`date` @@ -475,9 +493,10 @@ selectN "PiTFT 2.4\", 2.8\" or 3.2\" resistive (240x320)" \ "PiTFT 2.2\" no touch (240x320)" \ "PiTFT 2.8\" capacitive touch (240x320)" \ "PiTFT 3.5\" resistive touch (320x480)" \ + "Braincraft 1.54\" display (240x240)" \ "Quit without installing" PITFT_SELECT=$? -if [ $PITFT_SELECT -gt 4 ]; then +if [ $PITFT_SELECT -gt 5 ]; then exit 1 fi @@ -492,7 +511,7 @@ if [ $PITFT_ROTATE -gt 4 ]; then fi PITFT_ROTATIONS=("90" "180" "270" "0") -PITFT_TYPES=("28r" "22" "28c" "35r") +PITFT_TYPES=("28r" "22" "28c" "35r" "st7789_240x240") WIDTH_VALUES=(320 320 320 480) HEIGHT_VALUES=(240 240 240 320) HZ_VALUES=(64000000 64000000 64000000 32000000) @@ -553,12 +572,13 @@ pitfttype=${PITFT_TYPES[$PITFT_SELECT-1]} pitftrot=${PITFT_ROTATIONS[$PITFT_ROTATE-1]} -if [ "${pitfttype}" != "28r" ] && [ "${pitfttype}" != "28c" ] && [ "${pitfttype}" != "35r" ] && [ "${pitfttype}" != "22" ]; then +if [ "${pitfttype}" != "28r" ] && [ "${pitfttype}" != "28c" ] && [ "${pitfttype}" != "35r" ] && [ "${pitfttype}" != "22" ] && [ "${pitfttype}" != "st7789_240x240" ]; then echo "Type must be one of:" echo " '28r' (2.8\" resistive, PID 1601)" echo " '28c' (2.8\" capacitive, PID 1983)" echo " '35r' (3.5\" Resistive)" echo " '22' (2.2\" no touch)" + echo " 'st7789_240x240' (1.54\" or 1.3\" no touch)" echo print_help fi