diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2b436f40..5cae5cf6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,9 +7,9 @@ on: branches: - master paths-ignore: - - '**.md' - - '**.yml' - - '**.yaml' + - "**.md" + - "**.yml" + - "**.yaml" workflow_dispatch: jobs: @@ -48,17 +48,19 @@ jobs: env: m5stack-core2 - out: makerfabs env: "makerfabs-tft35-cap -e makerfabs-s3-tft35-spi" + - out: panlee + env: "panlee-zw3d95ce01s-ar-4848_16MB -e panlee-zw3d95ce01s-ur-4848_16MB" - out: sunton env: "esp32-2432s028r_4MB -e esp32-3248s035c_4MB -e esp32-3248s035r_4MB -e sunton-4827s043c_16MB -e sunton-8048s043c_16MB -e sunton-8048s050c_16MB -e sunton-8048s070c_16MB" - out: wireless-tag - env: "wt32-sc01_4MB -e wt32-sc01_16MB -e wt-86-32-3zw1 -e wt32-sc01-plus_8MB" + env: "wt32-sc01_4MB -e wt32-sc01_16MB -e wt-86-32-3zw1 -e wt32-sc01-plus_8MB -e wt32-sc01-plus_16MB" - out: yeacreate env: yeacreate-nscreen32 steps: - uses: actions/checkout@v3 with: - submodules: 'true' + submodules: "true" - name: Cache pip uses: actions/cache@v3 with: @@ -74,7 +76,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: "3.x" - name: Install PlatformIO run: | python -m pip install --upgrade pip @@ -123,7 +125,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: 'true' + submodules: "true" - name: Cache pip uses: actions/cache@v3 with: @@ -139,7 +141,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: "3.x" - name: Install PlatformIO run: | python -m pip install --upgrade pip @@ -167,4 +169,4 @@ jobs: sudo apt-get update sudo apt-get install libsdl2-dev - name: Run PlatformIO - run: pio run -e linux_sdl_64bits \ No newline at end of file + run: pio run -e linux_sdl_64bits diff --git a/data/openhasp.ttf b/data/openhasp.ttf index 71e79300..5ea7d28b 100644 Binary files a/data/openhasp.ttf and b/data/openhasp.ttf differ diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index ae545104..23717e20 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -20,8 +20,17 @@ void tftPinInfo(const __FlashStringHelper* pinfunction, int8_t pin) void ArduinoGfx::init(int w, int h) { LOG_TRACE(TAG_TFT, F(D_SERVICE_STARTING)); +#if(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(GC9503V_DRIVER) + Arduino_DataBus* bus = new Arduino_SWSPI(TFT_DC, TFT_CS, TFT_SCLK, TFT_MOSI, TFT_MISO); + Arduino_ESP32RGBPanel* rgbpanel = new Arduino_ESP32RGBPanel( + TFT_DE, TFT_VSYNC, TFT_HSYNC, TFT_PCLK, TFT_R0, TFT_R1, TFT_R2, TFT_R3, TFT_R4, TFT_G0, TFT_G1, TFT_G2, + TFT_G3, TFT_G4, TFT_G5, TFT_B0, TFT_B1, TFT_B2, TFT_B3, TFT_B4, TFT_HSYNC_POLARITY, TFT_HSYNC_FRONT_PORCH, + TFT_HSYNC_PULSE_WIDTH, TFT_HSYNC_BACK_PORCH, TFT_VSYNC_POLARITY, TFT_VSYNC_FRONT_PORCH, + TFT_VSYNC_PULSE_WIDTH, TFT_VSYNC_BACK_PORCH); + tft = new Arduino_RGB_Display(w, h, rgbpanel, 0 /* rotation */, TFT_AUTO_FLUSH, bus, TFT_RST, + gc9503v_type1_init_operations, sizeof(gc9503v_type1_init_operations)); -#if(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) +#elif(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 */, diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 22cd864e..39aca84f 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -27,8 +27,6 @@ File pFileOut; #if ESP32 static SemaphoreHandle_t xGuiSemaphore = NULL; static TaskHandle_t g_lvgl_task_handle; - -esp_err_t gui_setup_lvgl_task(void); #endif #define LVGL_TICK_PERIOD 20 @@ -364,10 +362,6 @@ void guiSetup() if(!xGuiSemaphore) { LOG_FATAL(TAG_GUI, "Create mutex for LVGL failed"); } - gui_acquire(); // Block LVGL until plate is fully booted -#if HASP_USE_LVGL_TASK - gui_setup_lvgl_task(); -#endif // HASP_USE_LVGL_TASK #endif // ESP32 && HASP_USE_ESP_MQTT LOG_INFO(TAG_LVGL, F(D_SERVICE_STARTED)); diff --git a/src/hasp_gui.h b/src/hasp_gui.h index fb2d4d14..3268326d 100644 --- a/src/hasp_gui.h +++ b/src/hasp_gui.h @@ -63,6 +63,9 @@ void gui_antiburn_cb(lv_disp_drv_t* disp, const lv_area_t* area, lv_color_t* col /* ===== Locks ===== */ bool gui_acquire(void); void gui_release(void); +#ifdef ESP32 +esp_err_t gui_setup_lvgl_task(void); +#endif /* ===== Read/Write Configuration ===== */ #if HASP_USE_CONFIG > 0 diff --git a/src/main_arduino.cpp b/src/main_arduino.cpp index 40ab4c21..ac536f5f 100644 --- a/src/main_arduino.cpp +++ b/src/main_arduino.cpp @@ -145,8 +145,11 @@ void setup() mqttSetup(); #endif +#if HASP_USE_LVGL_TASK && defined(ESP32) + gui_setup_lvgl_task(); +#endif // HASP_USE_LVGL_TASK + mainLastLoopTime = -1000; // reset loop counter - gui_release(); } IRAM_ATTR void loop() diff --git a/user_setups/esp32s3/zw3d95ce01s_ar.ini b/user_setups/esp32s3/zw3d95ce01s_ar.ini new file mode 100644 index 00000000..cd441941 --- /dev/null +++ b/user_setups/esp32s3/zw3d95ce01s_ar.ini @@ -0,0 +1,137 @@ +;***************************************************; +; Smart Panlee ZX3D95CE01S with TFT 3.95" ; +; - Custom esp32-s3 board ; +; - gc9503v TFT ; +; - ft6336 touch controller ; +;***************************************************; + +[panlee-zw3d95ce01s] +;board = esp32-s3-devkitc-1 +board = esp32s3_qio_opi + +build_flags = + ${env.build_flags} + ${esp32s3.build_flags} + ${esp32s3.ps_ram} + ;-DARDUINO_USB_CDC_ON_BOOT + ;-DUSE_USB_CDC_CONSOLE + +;region -- LovyanGFX build options ------------------------ + -D HASP_USE_ARDUINOGFX=1 + -D GC9503V_DRIVER=1 + -D TOUCH_DRIVER=0x6336 + -D TFT_WIDTH=480 + -D TFT_HEIGHT=480 + -D TFT_HSYNC_POLARITY=1 + -D TFT_HSYNC_FRONT_PORCH=10 + -D TFT_HSYNC_PULSE_WIDTH=8 + -D TFT_HSYNC_BACK_PORCH=50 + -D TFT_VSYNC_POLARITY=1 + -D TFT_VSYNC_FRONT_PORCH=10 + -D TFT_VSYNC_PULSE_WIDTH=8 + -D TFT_VSYNC_BACK_PORCH=20 + ;-D TFT_PCLK_ACTIVE_NEG=1 + ;-D TFT_PREFER_SPEED=9000000 + -D TFT_AUTO_FLUSH=1 + ; Touch Setttings + -D I2C_TOUCH_FREQUENCY=400000 + -D I2C_TOUCH_ADDRESS=0x38 + -D I2C_TOUCH_PORT=1 +;endregion + +;region -- Library options ------------------------------- +lib_deps = + ${env.lib_deps} + ${esp32s3.lib_deps} + ${arduino_esp32s3_v2.lib_deps} + ;${arduinogfx.lib_deps} + git+https://github.com/moononournation/Arduino_GFX.git + ${ft6336.lib_deps} + +lib_ignore = + ${env.lib_ignore} + ${esp32s3.lib_ignore} + ${arduino_esp32s3_v2.lib_ignore} +;endregion + + +[env:panlee-zw3d95ce01s-ur-4848_16MB] +extends = panlee-zw3d95ce01s, esp32s3_16mb_v2 +build_flags = + ${panlee-zw3d95ce01s.build_flags} + -D HASP_MODEL="ZX3D95CE01S-UR-4848" + -D TOUCH_RST=-1 ; Touch reset GPIO5, multiplexed with LCD reset + -D TOUCH_SCL=6 ; touch I2C bus clock, multiplexed with external interface + -D TOUCH_SDA=15 ; Touch I2C bus data, multiplexed with external interface + -D TOUCH_INT=7 ; Touch interrupt + -D TFT_RST=5 ; LCD reset, multiplexed with touch reset + -D TFT_DC=-1 + -D TFT_CS=38 ; LCD SPI bus CS + -D TFT_SCLK=45 ; LCD SPI bus SCLK + -D TFT_MOSI=48 ; LCD SPI bus MOSI + -D TFT_MISO=-1 ; LCD SPI bus MISO + -D TFT_DE=40 ; LCD RGB interface DE + -D TFT_VSYNC=41 ; LCD RGB interface VS + -D TFT_HSYNC=42 ; LCD RGB interface HS + -D TFT_PCLK=39 ; LCD RGB interface PCLK + -D TFT_B0=45 ; LCD RGB interface D0 + -D TFT_B1=48 ; LCD RGB interface D1 + -D TFT_B2=47 ; LCD RGB interface D2 + -D TFT_B3=21 ; LCD RGB interface D3 + -D TFT_B4=14 ; LCD RGB interface D4 + -D TFT_G0=13 ; LCD RGB interface D5 + -D TFT_G1=12 ; LCD RGB interface D6 + -D TFT_G2=11 ; LCD RGB interface D7 + -D TFT_G3=10 ; LCD RGB interface D8 + -D TFT_G4=16 ; LCD RGB interface D9 + -D TFT_G5=17 ; LCD RGB interface D10 + -D TFT_R0=18 ; LCD RGB interface D11 + -D TFT_R1=8 ; LCD RGB interface D12 + -D TFT_R2=3 ; LCD RGB interface D13 + -D TFT_R3=46 ; LCD RGB interface D14 + -D TFT_R4=9 ; LCD RGB interface D15 + -D TFT_BCKL=4 ; LCD backlight control, high level enable + +[env:panlee-zw3d95ce01s-ar-4848_16MB] +extends = panlee-zw3d95ce01s, esp32s3_16mb_v2 +build_flags = + ${panlee-zw3d95ce01s.build_flags} + -D HASP_MODEL="ZX3D95CE01S-AR-4848" + -D TOUCH_SCL=6 ; touch screen IIC, multiplexed with multiple peripherals + -D TOUCH_SDA=7 ; touch screen IIC, multiplexed with multiple peripherals + -D TOUCH_INT=-1 ; Missed + -D TOUCH_RST=-1 ; Missed + -D TFT_RST=-1 ; RC reset used + -D TFT_DC=-1 + -D TFT_CS=0 ; LCD SPI bus CS + -D TFT_SCLK=10 ; LCD SPI bus SCLK + -D TFT_MOSI=9 ; LCD SPI bus MOSI + -D TFT_MISO=-1 ; LCD SPI bus MISO + -D TFT_DE=13 ; LCD RGB interface DE + -D TFT_VSYNC=12 ; LCD RGB interface VS + -D TFT_HSYNC=11 ; LCD RGB interface HS + -D TFT_PCLK=14 ; LCD RGB interface PCLK + -D TFT_B0=10 ; LCD RGB interface D0 + -D TFT_B1=9 ; LCD RGB interface D1 + -D TFT_B2=40 ; LCD RGB interface D2 + -D TFT_B3=20 ; LCD RGB interface D3 + -D TFT_B4=19 ; LCD RGB interface D4 + -D TFT_G0=41 ; LCD RGB interface D5 + -D TFT_G1=46 ; LCD RGB interface D6 + -D TFT_G2=3 ; LCD RGB interface D7 + -D TFT_G3=42 ; LCD RGB interface D8 + -D TFT_G4=8 ; LCD RGB interface D9 + -D TFT_G5=18 ; LCD RGB interface D10 + -D TFT_R0=2 ; LCD RGB interface D11 + -D TFT_R1=17 ; LCD RGB interface D12 + -D TFT_R2=16 ; LCD RGB interface D13 + -D TFT_R3=1 ; LCD RGB interface D14 + -D TFT_R4=15 ; LCD RGB interface D15 + -D TFT_BCKL=45 ; LCD backlight control, high level enable + -D I2S_MCLK=38 ; I2S bus MCLK + -D I2S_SCLK=48 ; I2S bus SCLK + -D I2S_LRCK=47 ; I2S bus LRCK + -D I2S_SDO=21 ; I2S bus SDO + -D I2S_SDI=39 ; I2S bus SDI + -D I2C_SCL=6 ; I2C bus, used to configure CODEC, multiplexed peripherals + -D I2C_SDA=7 ; I2C bus, used to configure CODEC, multiplexed peripherals \ No newline at end of file