Add Sunton S3 4.3"

This commit is contained in:
fvanroie 2022-11-17 01:19:00 +01:00
parent 27207d337a
commit 18a76a0024
9 changed files with 11305 additions and 18 deletions

View File

@ -49,7 +49,7 @@ jobs:
- out: makerfabs
env: "makerfabs-tft35-cap -e makerfabs-s3-tft35-spi"
- out: sunton
env: "esp32-2432s028r_4MB -e esp32-3248s035c_4MB -e esp32-3248s035r_4MB"
env: "esp32-2432s028r_4MB -e esp32-3248s035c_4MB -e esp32-3248s035r_4MB -e esp32-s3-4827s043r_16MB -e esp32-s3-4827s043c_16MB -e esp32-s3-8048s043c_16MB"
- out: wireless-tag
env: "wt32-sc01_4MB -e wt32-sc01_16MB -e wt-86-32-3zw1 -e wt32-sc01-plus_8MB"
- out: yeacreate

5
.gitignore vendored
View File

@ -34,6 +34,11 @@ src/custom/*
!src/custom/my_custom_template.cpp
!src/custom/my_custom_fan_template.cpp
#npm filter
node_modules/*
package.json
package-lock.json
## Test result files
*.xml

View File

@ -121,10 +121,10 @@ typedef int16_t lv_coord_t;
#ifndef LV_VDB_SIZE
#if defined(ARDUINO_ARCH_ESP8266)
# define LV_VDB_SIZE (8 * 1024U) // Minimum 8 Kb
#elif defined(ESP32S2)
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
# define LV_VDB_SIZE (16 * 1024U) // 16kB draw buffer
#elif defined(ESP32S3)
# define LV_VDB_SIZE (32 * 1024U) // 16kB draw buffer
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
# define LV_VDB_SIZE (48 * 1024U) // 16kB draw buffer
#elif defined(ARDUINO_ARCH_ESP32)
# define LV_VDB_SIZE (32 * 1024U) // 32kB draw buffer
#else
@ -376,8 +376,56 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
/*==================
* FONT USAGE
*===================*/
#if TFT_HEIGHT>=480 && TFT_WIDTH>=480
#ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
#define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
#define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_64_LATIN1
#define ROBOTOCONDENSED_REGULAR_64_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
#endif
#if TFT_HEIGHT>=480 || TFT_WIDTH>=480
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_24_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_32_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_48_latin1 /* 10% Width */
#endif
#ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_64_latin1 /* 10% Height */
#endif
#ifndef HASP_FONT_5
#define HASP_FONT_5 robotocondensed_regular_16_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_SIZE_1
#define HASP_FONT_SIZE_1 24
#endif
#ifndef HASP_FONT_SIZE_2
#define HASP_FONT_SIZE_2 32
#endif
#ifndef HASP_FONT_SIZE_3
#define HASP_FONT_SIZE_3 48
#endif
#ifndef HASP_FONT_SIZE_4
#define HASP_FONT_SIZE_4 64
#endif
#ifndef HASP_FONT_SIZE_5
#define HASP_FONT_SIZE_5 16
#endif
#elif TFT_HEIGHT>=320 && TFT_WIDTH>=320
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
#endif
@ -425,7 +473,57 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
#ifndef HASP_FONT_SIZE_5
#define HASP_FONT_SIZE_5 12
#endif
#else // not 320x480
#elif TFT_HEIGHT>=272 && TFT_WIDTH>=272
#ifndef ROBOTOCONDENSED_REGULAR_14_LATIN1
#define ROBOTOCONDENSED_REGULAR_14_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_18_LATIN1
#define ROBOTOCONDENSED_REGULAR_18_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_28_LATIN1
#define ROBOTOCONDENSED_REGULAR_28_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_36_LATIN1
#define ROBOTOCONDENSED_REGULAR_36_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
#endif
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_14_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_18_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_28_latin1 /* 10% Width */
#endif
#ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_36_latin1 /* 10% Height */
#endif
#ifndef HASP_FONT_5
#define HASP_FONT_5 robotocondensed_regular_48_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_SIZE_1
#define HASP_FONT_SIZE_1 14
#endif
#ifndef HASP_FONT_SIZE_2
#define HASP_FONT_SIZE_2 18
#endif
#ifndef HASP_FONT_SIZE_3
#define HASP_FONT_SIZE_3 28
#endif
#ifndef HASP_FONT_SIZE_4
#define HASP_FONT_SIZE_4 36
#endif
#ifndef HASP_FONT_SIZE_5
#define HASP_FONT_SIZE_5 48
#endif
#else // smaller than 272
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_12_latin1 /* 5% Width */

View File

