Merge pull request #73 from makermelissa/master

Added 240x240 MADCTL injection based on rotation selection
This commit is contained in:
Melissa LeBlanc-Williams 2020-02-05 17:49:42 -08:00 committed by GitHub
commit c9d0ee84ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,6 +47,10 @@ TRANSFORM_28c90="0 1 0 -1 0 1 0 0 1"
TRANSFORM_28c180="1 0 0 0 1 0 0 0 1"
TRANSFORM_28c270="0 -1 1 1 0 0 0 0 1"
MADCTL_st7789_240x2400="0x36,0x60,-1,0x37,0x00,0x00,-1"
MADCTL_st7789_240x24090="0x36,0x00,-1,0x37,0x00,0x00,-1"
MADCTL_st7789_240x240180="0x36,0xA0,-1,0x37,0x00,0x50,-1"
MADCTL_st7789_240x240270="0x36,0xC0,-1,0x37,0x00,0x50,-1"
warning() {
echo WARNING : $1
@ -228,10 +232,11 @@ function update_configtxt() {
fi
if [ "${pitfttype}" == "st7789_240x240" ]; then
madctl=$(eval echo "\$MADCTL_$pitfttype$pitftrot")
cat >> /etc/modprobe.d/fbtft.conf <<EOF
# --- added by adafruit-pitft-helper $date ---
options fbtft_device name=flexfb gpios=dc:25,cs:8,led:26 speed=40000000 bgr=1 fps=60
options flexfb setaddrwin=0 width=240 height=240 init=-1,0x11,-2,120,-1,0x36,0x00,-1,0x3A,0x05,-1,0xB2,0x0C,0x0C,0x00,0x33,0x33,-1,0xB7,0x35,-1,0xBB,0x1A,-1,0xC0,0x2C,-1,0xC2,0x01,-1,0xC3,0x0B,-1,0xC4,0x20,-1,0xC6,0x0F,-1,0xD0,0xA4,0xA1,-1,0x21,-1,0xE0,0x00,0x19,0x1E,0x0A,0x09,0x15,0x3D,0x44,0x51,0x12,0x03,0x00,0x3F,0x3F,-1,0xE1,0x00,0x18,0x1E,0x0A,0x09,0x25,0x3F,0x43,0x52,0x33,0x03,0x00,0x3F,0x3F,-1,0x29,-3
options flexfb setaddrwin=0 width=240 height=240 init=-1,0x11,-2,120,-1,$madctl,0x3A,0x05,-1,0xB2,0x0C,0x0C,0x00,0x33,0x33,-1,0xB7,0x35,-1,0xBB,0x1A,-1,0xC0,0x2C,-1,0xC2,0x01,-1,0xC3,0x0B,-1,0xC4,0x20,-1,0xC6,0x0F,-1,0xD0,0xA4,0xA1,-1,0x21,-1,0xE0,0x00,0x19,0x1E,0x0A,0x09,0x15,0x3D,0x44,0x51,0x12,0x03,0x00,0x3F,0x3F,-1,0xE1,0x00,0x18,0x1E,0x0A,0x09,0x25,0x3F,0x43,0x52,0x33,0x03,0x00,0x3F,0x3F,-1,0x29,-3
# --- end adafruit-pitft-helper $date ---
EOF
echo "spi-bcm2835" >> /etc/modules