diff --git a/README.md b/README.md index 689684e..6812cc1 100644 --- a/README.md +++ b/README.md @@ -1421,7 +1421,7 @@ The following libraries are used from the EspressIf registry: | Name | Version | |--- |--- | | [ESP LCD ILI9341](https://components.espressif.com/api/download/?object_type=component&object_id=680fe7b6-c70b-4560-acf9-919e5b8fa192) | v2.0 | -| [ESP LCD ST7796](https://components.espressif.com/api/download/?object_type=component&object_id=bdf53b24-6f59-4ab5-b92e-89ff0e94d307) | v1.2 | +| [ESP LCD ST7796](https://components.espressif.com/api/download/?object_type=component&object_id=eb6095d1-642a-4e14-9daf-d46db8a1f354) | v1.2.1 | | [ESP LCD CG9A01](https://components.espressif.com/api/download/?object_type=component&object_id=6f06ecdf-97a6-4eea-ad4f-c00d11bd970a) | v1.2 | | [ESP LCD Touch](https://components.espressif.com/api/download/?object_type=component&object_id=bb4a4d94-2827-4695-84d1-1b53383b8001) | v1.1.1 | | [ESP LCD Touch CST816S](https://components.espressif.com/api/download/?object_type=component&object_id=cc8ef108-15e8-48cf-9be8-3c7e89ca493e) | v1.0.3 | diff --git a/boards/ESP32-1732S019C.json b/boards/ESP32-1732S019C.json index 378ecc5..044a345 100644 --- a/boards/ESP32-1732S019C.json +++ b/boards/ESP32-1732S019C.json @@ -27,6 +27,7 @@ "-DPANEL_MIRROR_Y=false", "-DPANEL_GAP_X=35", "-DPANEL_GAP_Y=0", + "-DHAS_TOUCH", "-DUSES_GT911", "-DGT911_I2C_HOST=0", "-DGT911_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=9,.scl_io_num=46,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/boards/ESP32-2424S012C.json b/boards/ESP32-2424S012C.json index f9db301..1968c3a 100644 --- a/boards/ESP32-2424S012C.json +++ b/boards/ESP32-2424S012C.json @@ -21,6 +21,7 @@ "-DPANEL_SWAP_XY=false", "-DPANEL_MIRROR_X=true", "-DPANEL_MIRROR_Y=false", + "-DHAS_TOUCH", "-DUSES_CST816S", "-DCST816S_I2C_HOST=0", "-DCST816S_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=4,.scl_io_num=5,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/boards/ESP32-2432S024C.json b/boards/ESP32-2432S024C.json index 77e63e4..852c4a3 100644 --- a/boards/ESP32-2432S024C.json +++ b/boards/ESP32-2432S024C.json @@ -18,6 +18,7 @@ "-DPANEL_SWAP_XY=false", "-DPANEL_MIRROR_X=true", "-DPANEL_MIRROR_Y=false", + "-DHAS_TOUCH", "-DUSES_CST816S", "-DCST816S_I2C_HOST=0", "-DCST816S_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=33,.scl_io_num=32,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/boards/ESP32-2432S024R.json b/boards/ESP32-2432S024R.json index f78b32a..1b4d0e8 100644 --- a/boards/ESP32-2432S024R.json +++ b/boards/ESP32-2432S024R.json @@ -18,6 +18,7 @@ "-DPANEL_SWAP_XY=false", "-DPANEL_MIRROR_X=true", "-DPANEL_MIRROR_Y=false", + "-DHAS_TOUCH", "-DUSES_XPT2046", "-DXPT2046_SPI_HOST=SPI2_HOST", "-DXPT2046_SPI_BUS_CONFIG={.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1}", diff --git a/boards/ESP32-2432S028R.json b/boards/ESP32-2432S028R.json index 253dec8..0ddcb19 100644 --- a/boards/ESP32-2432S028R.json +++ b/boards/ESP32-2432S028R.json @@ -18,6 +18,7 @@ "-DPANEL_SWAP_XY=false", "-DPANEL_MIRROR_X=true", "-DPANEL_MIRROR_Y=false", + "-DHAS_TOUCH", "-DUSES_XPT2046", "-DXPT2046_SPI_HOST=SPI3_HOST", "-DXPT2046_SPI_BUS_CONFIG={.mosi_io_num=32,.miso_io_num=39,.sclk_io_num=25,.quadwp_io_num=-1,.quadhd_io_num=-1}", diff --git a/boards/ESP32-2432S032C.json b/boards/ESP32-2432S032C.json index 3aa0fec..6a68abc 100644 --- a/boards/ESP32-2432S032C.json +++ b/boards/ESP32-2432S032C.json @@ -18,6 +18,7 @@ "-DPANEL_SWAP_XY=false", "-DPANEL_MIRROR_X=true", "-DPANEL_MIRROR_Y=false", + "-DHAS_TOUCH", "-DUSES_GT911", "-DGT911_I2C_HOST=0", "-DGT911_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=33,.scl_io_num=32,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/boards/ESP32-2432S032R.json b/boards/ESP32-2432S032R.json index 5681867..45db7fb 100644 --- a/boards/ESP32-2432S032R.json +++ b/boards/ESP32-2432S032R.json @@ -18,6 +18,7 @@ "-DPANEL_SWAP_XY=false", "-DPANEL_MIRROR_X=true", "-DPANEL_MIRROR_Y=false", + "-DHAS_TOUCH", "-DUSES_XPT2046", "-DXPT2046_SPI_HOST=SPI2_HOST", "-DXPT2046_SPI_BUS_CONFIG={.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1}", diff --git a/boards/ESP32-3248S035C.json b/boards/ESP32-3248S035C.json index f5938eb..0a24c50 100644 --- a/boards/ESP32-3248S035C.json +++ b/boards/ESP32-3248S035C.json @@ -18,6 +18,7 @@ "-DPANEL_SWAP_XY=false", "-DPANEL_MIRROR_X=true", "-DPANEL_MIRROR_Y=false", + "-DHAS_TOUCH", "-DUSES_GT911", "-DGT911_I2C_HOST=0", "-DGT911_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=33,.scl_io_num=32,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/boards/ESP32-3248S035R.json b/boards/ESP32-3248S035R.json index a1d0615..d00142d 100644 --- a/boards/ESP32-3248S035R.json +++ b/boards/ESP32-3248S035R.json @@ -18,6 +18,7 @@ "-DPANEL_SWAP_XY=false", "-DPANEL_MIRROR_X=true", "-DPANEL_MIRROR_Y=false", + "-DHAS_TOUCH", "-DUSES_XPT2046", "-DXPT2046_SPI_HOST=SPI2_HOST", "-DXPT2046_SPI_BUS_CONFIG={.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1}", diff --git a/boards/ESP32-4827S043C.json b/boards/ESP32-4827S043C.json index 19f5078..f3177a6 100644 --- a/boards/ESP32-4827S043C.json +++ b/boards/ESP32-4827S043C.json @@ -20,6 +20,7 @@ "-DUSES_PARALLEL_16", "-DTFT_RGB_CONFIG={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14},.flags={.fb_in_psram=1}}", "-DTFT_RGB_CONFIG_COLOR_16_SWAP={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7},.flags={.fb_in_psram=1}}", + "-DHAS_TOUCH", "-DUSES_GT911", "-DGT911_I2C_HOST=0", "-DGT911_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=19,.scl_io_num=20,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/boards/ESP32-4827S043R.json b/boards/ESP32-4827S043R.json index 4600da8..8c51083 100644 --- a/boards/ESP32-4827S043R.json +++ b/boards/ESP32-4827S043R.json @@ -20,6 +20,7 @@ "-DUSES_PARALLEL_16", "-DTFT_RGB_CONFIG={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14},.flags={.fb_in_psram=1}}", "-DTFT_RGB_CONFIG_COLOR_16_SWAP={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7},.flags={.fb_in_psram=1}}", + "-DHAS_TOUCH", "-DUSES_XPT2046", "-DXPT2046_SPI_HOST=SPI2_HOST", "-DXPT2046_SPI_BUS_CONFIG={.mosi_io_num=11,.miso_io_num=13,.sclk_io_num=12,.quadwp_io_num=-1,.quadhd_io_num=-1}", diff --git a/boards/ESP32-8048S043C.json b/boards/ESP32-8048S043C.json index 265fe39..5cc1b58 100644 --- a/boards/ESP32-8048S043C.json +++ b/boards/ESP32-8048S043C.json @@ -20,6 +20,7 @@ "-DUSES_PARALLEL_16", "-DTFT_RGB_CONFIG={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14},.flags={.fb_in_psram=1}}", "-DTFT_RGB_CONFIG_COLOR_16_SWAP={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7},.flags={.fb_in_psram=1}}", + "-DHAS_TOUCH", "-DUSES_GT911", "-DGT911_I2C_HOST=0", "-DGT911_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=19,.scl_io_num=20,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/boards/ESP32-8048S043R.json b/boards/ESP32-8048S043R.json index 3ed7467..69b99d6 100644 --- a/boards/ESP32-8048S043R.json +++ b/boards/ESP32-8048S043R.json @@ -20,6 +20,7 @@ "-DUSES_PARALLEL_16", "-DTFT_RGB_CONFIG={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14},.flags={.fb_in_psram=1}}", "-DTFT_RGB_CONFIG_COLOR_16_SWAP={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7},.flags={.fb_in_psram=1}}", + "-DHAS_TOUCH", "-DUSES_XPT2046", "-DXPT2046_SPI_HOST=SPI2_HOST", "-DXPT2046_SPI_BUS_CONFIG={.mosi_io_num=11,.miso_io_num=13,.sclk_io_num=12,.quadwp_io_num=-1,.quadhd_io_num=-1}", diff --git a/boards/ESP32-8048S050C.json b/boards/ESP32-8048S050C.json index bb90f29..c189f79 100644 --- a/boards/ESP32-8048S050C.json +++ b/boards/ESP32-8048S050C.json @@ -20,6 +20,7 @@ "-DUSES_PARALLEL_16", "-DTFT_RGB_CONFIG={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14},.flags={.fb_in_psram=1}}", "-DTFT_RGB_CONFIG_COLOR_16_SWAP={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7},.flags={.fb_in_psram=1}}", + "-DHAS_TOUCH", "-DUSES_GT911", "-DGT911_I2C_HOST=0", "-DGT911_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=19,.scl_io_num=20,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/boards/ESP32-8048S050R.json b/boards/ESP32-8048S050R.json index 398bcff..4460b0a 100644 --- a/boards/ESP32-8048S050R.json +++ b/boards/ESP32-8048S050R.json @@ -20,6 +20,7 @@ "-DUSES_PARALLEL_16", "-DTFT_RGB_CONFIG={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14},.flags={.fb_in_psram=1}}", "-DTFT_RGB_CONFIG_COLOR_16_SWAP={.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.data_gpio_nums={15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7},.flags={.fb_in_psram=1}}", + "-DHAS_TOUCH", "-DUSES_XPT2046", "-DXPT2046_SPI_HOST=SPI2_HOST", "-DXPT2046_SPI_BUS_CONFIG={.mosi_io_num=11,.miso_io_num=13,.sclk_io_num=12,.quadwp_io_num=-1,.quadhd_io_num=-1}", diff --git a/boards/ESP32-8048S070C.json b/boards/ESP32-8048S070C.json index bf33bb0..9d12d8f 100644 --- a/boards/ESP32-8048S070C.json +++ b/boards/ESP32-8048S070C.json @@ -27,6 +27,7 @@ "-DXPT2046_TOUCH_CONFIG={.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_18}", "-DTOUCH_ROT_SWAP_X=false", "-DTOUCH_ROT_SWAP_Y=false", + "-DHAS_TOUCH", "-DUSES_GT911", "-DGT911_I2C_HOST=0", "-DGT911_I2C_CONFIG={.mode=I2C_MODE_MASTER,.sda_io_num=19,.scl_io_num=20,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}}", diff --git a/include/esp32_smartdisplay.h b/include/esp32_smartdisplay.h index 74ea152..7f4ac84 100644 --- a/include/esp32_smartdisplay.h +++ b/include/esp32_smartdisplay.h @@ -4,17 +4,6 @@ #include #include -#if 0 -// Push button -#define BUTTON_BOOT 0 -// TF Card -#define HAS_TF_CARD -#define TF_PIN_CS 5 -#define TF_PIN_MOSI 23 -#define TF_PIN_SCLK 18 -#define TF_PIN_MISO 19 -#endif - // LVGL lines buffered #define LVGL_PIXEL_BUFFER_LINES 16 @@ -25,422 +14,6 @@ #define PWM_BITS_BCKL 8 #define PWM_MAX_BCKL ((1 << PWM_BITS_BCKL) - 1) -#if 0 -// ESP32_1732S019 N/C -#if defined(ESP32_1732S019N) || defined(ESP32_1732S019C) -#define TFT_WIDTH 170 -#define TFT_HEIGHT 320 -// Backlight -#define PIN_BCKL 14 -// LCD -#define USES_ST7789 -#define ST7789_SPI_HOST SPI2_HOST -#define ST7789_SPI_BUS_CONFIG {.mosi_io_num=13,.sclk_io_num=12,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define ST7789_IO_SPI_CONFIG {.cs_gpio_num=10,.dc_gpio_num=11,.spi_mode=SPI_MODE0,.pclk_hz=24000000,.trans_queue_depth=10,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define ST7789_PANEL_DEV_CONFIG {.reset_gpio_num=1,.color_space=ESP_LCD_COLOR_SPACE_RGB,.bits_per_pixel=16} -#define PANEL_SWAP_XY false -#define PANEL_MIRROR_X false -#define PANEL_MIRROR_Y false -#define PANEL_GAP_X 35 -#define PANEL_GAP_Y 0 -#ifdef ESP32_1732S019C -#define USES_GT911 -#include "esp_lcd_touch_gt911.h" -#define GT911_I2C_HOST 0 -#define GT911_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=9,.scl_io_num=46,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}} -#define GT911_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=16,.flags={.disable_control_phase=1}} -#define GT911_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_3,.int_gpio_num=GPIO_NUM_8} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -#endif - -#if 0 -// ESP32_2424S012 N/C -#if defined(ESP32_2424S012N) || defined(ESP32_2424S012C) -#define TFT_WIDTH 240 -#define TFT_HEIGHT 240 -// Backlight -#define PIN_BCKL 3 -// LCD -#define USES_GC9A01 -#define GC9A01_SPI_HOST SPI2_HOST -#define GC9A01_SPI_BUS_CONFIG {.mosi_io_num=7,.miso_io_num=-1,.sclk_io_num=6,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define GC9A01_IO_SPI_CONFIG {.cs_gpio_num=10,.dc_gpio_num=2,.spi_mode=SPI_MODE0,.pclk_hz=80000000,.trans_queue_depth=10,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define GC9A01_PANEL_DEV_CONFIG {.reset_gpio_num=-1,.color_space=ESP_LCD_COLOR_SPACE_BGR,.bits_per_pixel=16} -#define PANEL_SWAP_XY false -#define PANEL_MIRROR_X true -#define PANEL_MIRROR_Y false -// Touch -#ifdef ESP32_2424S012C -#define USES_CST816S -#include "esp_lcd_touch_cst816s.h" -#define CST816S_I2C_HOST 0 -#define CST816S_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=4,.scl_io_num=5,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={ .clk_speed=400000}} -#define CST816S_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=8,.flags={.disable_control_phase=1}} -#define CST816S_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_1,.int_gpio_num=GPIO_NUM_0} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -#endif - -#if 0 -// ESP32_2432S024 N/R/C -#if defined(ESP32_2432S024N) || defined(ESP32_2432S024R) || defined(ESP32_2432S024C) -#define TFT_WIDTH 240 -#define TFT_HEIGHT 320 -// Backlight -#define PIN_BCKL 27 -// LCD -#define USES_ILI9341 -#define ILI9341_SPI_HOST SPI2_HOST -#define ILI9341_SPI_BUS_CONFIG {.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define ILI9341_IO_SPI_CONFIG {.cs_gpio_num=15,.dc_gpio_num=2,.spi_mode=SPI_MODE0,.pclk_hz=24000000,.trans_queue_depth=10,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define ILI9341_PANEL_DEV_CONFIG {.reset_gpio_num=-1,.color_space=ESP_LCD_COLOR_SPACE_BGR,.bits_per_pixel=16} -#define PANEL_SWAP_XY false -#define PANEL_MIRROR_X true -#define PANEL_MIRROR_Y false -// Touch -#ifdef ESP32_2432S024R -#define USES_XPT2046 -#define XPT2046_SPI_HOST SPI2_HOST -#define XPT2046_SPI_BUS_CONFIG {.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define XPT2046_IO_SPI_CONFIG {.cs_gpio_num=33,.dc_gpio_num=-1,.spi_mode=SPI_MODE0,.pclk_hz=2000000,.trans_queue_depth=3,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define XPT2046_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_36} -#define TOUCH_ROT_SWAP_X true -#define TOUCH_ROT_SWAP_Y false -#else -#ifdef ESP32_2432S024C -#define USES_CST816S -#include "esp_lcd_touch_cst816s.h" -#define CST816S_I2C_HOST 0 -#define CST816S_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=33,.scl_io_num=32,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}} -#define CST816S_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=8,.flags={.disable_control_phase=1}} -#define CST816S_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_25,.int_gpio_num=GPIO_NUM_NC} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -// Build in RGB LED -#define HAS_RGB_LED -#define LED_R 4 -#define LED_G 16 -#define LED_B 17 -// Photo resistor -#define HAS_LIGHTSENSOR -#define LIGHTSENSOR_IN 34 // ANALOG_PIN_0 -// Audio out -#define HAS_SPEAK -#define SPEAKER 26 -#endif -#endif - -#if 0 -// ESP32_2432S028 R -#ifdef ESP32_2432S028R -#define TFT_WIDTH 240 -#define TFT_HEIGHT 320 -// Backlight -#define PIN_BCKL 21 -// LCD -#define USES_ILI9341 -#define ILI9341_SPI_HOST SPI2_HOST -#define ILI9341_SPI_BUS_CONFIG {.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define ILI9341_IO_SPI_CONFIG {.cs_gpio_num=15,.dc_gpio_num=2,.spi_mode=SPI_MODE0,.pclk_hz=24000000,.trans_queue_depth=10,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define ILI9341_PANEL_DEV_CONFIG {.reset_gpio_num=-1,.color_space=ESP_LCD_COLOR_SPACE_BGR,.bits_per_pixel=16} -#define PANEL_SWAP_XY false -#define PANEL_MIRROR_X true -#define PANEL_MIRROR_Y false -// Touch -#define USES_XPT2046 -#define XPT2046_SPI_HOST SPI3_HOST -#define XPT2046_SPI_BUS_CONFIG {.mosi_io_num=32,.miso_io_num=39,.sclk_io_num=25,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define XPT2046_IO_SPI_CONFIG {.cs_gpio_num=33,.dc_gpio_num=-1,.spi_mode=SPI_MODE0,.pclk_hz=2000000,.trans_queue_depth=3,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define XPT2046_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_36} -#define TOUCH_ROT_SWAP_X true -#define TOUCH_ROT_SWAP_Y false -// Build in RGB LED -#define HAS_RGB_LED -#define LED_R 4 -#define LED_G 16 -#define LED_B 17 -// Photo resistor -#define HAS_LIGHTSENSOR -#define LIGHTSENSOR_IN 34 // ANALOG_PIN_0 -// Audio out -#define HAS_SPEAK -#define SPEAKER 26 -#endif -#endif - -#if 0 -// ESP32_2432S032 N/R/C -#if defined(ESP32_2432S032N) || defined(ESP32_2432S032R) || defined(ESP32_2432S032C) -#define TFT_WIDTH 240 -#define TFT_HEIGHT 320 -// Backlight -#define PIN_BCKL 27 -// LCD -#define USES_ST7796 -#define ST7796_SPI_HOST SPI2_HOST -#define ST7796_SPI_BUS_CONFIG {.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define ST7796_IO_SPI_CONFIG {.cs_gpio_num=15,.dc_gpio_num=2,.spi_mode=SPI_MODE0,.pclk_hz=24000000,.trans_queue_depth=10,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define ST7796_PANEL_DEV_CONFIG {.reset_gpio_num=-1,.color_space=ESP_LCD_COLOR_SPACE_BGR,.bits_per_pixel=16} -#define PANEL_SWAP_XY false -#define PANEL_MIRROR_X true -#define PANEL_MIRROR_Y false -// Touch -#ifdef ESP32_2432S032R -#define USES_XPT2046 -#define XPT2046_SPI_HOST SPI2_HOST -// Do not initialize the bus: already done by the ST7796 -#define XPT2046_SPI_BUS_CONFIG {.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define XPT2046_IO_SPI_CONFIG {.cs_gpio_num=33,.dc_gpio_num=-1,.spi_mode=SPI_MODE0,.pclk_hz=2000000,.trans_queue_depth=3,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define XPT2046_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_36} -#define TOUCH_ROT_SWAP_X true -#define TOUCH_ROT_SWAP_Y false -#else -#ifdef ESP32_2432S032C -#define USES_GT911 -#include "esp_lcd_touch_gt911.h" -#define GT911_I2C_HOST 0 -#define GT911_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=33,.scl_io_num=32,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}} -#define GT911_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=16,.flags={.disable_control_phase=1}} -#define GT911_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_25,.int_gpio_num=GPIO_NUM_NC} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -// Build in RGB LED -#define HAS_RGB_LED -#define LED_R 4 -#define LED_G 16 -#define LED_B 17 -// Photo resistor -#define HAS_LIGHTSENSOR -#define LIGHTSENSOR_IN 34 // ANALOG_PIN_0 -// Audio out -#define HAS_SPEAK -#define SPEAKER 26 -#endif -#endif - -#if 0 -// ESP32_3248S035 R/C -#if defined(ESP32_3248S035R) || defined(ESP32_3248S035C) -#define TFT_WIDTH 320 -#define TFT_HEIGHT 480 -// Backlight -#define PIN_BCKL 27 -// LCD -#define USES_ST7796 -#define ST7796_SPI_HOST SPI2_HOST -#define ST7796_SPI_BUS_CONFIG {.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define ST7796_IO_SPI_CONFIG {.cs_gpio_num=15,.dc_gpio_num=2,.spi_mode=SPI_MODE0,.pclk_hz=24000000,.trans_queue_depth=10,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define ST7796_PANEL_DEV_CONFIG {.reset_gpio_num=-1,.color_space=ESP_LCD_COLOR_SPACE_BGR,.bits_per_pixel=16} -#define PANEL_SWAP_XY false -#define PANEL_MIRROR_X true -#define PANEL_MIRROR_Y false -// Touch -#ifdef ESP32_3248S035R -#define USES_XPT2046 -#define XPT2046_SPI_HOST SPI2_HOST -// Do not initialize the bus; already done by the ST7796 -#define XPT2046_SPI_BUS_CONFIG {.mosi_io_num=13,.miso_io_num=12,.sclk_io_num=14,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define XPT2046_IO_SPI_CONFIG {.cs_gpio_num=33,.dc_gpio_num=-1,.spi_mode=SPI_MODE0,.pclk_hz=2000000,.trans_queue_depth=3,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define XPT2046_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_36} -#define TOUCH_ROT_SWAP_X true -#define TOUCH_ROT_SWAP_Y false -#else -#ifdef ESP32_3248S035C -#define USES_GT911 -#include "esp_lcd_touch_gt911.h" -#define GT911_I2C_HOST 0 -#define GT911_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=33,.scl_io_num=32,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}} -#define GT911_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=16,.flags={.disable_control_phase=1}} -#define GT911_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_25,.int_gpio_num=GPIO_NUM_NC} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -// Build in RGB LED -#define HAS_RGB_LED -#define LED_R 4 -#define LED_G 16 -#define LED_B 17 -// Photo resistor -#define HAS_LIGHTSENSOR -#define LIGHTSENSOR_IN 34 // ANALOG_PIN_0 -// Audio out -#define HAS_SPEAK -#define SPEAKER 26 -#endif -#endif - -#if 0 -// ESP32_4827S043 N/R/C -#if defined(ESP32_4827S043N) || defined(ESP32_4827S043R) || defined(ESP32_4827S043C) -#define TFT_WIDTH 480 -#define TFT_HEIGHT 272 -// Backlight -#define PIN_BCKL 2 -// LCD ILI6485 480x272 -#define USES_PARALLEL_16 -#if LV_COLOR_16_SWAP != 0 -#define TFT_RGB_GPIO {15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7} -#else -#define TFT_RGB_GPIO {8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14} -#endif -#define TFT_RGB_CONFIG {.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=43,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=12,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.flags={.fb_in_psram=1}} -// Touch -#ifdef ESP32_4827S043R -#define USES_XPT2046 -#define XPT2046_SPI_HOST SPI2_HOST -#define XPT2046_SPI_BUS_CONFIG {.mosi_io_num=11,.miso_io_num=13,.sclk_io_num=12,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define XPT2046_IO_SPI_CONFIG {.cs_gpio_num=38,.dc_gpio_num=-1,.spi_mode=SPI_MODE0,.pclk_hz=2000000,.trans_queue_depth=3,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define XPT2046_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_18} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#else -#ifdef ESP32_4827S043C -#define USES_GT911 -#include "esp_lcd_touch_gt911.h" -#define GT911_I2C_HOST 0 -#define GT911_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=19,.scl_io_num=20,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}} -#define GT911_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=16,.flags={.disable_control_phase=1}} -#define GT911_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_38,.int_gpio_num=GPIO_NUM_NC} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -#endif -#endif - -#if 0 -// ESP32_8048S043 N/R/C -#if defined(ESP32_8048S043N) || defined(ESP32_8048S043R) || defined(ESP32_8048S043C) -#define TFT_WIDTH 800 -#define TFT_HEIGHT 480 -// Backlight -#define PIN_BCKL 2 -// LCD 800x480 -#define USES_PARALLEL_16 -#if LV_COLOR_16_SWAP != 0 -#define TFT_RGB_GPIO {15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7} -#else -#define TFT_RGB_GPIO {8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14} -#endif -#define TFT_RGB_CONFIG {.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=8,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=8,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.flags={.fb_in_psram=1}} - -// Touch -#ifdef ESP32_8048S043R -#define USES_XPT2046 -#define XPT2046_SPI_HOST SPI2_HOST -#define XPT2046_SPI_BUS_CONFIG {.mosi_io_num=11,.miso_io_num=13,.sclk_io_num=12,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define XPT2046_IO_SPI_CONFIG {.cs_gpio_num=38,.dc_gpio_num=-1,.spi_mode=SPI_MODE0,.pclk_hz=2000000,.trans_queue_depth=3,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define XPT2046_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_18} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#else -#ifdef ESP32_8048S043C -#define USES_GT911 -#include "esp_lcd_touch_gt911.h" -#define GT911_I2C_HOST 0 -#define GT911_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=19,.scl_io_num=20,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}} -#define GT911_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=16,.flags={.disable_control_phase=1}} -#define GT911_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_38,.int_gpio_num=GPIO_NUM_NC} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -#endif -#endif - -#if 0 -// ESP32_8048S050 N/R/C -#if defined(ESP32_8048S050N) || defined(ESP32_8048S050R) || defined(ESP32_8048S050C) -#define TFT_WIDTH 800 -#define TFT_HEIGHT 480 -// Backlight -#define PIN_BCKL 2 -// LCD 800x480 -#define USES_PARALLEL_16 -#if LV_COLOR_16_SWAP != 0 -#define TFT_RGB_GPIO {15,16,4,45,48,47,21,14,8,3,46,9,1,5,6,7} -#else -#define TFT_RGB_GPIO {8,3,46,9,1,5,6,7,15,16,4,45,48,47,21,14} -#endif -#define TFT_RGB_CONFIG {.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=4,.hsync_back_porch=8,.hsync_front_porch=8,.vsync_pulse_width=4,.vsync_back_porch=8,.vsync_front_porch=8,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1,}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=41,.de_gpio_num=40,.pclk_gpio_num=42,.disp_gpio_num=-1,.flags={.fb_in_psram=1}} -// Touch -#ifdef ESP32_8048S050R -#define USES_XPT2046 -#define XPT2046_SPI_HOST SPI2_HOST -#define XPT2046_SPI_BUS_CONFIG {.mosi_io_num=11,.miso_io_num=13,.sclk_io_num=12,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define XPT2046_IO_SPI_CONFIG {.cs_gpio_num=38,.dc_gpio_num=-1,.spi_mode=SPI_MODE0,.pclk_hz=2000000,.trans_queue_depth=3,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define XPT2046_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_18} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#else -#ifdef ESP32_8048S050C -#define USES_GT911 -#include "esp_lcd_touch_gt911.h" -#define GT911_I2C_HOST 0 -#define GT911_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=19,.scl_io_num=20,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}} -#define GT911_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=16,.flags={.disable_control_phase=1}} -#define GT911_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_38,.int_gpio_num=GPIO_NUM_NC} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -#endif -#endif - -#if 0 -// ESP32_8048S070 N/R/C -#if defined(ESP32_8048S070N) || defined(ESP32_8048S070R) || defined(ESP32_8048S070C) -#define TFT_WIDTH 800 -#define TFT_HEIGHT 480 -// Backlight -#define PIN_BCKL 2 -// LCD 800x480 -#define USES_PARALLEL_16 -#if LV_COLOR_16_SWAP != 0 -#define TFT_RGB_GPIO {15,7,6,5,4,9,46,3,8,16,1,14,21,47,48,45} -#else -#define TFT_RGB_GPIO {8,16,1,14,21,47,48,45,15,7,6,5,4,9,46,3} -#endif -#define TFT_RGB_CONFIG {.clk_src=LCD_CLK_SRC_PLL160M,.timings={.pclk_hz=16000000,.h_res=TFT_WIDTH,.v_res=TFT_HEIGHT,.hsync_pulse_width=30,.hsync_back_porch=16,.hsync_front_porch=210,.vsync_pulse_width=13,.vsync_back_porch=10,.vsync_front_porch=22,.flags={.hsync_idle_low=1,.vsync_idle_low=1,.pclk_active_neg=1,}},.data_width=16,.psram_trans_align=64,.hsync_gpio_num=39,.vsync_gpio_num=40,.de_gpio_num=41,.pclk_gpio_num=42,.data_gpio_nums={8, 16, 1, 14, 21, 47, 48, 45, 15, 7, 6, 5, 4, 9, 46, 3},.disp_gpio_num=-1,.flags={.fb_in_psram=1}} -// Touch -#ifdef ESP32_8048S070R -#define USES_XPT2046 -#define XPT2046_SPI_HOST SPI2_HOST -#define XPT2046_SPI_BUS_CONFIG {.mosi_io_num=11,.miso_io_num=13,.sclk_io_num=12,.quadwp_io_num=-1,.quadhd_io_num=-1} -#define XPT2046_IO_SPI_CONFIG {.cs_gpio_num=38,.dc_gpio_num=-1,.spi_mode=SPI_MODE0,.pclk_hz=2000000,.trans_queue_depth=3,.lcd_cmd_bits=8,.lcd_param_bits=8} -#define XPT2046_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_NC,.int_gpio_num=GPIO_NUM_18} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#else -#ifdef ESP32_8048S070C -#define USES_GT911 -#include "esp_lcd_touch_gt911.h" -#define GT911_I2C_HOST 0 -#define GT911_I2C_CONFIG {.mode=I2C_MODE_MASTER,.sda_io_num=19,.scl_io_num=20,.sda_pullup_en=GPIO_PULLUP_ENABLE,.scl_pullup_en=GPIO_PULLUP_ENABLE,.master={.clk_speed=400000}} -#define GT911_IO_I2C_CONFIG {.dev_addr=ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS,.control_phase_bytes=1,.lcd_cmd_bits=16,.flags={.disable_control_phase=1}} -#define GT911_TOUCH_CONFIG {.x_max=TFT_WIDTH,.y_max=TFT_HEIGHT,.rst_gpio_num=GPIO_NUM_38,.int_gpio_num=GPIO_NUM_NC} -#define TOUCH_ROT_SWAP_X false -#define TOUCH_ROT_SWAP_Y false -#endif -#endif -#endif -#endif - - -#if defined(USES_CST816S) || defined(USES_XPT2046) || defined(USES_GT911) -#define USES_TOUCH -#endif - // Exported functions #ifdef __cplusplus extern "C" diff --git a/include/esp_lcd_st7796.h b/include/esp_lcd_st7796.h index fce41ee..9040454 100644 --- a/include/esp_lcd_st7796.h +++ b/include/esp_lcd_st7796.h @@ -13,6 +13,10 @@ #include "hal/lcd_types.h" #include "esp_lcd_panel_vendor.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief LCD panel initialization commands. * @@ -38,10 +42,6 @@ typedef struct { uint16_t init_cmds_size; /*