@ -23,21 +23,51 @@ build_flags =
;region -- Default Build Environments : Used when Build All ---
extra_default_envs =
; Uncomment specific environments or create extra:
; az-touch-mod-esp32_ili9341
; az-touch-mod-esp32_ili9341_4MB
; az-touch-mod-esp32_ili9341_8MB
; d1-mini-esp32_ili9341
; d1-r32-unoshield
; esp32-9341-unoshield-analog
; esp12e-st7735
; d1-r32-unoshield_ili9341_adc
; d1-r32-unoshield_ili9486_adc
; d1-r32-waveshare_ili9486
; esp32-2432s028r_4MB
; esp32-3248s035c_4MB
; esp32-3248s035c_4MB_lovyan
; esp32-3248s035r_4MB
; esp32-one_ili9486
; esp32-one_st7796
; esp32dev-mrb3511
; esp32dev-ili9488
; esp32-s3-4827s043c_16MB
; esp32-s3-4827s043r_16MB
; esp32-s3-8048s043c_16MB
; esp32-touchdown
; freetouchdeck_4MB
; freetouchdeck_8MB
; freetouchdeck-s3_8MB
; gs-t3e_16MB
; huzzah32-featherwing-24
; huzzah32-featherwing-35
; lanbon_l8
; lanbon_l8_eth
; lilygo-lily-pi_ili9481
; lilygo-lily-pi_st7796
; lolin-d32-pro_ili9341
; my_custom_build
; m5stack-core2
; m5stack-tough
; makerfabs-s3-tft35-spi
; makerfabs-tft35-cap
; makerfabs-tft-s2_ili9488
; nodemcu32s-raspi
; s2-mini-esp32s2_ili9341
; ttgo_esp32_poe-ili9341
; ttgo-lilygo-pi_ili9481
; wt32-sc01
; ttgo-lilygo-pi_st7796
; ttgo-t7-v1.5_ili9341_16MB
; ttgo-t7-v1.5_ili9341_4MB
; wt32-sc01_16MB
; wt32-sc01_4MB
; wt32-sc01-plus_16MB
; wt32-sc01-plus_8MB
; wt-86-32-3zw1
; yeacreate-nscreen32
;endregion
;region -- Define your local COM ports for each environment ---

View File

