Skip to content

Commit

Permalink
Cherry-pick: Meshtab streamline and rotation fixes (#5812)
Browse files Browse the repository at this point in the history
* mesh-tab: streamline target definitions

* mesh-tab: fix touch rotation 4.0 inch display

* Mesh-Tab platformio: 4.0inch: increase SPI frequency to max

* mesh-tab: fix rotation for 3.5 IPS capacitive display

* mesh-tab: fix rotation for 3.2 IPS capacitive display

---------

Co-authored-by: mverch67 <[email protected]>
  • Loading branch information
fifieldt and mverch67 authored Jan 11, 2025
1 parent 46ea39a commit 077ee02
Showing 1 changed file with 41 additions and 96 deletions.
137 changes: 41 additions & 96 deletions variants/mesh-tab/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,10 @@ build_src_filter = ${esp32_base.build_src_filter}
lib_deps = ${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.1.16

; 3.2" TN TFT ST7789 / XPT2046: https://vi.aliexpress.com/item/1005005933490544.html
[env:mesh-tab-3-2-TN-resistive]
[mesh_tab_xpt2046]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D LGFX_SCREEN_WIDTH=240
-D LGFX_SCREEN_HEIGHT=320
-D LGFX_PANEL=ST7789
-D LGFX_INVERT_COLOR=false
-D LGFX_RGB_ORDER=false
-D LGFX_ROTATION=3
-D LGFX_TOUCH=XPT2046
-D SPI_FREQUENCY=60000000
-D LGFX_TOUCH_SPI_FREQ=2500000
-D LGFX_TOUCH_SPI_HOST=2
-D LGFX_TOUCH_CS=7
Expand All @@ -78,156 +70,109 @@ build_flags = ${mesh_tab_base.build_flags}
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900

[mesh_tab_ft5x06]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D LGFX_TOUCH=FT5x06
-D LGFX_TOUCH_I2C_FREQ=400000
-D LGFX_TOUCH_I2C_PORT=0
-D LGFX_TOUCH_I2C_ADDR=0x38
-D LGFX_TOUCH_I2C_SDA=8
-D LGFX_TOUCH_I2C_SCL=9
-D LGFX_TOUCH_RST=7

; 3.2" TN TFT ST7789 / XPT2046: https://vi.aliexpress.com/item/1005005933490544.html
[env:mesh-tab-3-2-TN-resistive]
extends = mesh_tab_base
build_flags = ${mesh_tab_xpt2046.build_flags}
-D SPI_FREQUENCY=60000000
-D LGFX_SCREEN_WIDTH=240
-D LGFX_SCREEN_HEIGHT=320
-D LGFX_PANEL=ST7789
-D LGFX_INVERT_COLOR=false
-D LGFX_ROTATION=3
-D LGFX_TOUCH_ROTATION=4

; 3.2" IPS TFT ILI9341 / XPT2046: https://www.aliexpress.com/item/1005006258575617.html
[env:mesh-tab-3-2-IPS-resistive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
build_flags = ${mesh_tab_xpt2046.build_flags}
-D SPI_FREQUENCY=60000000 ; if image is distorted then lower to 40 MHz
-D LGFX_SCREEN_WIDTH=240
-D LGFX_SCREEN_HEIGHT=320
-D LGFX_PANEL=ILI9341
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_ROTATION=1
-D LGFX_TOUCH=XPT2046
-D SPI_FREQUENCY=60000000 ; if image is distorted then lower to 40 MHz
-D LGFX_TOUCH_SPI_FREQ=2500000
-D LGFX_TOUCH_SPI_HOST=2
-D LGFX_TOUCH_CS=7
-D LGFX_TOUCH_CLK=12
-D LGFX_TOUCH_DO=11
-D LGFX_TOUCH_DIN=13
-D LGFX_TOUCH_X_MIN=300
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900
-D LGFX_TOUCH_ROTATION=4

; 3.5" IPS TFT ILI9488 / XPT2046: https://vi.aliexpress.com/item/1005006333922639.html
[env:mesh-tab-3-5-IPS-resistive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
build_flags = ${mesh_tab_xpt2046.build_flags}
-D SPI_FREQUENCY=60000000 ; may go higher upto 40/60/80 MHz
-D DISPLAY_SET_RESOLUTION
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
-D LGFX_PANEL=ILI9488
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_DLEN_16BITS=false
-D LGFX_ROTATION=0
-D LGFX_TOUCH=XPT2046
-D SPI_FREQUENCY=40000000 ; may go higher upto 40/60/80 MHz
-D LGFX_TOUCH_SPI_FREQ=2500000
-D LGFX_TOUCH_SPI_HOST=2
-D LGFX_TOUCH_CS=7
-D LGFX_TOUCH_CLK=12
-D LGFX_TOUCH_DO=11
-D LGFX_TOUCH_DIN=13
-D LGFX_TOUCH_X_MIN=300
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900
-D LGFX_TOUCH_ROTATION=0

; 3.5" TN TFT ILI9488 / XPT2046: https://vi.aliexpress.com/item/32985467436.html
[env:mesh-tab-3-5-TN-resistive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
build_flags = ${mesh_tab_xpt2046.build_flags}
-D SPI_FREQUENCY=60000000
-D DISPLAY_SET_RESOLUTION
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
-D LGFX_PANEL=HX8357B
-D SPI_FREQUENCY=60000000
-D LGFX_INVERT_COLOR=false
-D LGFX_RGB_ORDER=false
-D LGFX_DLEN_16BITS=false
-D LGFX_ROTATION=4
-D LGFX_TOUCH=XPT2046
-D LGFX_TOUCH_SPI_FREQ=2500000
-D LGFX_TOUCH_SPI_HOST=2
-D LGFX_TOUCH_CS=7
-D LGFX_TOUCH_CLK=12
-D LGFX_TOUCH_DO=11
-D LGFX_TOUCH_DIN=13
-D LGFX_TOUCH_X_MIN=300
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900
-D LGFX_TOUCH_ROTATION=2

; 3.2" IPS TFT ILI9341 / FT6236: https://vi.aliexpress.com/item/1005006624072350.html
[env:mesh-tab-3-2-IPS-capacitive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
build_flags = ${mesh_tab_ft5x06.build_flags}
-D SPI_FREQUENCY=75000000 ; may go higher upto 60/80 MHz
-D LGFX_SCREEN_WIDTH=240
-D LGFX_SCREEN_HEIGHT=320
-D LGFX_PANEL=ILI9341
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_ROTATION=1
-D LGFX_TOUCH=FT5x06
-D SPI_FREQUENCY=40000000 ; may go higher upto 60/80 MHz
-D LGFX_TOUCH_I2C_PORT=0
-D LGFX_TOUCH_I2C_ADDR=0x38
-D LGFX_TOUCH_I2C_SDA=8
-D LGFX_TOUCH_I2C_SCL=9
-D LGFX_TOUCH_RST=7
-D LGFX_TOUCH_X_MIN=0
-D LGFX_TOUCH_X_MAX=319
-D LGFX_TOUCH_X_MAX=239
-D LGFX_TOUCH_Y_MIN=0
-D LGFX_TOUCH_Y_MAX=479
-D LGFX_TOUCH_ROTATION=0
-D LGFX_TOUCH_I2C_FREQ=400000
-D LGFX_TOUCH_Y_MAX=319
-D LGFX_TOUCH_ROTATION=2

; 3.5" IPS TFT ILI9488 / FT6236: https://vi.aliexpress.com/item/1005006893699919.html
[env:mesh-tab-3-5-IPS-capacitive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
build_flags = ${mesh_tab_ft5x06.build_flags}
-D SPI_FREQUENCY=75000000 ; may go higher upto 40/60/80 MHz
-D DISPLAY_SET_RESOLUTION
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
-D LGFX_PANEL=ILI9488
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_DLEN_16BITS=false
-D LGFX_ROTATION=1
-D LGFX_TOUCH=FT5x06
-D SPI_FREQUENCY=30000000 ; may go higher upto 40/60/80 MHz
-D LGFX_TOUCH_I2C_PORT=0
-D LGFX_TOUCH_I2C_ADDR=0x38
-D LGFX_TOUCH_I2C_SDA=8
-D LGFX_TOUCH_I2C_SCL=9
-D LGFX_TOUCH_RST=7
-D LGFX_ROTATION=2
-D LGFX_TOUCH_X_MIN=0
-D LGFX_TOUCH_X_MAX=319
-D LGFX_TOUCH_Y_MIN=0
-D LGFX_TOUCH_Y_MAX=479
-D LGFX_TOUCH_ROTATION=1
-D LGFX_TOUCH_I2C_FREQ=400000
-D LGFX_TOUCH_ROTATION=0

; 4.0" IPS TFT ILI9488 / FT6236: https://vi.aliexpress.com/item/1005007082906950.html
[env:mesh-tab-4-0-IPS-capacitive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
build_flags = ${mesh_tab_ft5x06.build_flags}
-D SPI_FREQUENCY=75000000
-D DISPLAY_SET_RESOLUTION
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
-D LGFX_PANEL=HX8357B
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_DLEN_16BITS=false
-D LGFX_ROTATION=4
-D LGFX_TOUCH=FT5x06
-D SPI_FREQUENCY=30000000 ; may go higher upto 40/60/80 MHz
-D LGFX_TOUCH_I2C_PORT=0
-D LGFX_TOUCH_I2C_ADDR=0x38
-D LGFX_TOUCH_I2C_SDA=8
-D LGFX_TOUCH_I2C_SCL=9
-D LGFX_TOUCH_RST=7
-D LGFX_TOUCH_X_MIN=0
-D LGFX_TOUCH_X_MAX=319
-D LGFX_TOUCH_Y_MIN=0
-D LGFX_TOUCH_Y_MAX=479
-D LGFX_TOUCH_ROTATION=1
-D LGFX_TOUCH_I2C_FREQ=400000
-D LGFX_TOUCH_ROTATION=6

0 comments on commit 077ee02

Please sign in to comment.