@ -21,6 +21,7 @@ void ArduinoGfx::init(int w, int h)
{
LOG_TRACE(TAG_TFT, F(D_SERVICE_STARTING));
#if(TFT_WIDTH == 480) && (TFT_HEIGHT == 480)
/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
Arduino_ESP32RGBPanel* bus = new Arduino_ESP32RGBPanel(
39 /* CS */, 15 /* SCK */, 14 /* SDA */, 18 /* DE */, 17 /* VSYNC */, 16 /* HSYNC */, 21 /* PCLK */, 4 /* R0 */,
@ -31,6 +32,30 @@ void ArduinoGfx::init(int w, int h)
tft = new Arduino_ST7701_RGBPanel(bus, GFX_NOT_DEFINED /* RST */, 0 /* rotation */, true /* IPS */, 480 /* width */,
480 /* height */, st7701_type1_init_operations,
sizeof(st7701_type1_init_operations), true /* BGR */);
#elif 1
Arduino_ESP32RGBPanel* bus = new Arduino_ESP32RGBPanel(
GFX_NOT_DEFINED /* CS */, GFX_NOT_DEFINED /* SCK */, GFX_NOT_DEFINED /* SDA */, 40 /* DE */, 41 /* VSYNC */,
39 /* HSYNC */, 42 /* PCLK */, 45 /* R0 */, 48 /* R1 */, 47 /* R2 */, 21 /* R3 */, 14 /* R4 */, 5 /* G0 */,
6 /* G1 */, 7 /* G2 */, 15 /* G3 */, 16 /* G4 */, 4 /* G5 */, 8 /* B0 */, 3 /* B1 */, 46 /* B2 */, 9 /* B3 */,
1 /* B4 */
);
#if(TFT_WIDTH == 480) && (TFT_HEIGHT == 272)
// ILI6485 LCD 480x272
tft = new Arduino_RPi_DPI_RGBPanel(bus, 480 /* width */, 0 /* hsync_polarity */, 8 /* hsync_front_porch */,
4 /* hsync_pulse_width */, 43 /* hsync_back_porch */, 272 /* height */,
0 /* vsync_polarity */, 8 /* vsync_front_porch */, 4 /* vsync_pulse_width */,
12 /* vsync_back_porch */, 1 /* pclk_active_neg */, 9000000 /* prefer_speed */,
true /* auto_flush */);
#elif(TFT_WIDTH == 800) && (TFT_HEIGHT == 480)
// ST7262 IPS LCD 800x480
tft = new Arduino_RPi_DPI_RGBPanel(bus, 800 /* width */, 0 /* hsync_polarity */, 8 /* hsync_front_porch */,
4 /* hsync_pulse_width */, 8 /* hsync_back_porch */, 480 /* height */,
0 /* vsync_polarity */, 8 /* vsync_front_porch */, 4 /* vsync_pulse_width */,
8 /* vsync_back_porch */, 1 /* pclk_active_neg */, 14000000 /* prefer_speed */,
true /* auto_flush */);
#endif
#endif
/* TFT init */
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);

View File

@ -61,7 +61,6 @@ IRAM_ATTR void GT911_setXY(int8_t contacts, GTPoint* points)
namespace dev {
class TouchGt911 : public BaseTouch {
public:
IRAM_ATTR bool read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
{
@ -72,16 +71,26 @@ class TouchGt911 : public BaseTouch {
if(hasp_sleep_state != HASP_SLEEP_OFF) hasp_update_sleep_state(); // update Idle
#ifdef TOUCH_WIDTH
data->point.x = map(points[0].x, 0, TOUCH_WIDTH - 1, 0, TFT_WIDTH - 1);
#else
data->point.x = points[0].x;
#endif
#ifdef TOUCH_HEIGHT
data->point.y = map(points[0].y, 0, TOUCH_HEIGHT - 1, 0, TFT_HEIGHT - 1);
#else
data->point.y = points[0].y;
data->state = LV_INDEV_STATE_PR;
#endif
data->state = LV_INDEV_STATE_PR;
hasp_set_sleep_offset(0); // Reset the offset
} else {
data->state = LV_INDEV_STATE_REL;
}
// touch.loop(); // reset IRQ (now in readInput)
// touch.loop(); // reset IRQ (now in readInput)
/*Return `false` because we are not buffering and no more data to read*/
return false;

View File

@ -53,7 +53,8 @@
38,
40,
44,
48
48,
64
],
"textfont": "src/font/roboto/RobotoCondensed-Regular.ttf",
"iconfont": "src/font/materialdesignicons-webfont.ttf",

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,113 @@
;***************************************************;
; Sunton ESP32-S3 TFT 4.3" ;
; - Custom esp32-s3 board ;
; - st7701s TFT ;
; - xpt2046 or gt911 touch controller ;
;***************************************************;
[sunton-esp32-s3-s043]
board = esp32s3_qio_opi
build_flags =
${env.build_flags}
${esp32s3.build_flags}
${esp32s3.ps_ram}
; -D HASP_MODEL="Sunton 4.3\""
;-DARDUINO_USB_CDC_ON_BOOT
;-DUSE_USB_CDC_CONSOLE
-DSUNTON_43
;region -- LovyanGFX build options ------------------------
-D HASP_USE_ARDUINOGFX=1
-D TFT_BCKL=2
-D TFT_DE=40
-D TFT_VSYNC=41
-D TFT_HSYNC=39
-D TFT_PCLK=42
-D TFT_R0=45
-D TFT_R1=48
-D TFT_R2=47
-D TFT_R3=21
-D TFT_R4=14
-D TFT_G0=5
-D TFT_G1=6
-D TFT_G2=7
-D TFT_G3=15
-D TFT_G4=16
-D TFT_G5=4
-D TFT_B0=8
-D TFT_B1=3
-D TFT_B2=46
-D TFT_B3=9
-D TFT_B4=1
;endregion
;region -- Library options -------------------------------
lib_deps =
${env.lib_deps}
${esp32s3.lib_deps}
${arduino_esp32s3_v2.lib_deps}
${arduinogfx.lib_deps}
${goodix.lib_deps}
lib_ignore =
${env.lib_ignore}
${esp32s3.lib_ignore}
${arduino_esp32s3_v2.lib_ignore}
;endregion
[env:esp32-s3-4827s043r_16MB]
extends = sunton-esp32-s3-s043, esp32s3_16mb_v2
build_flags =
${sunton-esp32-s3-s043.build_flags}
-D HASP_MODEL="Sunton ESP32-4827S043R"
-D TFT_WIDTH=480
-D TFT_HEIGHT=272
;-D TOUCH_DRIVER=0x2046
-D TOUCH_SCLK=12
-D TOUCH_MISO=13
-D TOUCH_MOSI=11
-D TOUCH_CS=38
-D TOUCH_IRQ=18
[env:esp32-s3-4827s043c_16MB]
extends = sunton-esp32-s3-s043, esp32s3_16mb_v2
build_flags =
${sunton-esp32-s3-s043.build_flags}
-D HASP_MODEL="Sunton ESP32-4827S043C"
-D TFT_WIDTH=480
-D TFT_HEIGHT=272
-D TOUCH_DRIVER=0x911
-D TOUCH_SCL=20
-D TOUCH_SDA=19
-D TOUCH_IRQ=-1
-D TOUCH_RST=38
-D I2C_TOUCH_FREQUENCY=400000
lib_deps =
${sunton-esp32-s3-s043.lib_deps}
${goodix.lib_deps}
[env:esp32-s3-8048s043c_16MB]
extends = sunton-esp32-s3-s043, esp32s3_16mb_v2
build_flags =
${sunton-esp32-s3-s043.build_flags}
-D HASP_MODEL="Sunton ESP32-8048S043C"
-D TFT_WIDTH=800
-D TFT_HEIGHT=480
-D TOUCH_WIDTH=480
-D TOUCH_HEIGHT=272
-D TOUCH_DRIVER=0x911
-D TOUCH_SCL=20
-D TOUCH_SDA=19
-D TOUCH_IRQ=-1
-D TOUCH_RST=38
-D I2C_TOUCH_FREQUENCY=400000
lib_deps =
${sunton-esp32-s3-s043.lib_deps}
${goodix.lib_deps}