From 89d51fdc23f6d87edfc6fada0eef2395216b6774 Mon Sep 17 00:00:00 2001 From: CQ793 <2609616396@qq.com> Date: Fri, 27 Mar 2026 10:44:07 +0800 Subject: [PATCH] content: add ESP32-P4-WIFI6-Touch-LCD-3.5 --- main/CMakeLists.txt | 6 + main/Kconfig.projbuild | 3 + .../esp32-p4-wifi6-touch-lcd-3.5/README.md | 11 + .../esp32-p4-wifi6-touch-lcd-3.5/config.h | 104 ++ .../esp32-p4-wifi6-touch-lcd-3.5/config.json | 120 ++ .../esp32-p4-wifi6-touch-lcd-3.5.cc | 205 ++++ .../lcd_init_cmds.h | 1073 +++++++++++++++++ 7 files changed, 1522 insertions(+) create mode 100644 main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/README.md create mode 100644 main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.h create mode 100644 main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json create mode 100644 main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/esp32-p4-wifi6-touch-lcd-3.5.cc create mode 100644 main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/lcd_init_cmds.h diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 822503f..2853a08 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -465,6 +465,12 @@ elseif(CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_4C) set(BUILTIN_TEXT_FONT font_puhui_basic_30_4) set(BUILTIN_ICON_FONT font_awesome_30_4) set(DEFAULT_EMOJI_COLLECTION twemoji_64) +elseif(CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_5) + set(MANUFACTURER "waveshare") + set(BOARD_TYPE "esp32-p4-wifi6-touch-lcd-3.5") + set(BUILTIN_TEXT_FONT font_puhui_basic_30_4) + set(BUILTIN_ICON_FONT font_awesome_30_4) + set(DEFAULT_EMOJI_COLLECTION twemoji_64) elseif(CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_4C) set(MANUFACTURER "waveshare") set(BOARD_TYPE "esp32-p4-wifi6-touch-lcd") diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index d8a2d1a..a426f5d 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -368,6 +368,9 @@ choice BOARD_TYPE config BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_4C bool "Waveshare ESP32-P4-WIFI6-Touch-LCD-3.4C" depends on IDF_TARGET_ESP32P4 + config BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_5 + bool "Waveshare ESP32-P4-WIFI6-Touch-LCD-3.5" + depends on IDF_TARGET_ESP32P4 config BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_4C bool "Waveshare ESP32-P4-WIFI6-Touch-LCD-4C" depends on IDF_TARGET_ESP32P4 diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/README.md b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/README.md new file mode 100644 index 0000000..98a8081 --- /dev/null +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/README.md @@ -0,0 +1,11 @@ +# Waveshare ESP32-P4-WIFI6-Touch-LCD-3.5 + +**ESP32-P4-WIFI6-Touch-LCD-3.5** is the ESP32-P4 +ESP32-C6 screen development board launched by waveshare. + +## Configuration + +Configuration in `menuconfig`. + +Selection Board Type `Xiaozhi Assistant --> Board Type` +- Waveshare ESP32-P4-WIFI6-Touch-LCD-3.5 + diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.h b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.h new file mode 100644 index 0000000..815611c --- /dev/null +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.h @@ -0,0 +1,104 @@ +#ifndef _BOARD_CONFIG_H_ +#define _BOARD_CONFIG_H_ + +#include + +#define AUDIO_INPUT_SAMPLE_RATE 24000 +#define AUDIO_OUTPUT_SAMPLE_RATE 24000 + +#define AUDIO_INPUT_REFERENCE true + +#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_13 +#define AUDIO_I2S_GPIO_WS GPIO_NUM_10 +#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_12 +#define AUDIO_I2S_GPIO_DIN GPIO_NUM_11 +#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_9 + +#define AUDIO_CODEC_PA_PIN GPIO_NUM_53 +#define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_7 +#define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_8 +#define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR +#define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR + +#define BOOT_BUTTON_GPIO GPIO_NUM_35 + +#if CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_4B +#define DISPLAY_WIDTH (720) +#define DISPLAY_HEIGHT (720) +#define PIN_NUM_LCD_RST GPIO_NUM_27 +#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_26 +#define DISPLAY_BACKLIGHT_OUTPUT_INVERT true +#define LCD_MIPI_DSI_LANE_BITRATE_MBPS (480) +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_7B +#define DISPLAY_WIDTH (1024) +#define DISPLAY_HEIGHT (600) +#define PIN_NUM_LCD_RST GPIO_NUM_33 +#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_32 +#define DISPLAY_BACKLIGHT_OUTPUT_INVERT true +#define LCD_MIPI_DSI_LANE_BITRATE_MBPS (900) +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_4C +#define DISPLAY_WIDTH (800) +#define DISPLAY_HEIGHT (800) +#define PIN_NUM_LCD_RST GPIO_NUM_27 +#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_26 +#define DISPLAY_BACKLIGHT_OUTPUT_INVERT true +#define LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500) +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_5 +#define DISPLAY_WIDTH (320) +#define DISPLAY_HEIGHT (480) +#define PIN_NUM_LCD_RST GPIO_NUM_27 +#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_28 +#define DISPLAY_BACKLIGHT_OUTPUT_INVERT false +#define LCD_MIPI_DSI_LANE_BITRATE_MBPS (0) +#define TOUCH_RST_PIN GPIO_NUM_29 +#define TOUCH_INT_PIN GPIO_NUM_50 +#define LCD_SPI_MOSI_PIN GPIO_NUM_20 +#define LCD_SPI_CLK_PIN GPIO_NUM_21 +#define LCD_SPI_CS_PIN GPIO_NUM_23 +#define LCD_SPI_DC_PIN GPIO_NUM_26 +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_4C +#define DISPLAY_WIDTH (720) +#define DISPLAY_HEIGHT (720) +#define PIN_NUM_LCD_RST GPIO_NUM_27 +#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_26 +#define DISPLAY_BACKLIGHT_OUTPUT_INVERT true +#define LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500) +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_7 +#define DISPLAY_WIDTH (720) +#define DISPLAY_HEIGHT (1280) +#define PIN_NUM_LCD_RST GPIO_NUM_27 +#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_26 +#define DISPLAY_BACKLIGHT_OUTPUT_INVERT false +#define LCD_MIPI_DSI_LANE_BITRATE_MBPS (1000) +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_8 +#define DISPLAY_WIDTH (800) +#define DISPLAY_HEIGHT (1280) +#define PIN_NUM_LCD_RST GPIO_NUM_27 +#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_26 +#define DISPLAY_BACKLIGHT_OUTPUT_INVERT false +#define LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500) +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_10_1 +#define DISPLAY_WIDTH (800) +#define DISPLAY_HEIGHT (1280) +#define PIN_NUM_LCD_RST GPIO_NUM_27 +#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_26 +#define DISPLAY_BACKLIGHT_OUTPUT_INVERT false +#define LCD_MIPI_DSI_LANE_BITRATE_MBPS (1500) +#endif + +#define LCD_BIT_PER_PIXEL (16) +#define DELAY_TIME_MS (3000) +#define LCD_MIPI_DSI_LANE_NUM (2) // 2 data lanes + +#define MIPI_DSI_PHY_PWR_LDO_CHAN (3) +#define MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV (2500) + +#define DISPLAY_SWAP_XY false +#define DISPLAY_MIRROR_X true +#define DISPLAY_MIRROR_Y false + +#define DISPLAY_OFFSET_X 0 +#define DISPLAY_OFFSET_Y 0 + + +#endif // _BOARD_CONFIG_H_ diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json new file mode 100644 index 0000000..b107b55 --- /dev/null +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json @@ -0,0 +1,120 @@ +{ + "manufacturer": "waveshare", + "target": "esp32p4", + "builds": [ + { + "name": "esp32-p4-wifi6-touch-lcd-4b", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", + "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", + "CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_4B=y", + "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", + "CONFIG_USE_DEVICE_AEC=y", + "CONFIG_CAMERA_OV5647=y", + "CONFIG_CAMERA_OV5647_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5647_MIPI_RAW8_800X800_50FPS=y", + "CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y" + ] + }, + { + "name": "esp32-p4-wifi6-touch-lcd-7b", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", + "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", + "CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_7B=y", + "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", + "CONFIG_USE_DEVICE_AEC=y", + "CONFIG_CAMERA_OV5647=y", + "CONFIG_CAMERA_OV5647_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5647_MIPI_RAW8_800X800_50FPS=y", + "CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y" + ] + }, + { + "name": "esp32-p4-wifi6-touch-lcd-3.4c", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", + "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", + "CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_4C=y", + "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", + "CONFIG_USE_DEVICE_AEC=y", + "CONFIG_CAMERA_OV5647=y", + "CONFIG_CAMERA_OV5647_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5647_MIPI_RAW8_800X800_50FPS=y", + "CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y" + ] + }, + { + "name": "esp32-p4-wifi6-touch-lcd-3.5", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", + "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", + "CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_5=y", + "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", + "CONFIG_USE_DEVICE_AEC=y", + "CONFIG_ESP_VIDEO_ENABLE_MIPI_CSI_VIDEO_DEVICE=y", + "CONFIG_ESP_VIDEO_ENABLE_ISP_VIDEO_DEVICE=y", + "CONFIG_CAMERA_OV5647=y", + "CONFIG_CAMERA_OV5647_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5647_MIPI_RAW8_800X800_50FPS=y", + "CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y" + ] + }, + { + "name": "esp32-p4-wifi6-touch-lcd-4c", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", + "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", + "CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_4C=y", + "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", + "CONFIG_USE_DEVICE_AEC=y", + "CONFIG_CAMERA_OV5647=y", + "CONFIG_CAMERA_OV5647_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5647_MIPI_RAW8_800X800_50FPS=y", + "CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y" + ] + }, + { + "name": "esp32-p4-wifi6-touch-lcd-7", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", + "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", + "CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_7=y", + "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", + "CONFIG_USE_DEVICE_AEC=y", + "CONFIG_CAMERA_OV5647=y", + "CONFIG_CAMERA_OV5647_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5647_MIPI_RAW8_800X800_50FPS=y", + "CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y" + ] + }, + { + "name": "esp32-p4-wifi6-touch-lcd-8", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", + "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", + "CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_8=y", + "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", + "CONFIG_USE_DEVICE_AEC=y", + "CONFIG_CAMERA_OV5647=y", + "CONFIG_CAMERA_OV5647_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5647_MIPI_RAW8_800X800_50FPS=y", + "CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y" + ] + }, + { + "name": "esp32-p4-wifi6-touch-lcd-10.1", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", + "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", + "CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_10_1=y", + "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", + "CONFIG_USE_DEVICE_AEC=y", + "CONFIG_CAMERA_OV5647=y", + "CONFIG_CAMERA_OV5647_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5647_MIPI_RAW8_800X800_50FPS=y", + "CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y" + ] + } + ] +} diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/esp32-p4-wifi6-touch-lcd-3.5.cc b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/esp32-p4-wifi6-touch-lcd-3.5.cc new file mode 100644 index 0000000..c4ce4c1 --- /dev/null +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/esp32-p4-wifi6-touch-lcd-3.5.cc @@ -0,0 +1,205 @@ +#include "wifi_board.h" +#include "codecs/es8311_audio_codec.h" +#include "application.h" +#include "display/lcd_display.h" +#include "button.h" +#include "esp_video.h" +#include "esp_video_init.h" +#include "esp_cam_sensor_xclk.h" +#include "esp_lcd_mipi_dsi.h" +#include "esp_lcd_panel_ops.h" +#include "esp_ldo_regulator.h" +#include +#include "esp_lcd_st7796.h" +#include "config.h" +#include "lcd_init_cmds.h" +#include +#include +#include +#include "esp_lcd_touch_ft5x06.h" +#define TAG "WaveshareEsp32p4" + +class WaveshareEsp32p4 : public WifiBoard { +private: + i2c_master_bus_handle_t i2c_bus_; + Button boot_button_; + LcdDisplay *display_; + EspVideo* camera_ = nullptr; + + + esp_err_t i2c_device_probe(uint8_t addr) { + return i2c_master_probe(i2c_bus_, addr, 100); + } + + void InitializeCodecI2c() { + // Initialize I2C peripheral + i2c_master_bus_config_t i2c_bus_cfg = { + .i2c_port = I2C_NUM_1, + .sda_io_num = AUDIO_CODEC_I2C_SDA_PIN, + .scl_io_num = AUDIO_CODEC_I2C_SCL_PIN, + .clk_source = I2C_CLK_SRC_DEFAULT, + .glitch_ignore_cnt = 7, + .intr_priority = 0, + .trans_queue_depth = 0, + .flags = { + .enable_internal_pullup = 1, + }, + }; + ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_bus_cfg, &i2c_bus_)); + } + + static esp_err_t bsp_enable_dsi_phy_power(void) { +#if MIPI_DSI_PHY_PWR_LDO_CHAN > 0 + // Turn on the power for MIPI DSI PHY, so it can go from "No Power" state to "Shutdown" state + static esp_ldo_channel_handle_t phy_pwr_chan = NULL; + esp_ldo_channel_config_t ldo_cfg = { + .chan_id = MIPI_DSI_PHY_PWR_LDO_CHAN, + .voltage_mv = MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV, + }; + esp_ldo_acquire_channel(&ldo_cfg, &phy_pwr_chan); + ESP_LOGI(TAG, "MIPI DSI PHY Powered on"); +#endif // BSP_MIPI_DSI_PHY_PWR_LDO_CHAN > 0 + + return ESP_OK; + } + + void InitializeLCD() { + esp_lcd_panel_io_handle_t io = NULL; + esp_lcd_panel_handle_t disp_panel = NULL; + spi_bus_config_t buscfg = {}; + buscfg.sclk_io_num = LCD_SPI_CLK_PIN; + buscfg.mosi_io_num = LCD_SPI_MOSI_PIN; + buscfg.miso_io_num = GPIO_NUM_NC; + buscfg.quadwp_io_num = GPIO_NUM_NC; + buscfg.quadhd_io_num = GPIO_NUM_NC; + buscfg.max_transfer_sz = (DISPLAY_WIDTH * DISPLAY_HEIGHT); + ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO)); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.dc_gpio_num = LCD_SPI_DC_PIN; + io_config.cs_gpio_num = LCD_SPI_CS_PIN; + io_config.pclk_hz = (80 * 1000 * 1000); + io_config.lcd_cmd_bits = 8; + io_config.lcd_param_bits = 8; + io_config.spi_mode = 3; + io_config.trans_queue_depth = 10; + ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)SPI2_HOST, &io_config, &io)); + const esp_lcd_panel_dev_config_t lcd_dev_config = { + .reset_gpio_num = PIN_NUM_LCD_RST, + .color_space = ESP_LCD_COLOR_SPACE_BGR, + .bits_per_pixel = 16, + }; + ESP_ERROR_CHECK(esp_lcd_new_panel_st7796(io, &lcd_dev_config, &disp_panel)); + ESP_ERROR_CHECK(esp_lcd_panel_reset(disp_panel)); + ESP_ERROR_CHECK(esp_lcd_panel_init(disp_panel)); + ESP_ERROR_CHECK(esp_lcd_panel_invert_color(disp_panel, true)); + esp_lcd_panel_disp_on_off(disp_panel, true); + ESP_ERROR_CHECK(esp_lcd_panel_mirror(disp_panel, true, false)); + display_ = new SpiLcdDisplay(io, disp_panel, DISPLAY_WIDTH, DISPLAY_HEIGHT, + DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY); + } + void InitializeTouch() + { + esp_lcd_touch_handle_t tp; + esp_lcd_touch_config_t tp_cfg = { + .x_max = DISPLAY_WIDTH, + .y_max = DISPLAY_HEIGHT, + .rst_gpio_num = TOUCH_RST_PIN, + .int_gpio_num = TOUCH_INT_PIN, + .levels = { + .reset = 0, + .interrupt = 0, + }, + .flags = { + .swap_xy = 1, + .mirror_x = 1, + .mirror_y = 0, + }, + }; + esp_lcd_panel_io_handle_t tp_io_handle = NULL; + esp_lcd_panel_io_i2c_config_t tp_io_config = ESP_LCD_TOUCH_IO_I2C_FT5x06_CONFIG(); + tp_io_config.scl_speed_hz = 400 * 1000; + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(i2c_bus_, &tp_io_config, &tp_io_handle)); + ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_ft5x06(tp_io_handle, &tp_cfg, &tp)); + const lvgl_port_touch_cfg_t touch_cfg = { + .disp = lv_display_get_default(), + .handle = tp, + }; + lvgl_port_add_touch(&touch_cfg); + } + void InitializeCamera() { + esp_video_init_csi_config_t base_csi_config = { + .sccb_config = { + .init_sccb = false, + .i2c_handle = i2c_bus_, + .freq = 400000, + }, + .reset_pin = GPIO_NUM_NC, + .pwdn_pin = GPIO_NUM_NC, + }; + + esp_video_init_config_t cam_config = { + .csi = &base_csi_config, + }; + + camera_ = new EspVideo(cam_config); + } + void InitializeButtons() { + boot_button_.OnClick([this]() { + auto& app = Application::GetInstance(); + auto state = app.GetDeviceState(); + if (state == kDeviceStateStarting || + state == kDeviceStateConnecting || + state == kDeviceStateWifiConfiguring) { + EnterWifiConfigMode(); + return; + } + esp_restart(); + }); + Application::GetInstance().StartListening(); + } + +public: + WaveshareEsp32p4() : + boot_button_(BOOT_BUTTON_GPIO) { + InitializeCodecI2c(); + InitializeLCD(); + InitializeTouch(); + InitializeCamera(); + InitializeButtons(); + GetBacklight()->RestoreBrightness(); + } + + virtual AudioCodec* GetAudioCodec() override { + static Es8311AudioCodec audio_codec( + i2c_bus_, + I2C_NUM_1, + AUDIO_INPUT_SAMPLE_RATE, + AUDIO_OUTPUT_SAMPLE_RATE, + AUDIO_I2S_GPIO_MCLK, + AUDIO_I2S_GPIO_BCLK, + AUDIO_I2S_GPIO_WS, + AUDIO_I2S_GPIO_DOUT, + AUDIO_I2S_GPIO_DIN, + AUDIO_CODEC_PA_PIN, + AUDIO_CODEC_ES8311_ADDR, + true, + false); + return &audio_codec; + } + + virtual Display *GetDisplay() override { + return display_; + } + + virtual Camera* GetCamera() override { + return camera_; + } + + virtual Backlight* GetBacklight() override { + static PwmBacklight backlight(DISPLAY_BACKLIGHT_PIN, DISPLAY_BACKLIGHT_OUTPUT_INVERT); + return &backlight; + } + +}; + +DECLARE_BOARD(WaveshareEsp32p4); diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/lcd_init_cmds.h b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/lcd_init_cmds.h new file mode 100644 index 0000000..9b40f5d --- /dev/null +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/lcd_init_cmds.h @@ -0,0 +1,1073 @@ +#ifdef CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_4B +// Leave it blank +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_7B +// Leave it blank +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_3_4C +static const jd9365_lcd_init_cmd_t lcd_init_cmds[] = { + {0xE0, (uint8_t[]){0x00}, 1, 0}, + + {0xE1, (uint8_t[]){0x93}, 1, 0}, + {0xE2, (uint8_t[]){0x65}, 1, 0}, + {0xE3, (uint8_t[]){0xF8}, 1, 0}, + {0x80, (uint8_t[]){0x01}, 1, 0}, + + {0xE0, (uint8_t[]){0x01}, 1, 0}, + + {0x00, (uint8_t[]){0x00}, 1, 0}, + {0x01, (uint8_t[]){0x41}, 1, 0}, + {0x03, (uint8_t[]){0x10}, 1, 0}, + {0x04, (uint8_t[]){0x44}, 1, 0}, + + {0x17, (uint8_t[]){0x00}, 1, 0}, + {0x18, (uint8_t[]){0xD0}, 1, 0}, + {0x19, (uint8_t[]){0x00}, 1, 0}, + {0x1A, (uint8_t[]){0x00}, 1, 0}, + {0x1B, (uint8_t[]){0xD0}, 1, 0}, + {0x1C, (uint8_t[]){0x00}, 1, 0}, + + {0x24, (uint8_t[]){0xFE}, 1, 0}, + {0x35, (uint8_t[]){0x26}, 1, 0}, + + {0x37, (uint8_t[]){0x09}, 1, 0}, + + {0x38, (uint8_t[]){0x04}, 1, 0}, + {0x39, (uint8_t[]){0x08}, 1, 0}, + {0x3A, (uint8_t[]){0x0A}, 1, 0}, + {0x3C, (uint8_t[]){0x78}, 1, 0}, + {0x3D, (uint8_t[]){0xFF}, 1, 0}, + {0x3E, (uint8_t[]){0xFF}, 1, 0}, + {0x3F, (uint8_t[]){0xFF}, 1, 0}, + + {0x40, (uint8_t[]){0x00}, 1, 0}, + {0x41, (uint8_t[]){0x64}, 1, 0}, + {0x42, (uint8_t[]){0xC7}, 1, 0}, + {0x43, (uint8_t[]){0x18}, 1, 0}, + {0x44, (uint8_t[]){0x0B}, 1, 0}, + {0x45, (uint8_t[]){0x14}, 1, 0}, + + {0x55, (uint8_t[]){0x02}, 1, 0}, + {0x57, (uint8_t[]){0x49}, 1, 0}, + {0x59, (uint8_t[]){0x0A}, 1, 0}, + {0x5A, (uint8_t[]){0x1B}, 1, 0}, + {0x5B, (uint8_t[]){0x19}, 1, 0}, + + {0x5D, (uint8_t[]){0x7F}, 1, 0}, + {0x5E, (uint8_t[]){0x56}, 1, 0}, + {0x5F, (uint8_t[]){0x43}, 1, 0}, + {0x60, (uint8_t[]){0x37}, 1, 0}, + {0x61, (uint8_t[]){0x33}, 1, 0}, + {0x62, (uint8_t[]){0x25}, 1, 0}, + {0x63, (uint8_t[]){0x2A}, 1, 0}, + {0x64, (uint8_t[]){0x16}, 1, 0}, + {0x65, (uint8_t[]){0x30}, 1, 0}, + {0x66, (uint8_t[]){0x2F}, 1, 0}, + {0x67, (uint8_t[]){0x32}, 1, 0}, + {0x68, (uint8_t[]){0x53}, 1, 0}, + {0x69, (uint8_t[]){0x43}, 1, 0}, + {0x6A, (uint8_t[]){0x4C}, 1, 0}, + {0x6B, (uint8_t[]){0x40}, 1, 0}, + {0x6C, (uint8_t[]){0x3D}, 1, 0}, + {0x6D, (uint8_t[]){0x31}, 1, 0}, + {0x6E, (uint8_t[]){0x20}, 1, 0}, + {0x6F, (uint8_t[]){0x0F}, 1, 0}, + + {0x70, (uint8_t[]){0x7F}, 1, 0}, + {0x71, (uint8_t[]){0x56}, 1, 0}, + {0x72, (uint8_t[]){0x43}, 1, 0}, + {0x73, (uint8_t[]){0x37}, 1, 0}, + {0x74, (uint8_t[]){0x33}, 1, 0}, + {0x75, (uint8_t[]){0x25}, 1, 0}, + {0x76, (uint8_t[]){0x2A}, 1, 0}, + {0x77, (uint8_t[]){0x16}, 1, 0}, + {0x78, (uint8_t[]){0x30}, 1, 0}, + {0x79, (uint8_t[]){0x2F}, 1, 0}, + {0x7A, (uint8_t[]){0x32}, 1, 0}, + {0x7B, (uint8_t[]){0x53}, 1, 0}, + {0x7C, (uint8_t[]){0x43}, 1, 0}, + {0x7D, (uint8_t[]){0x4C}, 1, 0}, + {0x7E, (uint8_t[]){0x40}, 1, 0}, + {0x7F, (uint8_t[]){0x3D}, 1, 0}, + {0x80, (uint8_t[]){0x31}, 1, 0}, + {0x81, (uint8_t[]){0x20}, 1, 0}, + {0x82, (uint8_t[]){0x0F}, 1, 0}, + + {0xE0, (uint8_t[]){0x02}, 1, 0}, + {0x00, (uint8_t[]){0x5F}, 1, 0}, + {0x01, (uint8_t[]){0x5F}, 1, 0}, + {0x02, (uint8_t[]){0x5E}, 1, 0}, + {0x03, (uint8_t[]){0x5E}, 1, 0}, + {0x04, (uint8_t[]){0x50}, 1, 0}, + {0x05, (uint8_t[]){0x48}, 1, 0}, + {0x06, (uint8_t[]){0x48}, 1, 0}, + {0x07, (uint8_t[]){0x4A}, 1, 0}, + {0x08, (uint8_t[]){0x4A}, 1, 0}, + {0x09, (uint8_t[]){0x44}, 1, 0}, + {0x0A, (uint8_t[]){0x44}, 1, 0}, + {0x0B, (uint8_t[]){0x46}, 1, 0}, + {0x0C, (uint8_t[]){0x46}, 1, 0}, + {0x0D, (uint8_t[]){0x5F}, 1, 0}, + {0x0E, (uint8_t[]){0x5F}, 1, 0}, + {0x0F, (uint8_t[]){0x57}, 1, 0}, + {0x10, (uint8_t[]){0x57}, 1, 0}, + {0x11, (uint8_t[]){0x77}, 1, 0}, + {0x12, (uint8_t[]){0x77}, 1, 0}, + {0x13, (uint8_t[]){0x40}, 1, 0}, + {0x14, (uint8_t[]){0x42}, 1, 0}, + {0x15, (uint8_t[]){0x5F}, 1, 0}, + + {0x16, (uint8_t[]){0x5F}, 1, 0}, + {0x17, (uint8_t[]){0x5F}, 1, 0}, + {0x18, (uint8_t[]){0x5E}, 1, 0}, + {0x19, (uint8_t[]){0x5E}, 1, 0}, + {0x1A, (uint8_t[]){0x50}, 1, 0}, + {0x1B, (uint8_t[]){0x49}, 1, 0}, + {0x1C, (uint8_t[]){0x49}, 1, 0}, + {0x1D, (uint8_t[]){0x4B}, 1, 0}, + {0x1E, (uint8_t[]){0x4B}, 1, 0}, + {0x1F, (uint8_t[]){0x45}, 1, 0}, + {0x20, (uint8_t[]){0x45}, 1, 0}, + {0x21, (uint8_t[]){0x47}, 1, 0}, + {0x22, (uint8_t[]){0x47}, 1, 0}, + {0x23, (uint8_t[]){0x5F}, 1, 0}, + {0x24, (uint8_t[]){0x5F}, 1, 0}, + {0x25, (uint8_t[]){0x57}, 1, 0}, + {0x26, (uint8_t[]){0x57}, 1, 0}, + {0x27, (uint8_t[]){0x77}, 1, 0}, + {0x28, (uint8_t[]){0x77}, 1, 0}, + {0x29, (uint8_t[]){0x41}, 1, 0}, + {0x2A, (uint8_t[]){0x43}, 1, 0}, + {0x2B, (uint8_t[]){0x5F}, 1, 0}, + + {0x2C, (uint8_t[]){0x1E}, 1, 0}, + {0x2D, (uint8_t[]){0x1E}, 1, 0}, + {0x2E, (uint8_t[]){0x1F}, 1, 0}, + {0x2F, (uint8_t[]){0x1F}, 1, 0}, + {0x30, (uint8_t[]){0x10}, 1, 0}, + {0x31, (uint8_t[]){0x07}, 1, 0}, + {0x32, (uint8_t[]){0x07}, 1, 0}, + {0x33, (uint8_t[]){0x05}, 1, 0}, + {0x34, (uint8_t[]){0x05}, 1, 0}, + {0x35, (uint8_t[]){0x0B}, 1, 0}, + {0x36, (uint8_t[]){0x0B}, 1, 0}, + {0x37, (uint8_t[]){0x09}, 1, 0}, + {0x38, (uint8_t[]){0x09}, 1, 0}, + {0x39, (uint8_t[]){0x1F}, 1, 0}, + {0x3A, (uint8_t[]){0x1F}, 1, 0}, + {0x3B, (uint8_t[]){0x17}, 1, 0}, + {0x3C, (uint8_t[]){0x17}, 1, 0}, + {0x3D, (uint8_t[]){0x17}, 1, 0}, + {0x3E, (uint8_t[]){0x17}, 1, 0}, + {0x3F, (uint8_t[]){0x03}, 1, 0}, + {0x40, (uint8_t[]){0x01}, 1, 0}, + {0x41, (uint8_t[]){0x1F}, 1, 0}, + + {0x42, (uint8_t[]){0x1E}, 1, 0}, + {0x43, (uint8_t[]){0x1E}, 1, 0}, + {0x44, (uint8_t[]){0x1F}, 1, 0}, + {0x45, (uint8_t[]){0x1F}, 1, 0}, + {0x46, (uint8_t[]){0x10}, 1, 0}, + {0x47, (uint8_t[]){0x06}, 1, 0}, + {0x48, (uint8_t[]){0x06}, 1, 0}, + {0x49, (uint8_t[]){0x04}, 1, 0}, + {0x4A, (uint8_t[]){0x04}, 1, 0}, + {0x4B, (uint8_t[]){0x0A}, 1, 0}, + {0x4C, (uint8_t[]){0x0A}, 1, 0}, + {0x4D, (uint8_t[]){0x08}, 1, 0}, + {0x4E, (uint8_t[]){0x08}, 1, 0}, + {0x4F, (uint8_t[]){0x1F}, 1, 0}, + {0x50, (uint8_t[]){0x1F}, 1, 0}, + {0x51, (uint8_t[]){0x17}, 1, 0}, + {0x52, (uint8_t[]){0x17}, 1, 0}, + {0x53, (uint8_t[]){0x17}, 1, 0}, + {0x54, (uint8_t[]){0x17}, 1, 0}, + {0x55, (uint8_t[]){0x02}, 1, 0}, + {0x56, (uint8_t[]){0x00}, 1, 0}, + {0x57, (uint8_t[]){0x1F}, 1, 0}, + + {0xE0, (uint8_t[]){0x02}, 1, 0}, + {0x58, (uint8_t[]){0x40}, 1, 0}, + {0x59, (uint8_t[]){0x00}, 1, 0}, + {0x5A, (uint8_t[]){0x00}, 1, 0}, + {0x5B, (uint8_t[]){0x30}, 1, 0}, + {0x5C, (uint8_t[]){0x01}, 1, 0}, + {0x5D, (uint8_t[]){0x30}, 1, 0}, + {0x5E, (uint8_t[]){0x01}, 1, 0}, + {0x5F, (uint8_t[]){0x02}, 1, 0}, + {0x60, (uint8_t[]){0x30}, 1, 0}, + {0x61, (uint8_t[]){0x03}, 1, 0}, + {0x62, (uint8_t[]){0x04}, 1, 0}, + {0x63, (uint8_t[]){0x04}, 1, 0}, + {0x64, (uint8_t[]){0xA6}, 1, 0}, + {0x65, (uint8_t[]){0x43}, 1, 0}, + {0x66, (uint8_t[]){0x30}, 1, 0}, + {0x67, (uint8_t[]){0x73}, 1, 0}, + {0x68, (uint8_t[]){0x05}, 1, 0}, + {0x69, (uint8_t[]){0x04}, 1, 0}, + {0x6A, (uint8_t[]){0x7F}, 1, 0}, + {0x6B, (uint8_t[]){0x08}, 1, 0}, + {0x6C, (uint8_t[]){0x00}, 1, 0}, + {0x6D, (uint8_t[]){0x04}, 1, 0}, + {0x6E, (uint8_t[]){0x04}, 1, 0}, + {0x6F, (uint8_t[]){0x88}, 1, 0}, + + {0x75, (uint8_t[]){0xD9}, 1, 0}, + {0x76, (uint8_t[]){0x00}, 1, 0}, + {0x77, (uint8_t[]){0x33}, 1, 0}, + {0x78, (uint8_t[]){0x43}, 1, 0}, + + {0xE0, (uint8_t[]){0x00}, 1, 0}, + + {0x11, (uint8_t[]){0x00}, 1, 120}, + + {0x29, (uint8_t[]){0x00}, 1, 20}, + {0x35, (uint8_t[]){0x00}, 1, 0}, +}; +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_4C +static const jd9365_lcd_init_cmd_t lcd_init_cmds[] = { + {0xE0, (uint8_t[]){0x00}, 1, 0}, + + {0xE1, (uint8_t[]){0x93}, 1, 0}, + {0xE2, (uint8_t[]){0x65}, 1, 0}, + {0xE3, (uint8_t[]){0xF8}, 1, 0}, + {0x80, (uint8_t[]){0x01}, 1, 0}, + + {0xE0, (uint8_t[]){0x01}, 1, 0}, + + {0x00, (uint8_t[]){0x00}, 1, 0}, + {0x01, (uint8_t[]){0x41}, 1, 0}, + {0x03, (uint8_t[]){0x10}, 1, 0}, + {0x04, (uint8_t[]){0x44}, 1, 0}, + + {0x17, (uint8_t[]){0x00}, 1, 0}, + {0x18, (uint8_t[]){0xD0}, 1, 0}, + {0x19, (uint8_t[]){0x00}, 1, 0}, + {0x1A, (uint8_t[]){0x00}, 1, 0}, + {0x1B, (uint8_t[]){0xD0}, 1, 0}, + {0x1C, (uint8_t[]){0x00}, 1, 0}, + + {0x24, (uint8_t[]){0xFE}, 1, 0}, + {0x35, (uint8_t[]){0x26}, 1, 0}, + + {0x37, (uint8_t[]){0x09}, 1, 0}, + + {0x38, (uint8_t[]){0x04}, 1, 0}, + {0x39, (uint8_t[]){0x08}, 1, 0}, + {0x3A, (uint8_t[]){0x0A}, 1, 0}, + {0x3C, (uint8_t[]){0x78}, 1, 0}, + {0x3D, (uint8_t[]){0xFF}, 1, 0}, + {0x3E, (uint8_t[]){0xFF}, 1, 0}, + {0x3F, (uint8_t[]){0xFF}, 1, 0}, + + {0x40, (uint8_t[]){0x04}, 1, 0}, + {0x41, (uint8_t[]){0x64}, 1, 0}, + {0x42, (uint8_t[]){0xC7}, 1, 0}, + {0x43, (uint8_t[]){0x18}, 1, 0}, + {0x44, (uint8_t[]){0x0B}, 1, 0}, + {0x45, (uint8_t[]){0x14}, 1, 0}, + + {0x55, (uint8_t[]){0x02}, 1, 0}, + {0x57, (uint8_t[]){0x49}, 1, 0}, + {0x59, (uint8_t[]){0x0A}, 1, 0}, + {0x5A, (uint8_t[]){0x1B}, 1, 0}, + {0x5B, (uint8_t[]){0x19}, 1, 0}, + + {0x5D, (uint8_t[]){0x7F}, 1, 0}, + {0x5E, (uint8_t[]){0x56}, 1, 0}, + {0x5F, (uint8_t[]){0x43}, 1, 0}, + {0x60, (uint8_t[]){0x37}, 1, 0}, + {0x61, (uint8_t[]){0x33}, 1, 0}, + {0x62, (uint8_t[]){0x25}, 1, 0}, + {0x63, (uint8_t[]){0x2A}, 1, 0}, + {0x64, (uint8_t[]){0x16}, 1, 0}, + {0x65, (uint8_t[]){0x30}, 1, 0}, + {0x66, (uint8_t[]){0x2F}, 1, 0}, + {0x67, (uint8_t[]){0x32}, 1, 0}, + {0x68, (uint8_t[]){0x53}, 1, 0}, + {0x69, (uint8_t[]){0x43}, 1, 0}, + {0x6A, (uint8_t[]){0x4C}, 1, 0}, + {0x6B, (uint8_t[]){0x40}, 1, 0}, + {0x6C, (uint8_t[]){0x3D}, 1, 0}, + {0x6D, (uint8_t[]){0x31}, 1, 0}, + {0x6E, (uint8_t[]){0x20}, 1, 0}, + {0x6F, (uint8_t[]){0x0F}, 1, 0}, + + {0x70, (uint8_t[]){0x7F}, 1, 0}, + {0x71, (uint8_t[]){0x56}, 1, 0}, + {0x72, (uint8_t[]){0x43}, 1, 0}, + {0x73, (uint8_t[]){0x37}, 1, 0}, + {0x74, (uint8_t[]){0x33}, 1, 0}, + {0x75, (uint8_t[]){0x25}, 1, 0}, + {0x76, (uint8_t[]){0x2A}, 1, 0}, + {0x77, (uint8_t[]){0x16}, 1, 0}, + {0x78, (uint8_t[]){0x30}, 1, 0}, + {0x79, (uint8_t[]){0x2F}, 1, 0}, + {0x7A, (uint8_t[]){0x32}, 1, 0}, + {0x7B, (uint8_t[]){0x53}, 1, 0}, + {0x7C, (uint8_t[]){0x43}, 1, 0}, + {0x7D, (uint8_t[]){0x4C}, 1, 0}, + {0x7E, (uint8_t[]){0x40}, 1, 0}, + {0x7F, (uint8_t[]){0x3D}, 1, 0}, + {0x80, (uint8_t[]){0x31}, 1, 0}, + {0x81, (uint8_t[]){0x20}, 1, 0}, + {0x82, (uint8_t[]){0x0F}, 1, 0}, + + {0xE0, (uint8_t[]){0x02}, 1, 0}, + {0x00, (uint8_t[]){0x5F}, 1, 0}, + {0x01, (uint8_t[]){0x5F}, 1, 0}, + {0x02, (uint8_t[]){0x5E}, 1, 0}, + {0x03, (uint8_t[]){0x5E}, 1, 0}, + {0x04, (uint8_t[]){0x50}, 1, 0}, + {0x05, (uint8_t[]){0x48}, 1, 0}, + {0x06, (uint8_t[]){0x48}, 1, 0}, + {0x07, (uint8_t[]){0x4A}, 1, 0}, + {0x08, (uint8_t[]){0x4A}, 1, 0}, + {0x09, (uint8_t[]){0x44}, 1, 0}, + {0x0A, (uint8_t[]){0x44}, 1, 0}, + {0x0B, (uint8_t[]){0x46}, 1, 0}, + {0x0C, (uint8_t[]){0x46}, 1, 0}, + {0x0D, (uint8_t[]){0x5F}, 1, 0}, + {0x0E, (uint8_t[]){0x5F}, 1, 0}, + {0x0F, (uint8_t[]){0x57}, 1, 0}, + {0x10, (uint8_t[]){0x57}, 1, 0}, + {0x11, (uint8_t[]){0x77}, 1, 0}, + {0x12, (uint8_t[]){0x77}, 1, 0}, + {0x13, (uint8_t[]){0x40}, 1, 0}, + {0x14, (uint8_t[]){0x42}, 1, 0}, + {0x15, (uint8_t[]){0x5F}, 1, 0}, + + {0x16, (uint8_t[]){0x5F}, 1, 0}, + {0x17, (uint8_t[]){0x5F}, 1, 0}, + {0x18, (uint8_t[]){0x5E}, 1, 0}, + {0x19, (uint8_t[]){0x5E}, 1, 0}, + {0x1A, (uint8_t[]){0x50}, 1, 0}, + {0x1B, (uint8_t[]){0x49}, 1, 0}, + {0x1C, (uint8_t[]){0x49}, 1, 0}, + {0x1D, (uint8_t[]){0x4B}, 1, 0}, + {0x1E, (uint8_t[]){0x4B}, 1, 0}, + {0x1F, (uint8_t[]){0x45}, 1, 0}, + {0x20, (uint8_t[]){0x45}, 1, 0}, + {0x21, (uint8_t[]){0x47}, 1, 0}, + {0x22, (uint8_t[]){0x47}, 1, 0}, + {0x23, (uint8_t[]){0x5F}, 1, 0}, + {0x24, (uint8_t[]){0x5F}, 1, 0}, + {0x25, (uint8_t[]){0x57}, 1, 0}, + {0x26, (uint8_t[]){0x57}, 1, 0}, + {0x27, (uint8_t[]){0x77}, 1, 0}, + {0x28, (uint8_t[]){0x77}, 1, 0}, + {0x29, (uint8_t[]){0x41}, 1, 0}, + {0x2A, (uint8_t[]){0x43}, 1, 0}, + {0x2B, (uint8_t[]){0x5F}, 1, 0}, + + {0x2C, (uint8_t[]){0x1E}, 1, 0}, + {0x2D, (uint8_t[]){0x1E}, 1, 0}, + {0x2E, (uint8_t[]){0x1F}, 1, 0}, + {0x2F, (uint8_t[]){0x1F}, 1, 0}, + {0x30, (uint8_t[]){0x10}, 1, 0}, + {0x31, (uint8_t[]){0x07}, 1, 0}, + {0x32, (uint8_t[]){0x07}, 1, 0}, + {0x33, (uint8_t[]){0x05}, 1, 0}, + {0x34, (uint8_t[]){0x05}, 1, 0}, + {0x35, (uint8_t[]){0x0B}, 1, 0}, + {0x36, (uint8_t[]){0x0B}, 1, 0}, + {0x37, (uint8_t[]){0x09}, 1, 0}, + {0x38, (uint8_t[]){0x09}, 1, 0}, + {0x39, (uint8_t[]){0x1F}, 1, 0}, + {0x3A, (uint8_t[]){0x1F}, 1, 0}, + {0x3B, (uint8_t[]){0x17}, 1, 0}, + {0x3C, (uint8_t[]){0x17}, 1, 0}, + {0x3D, (uint8_t[]){0x17}, 1, 0}, + {0x3E, (uint8_t[]){0x17}, 1, 0}, + {0x3F, (uint8_t[]){0x03}, 1, 0}, + {0x40, (uint8_t[]){0x01}, 1, 0}, + {0x41, (uint8_t[]){0x1F}, 1, 0}, + + {0x42, (uint8_t[]){0x1E}, 1, 0}, + {0x43, (uint8_t[]){0x1E}, 1, 0}, + {0x44, (uint8_t[]){0x1F}, 1, 0}, + {0x45, (uint8_t[]){0x1F}, 1, 0}, + {0x46, (uint8_t[]){0x10}, 1, 0}, + {0x47, (uint8_t[]){0x06}, 1, 0}, + {0x48, (uint8_t[]){0x06}, 1, 0}, + {0x49, (uint8_t[]){0x04}, 1, 0}, + {0x4A, (uint8_t[]){0x04}, 1, 0}, + {0x4B, (uint8_t[]){0x0A}, 1, 0}, + {0x4C, (uint8_t[]){0x0A}, 1, 0}, + {0x4D, (uint8_t[]){0x08}, 1, 0}, + {0x4E, (uint8_t[]){0x08}, 1, 0}, + {0x4F, (uint8_t[]){0x1F}, 1, 0}, + {0x50, (uint8_t[]){0x1F}, 1, 0}, + {0x51, (uint8_t[]){0x17}, 1, 0}, + {0x52, (uint8_t[]){0x17}, 1, 0}, + {0x53, (uint8_t[]){0x17}, 1, 0}, + {0x54, (uint8_t[]){0x17}, 1, 0}, + {0x55, (uint8_t[]){0x02}, 1, 0}, + {0x56, (uint8_t[]){0x00}, 1, 0}, + {0x57, (uint8_t[]){0x1F}, 1, 0}, + + {0xE0, (uint8_t[]){0x02}, 1, 0}, + {0x58, (uint8_t[]){0x40}, 1, 0}, + {0x59, (uint8_t[]){0x00}, 1, 0}, + {0x5A, (uint8_t[]){0x00}, 1, 0}, + {0x5B, (uint8_t[]){0x30}, 1, 0}, + {0x5C, (uint8_t[]){0x01}, 1, 0}, + {0x5D, (uint8_t[]){0x30}, 1, 0}, + {0x5E, (uint8_t[]){0x01}, 1, 0}, + {0x5F, (uint8_t[]){0x02}, 1, 0}, + {0x60, (uint8_t[]){0x30}, 1, 0}, + {0x61, (uint8_t[]){0x03}, 1, 0}, + {0x62, (uint8_t[]){0x04}, 1, 0}, + {0x63, (uint8_t[]){0x04}, 1, 0}, + {0x64, (uint8_t[]){0xA6}, 1, 0}, + {0x65, (uint8_t[]){0x43}, 1, 0}, + {0x66, (uint8_t[]){0x30}, 1, 0}, + {0x67, (uint8_t[]){0x73}, 1, 0}, + {0x68, (uint8_t[]){0x05}, 1, 0}, + {0x69, (uint8_t[]){0x04}, 1, 0}, + {0x6A, (uint8_t[]){0x7F}, 1, 0}, + {0x6B, (uint8_t[]){0x08}, 1, 0}, + {0x6C, (uint8_t[]){0x00}, 1, 0}, + {0x6D, (uint8_t[]){0x04}, 1, 0}, + {0x6E, (uint8_t[]){0x04}, 1, 0}, + {0x6F, (uint8_t[]){0x88}, 1, 0}, + + {0x75, (uint8_t[]){0xD9}, 1, 0}, + {0x76, (uint8_t[]){0x00}, 1, 0}, + {0x77, (uint8_t[]){0x33}, 1, 0}, + {0x78, (uint8_t[]){0x43}, 1, 0}, + + {0xE0, (uint8_t[]){0x00}, 1, 0}, + {0x11, (uint8_t[]){0x00}, 1, 120}, + + {0x29, (uint8_t[]){0x00}, 1, 20}, + {0x35, (uint8_t[]){0x00}, 1, 0}, +}; +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_7 +static const ili9881c_lcd_init_cmd_t lcd_init_cmds[] = { + // {cmd, { data }, data_size, delay_ms} + /**** CMD_Page 3 ****/ + {0xFF, (uint8_t[]){0x98, 0x81, 0x03}, 3, 0}, + // {0x01, (uint8_t []){0x00}, 1, 0}, + {0x01, (uint8_t[]){0x00}, 1, 0}, + {0x02, (uint8_t[]){0x00}, 1, 0}, + {0x03, (uint8_t[]){0x73}, 1, 0}, + {0x04, (uint8_t[]){0x00}, 1, 0}, + {0x05, (uint8_t[]){0x00}, 1, 0}, + {0x06, (uint8_t[]){0x0A}, 1, 0}, + {0x07, (uint8_t[]){0x00}, 1, 0}, + {0x08, (uint8_t[]){0x00}, 1, 0}, + {0x09, (uint8_t[]){0x61}, 1, 0}, + {0x0A, (uint8_t[]){0x00}, 1, 0}, + {0x0B, (uint8_t[]){0x00}, 1, 0}, + {0x0C, (uint8_t[]){0x01}, 1, 0}, + {0x0D, (uint8_t[]){0x00}, 1, 0}, + {0x0E, (uint8_t[]){0x00}, 1, 0}, + {0x0F, (uint8_t[]){0x61}, 1, 0}, + {0x10, (uint8_t[]){0x61}, 1, 0}, + {0x11, (uint8_t[]){0x00}, 1, 0}, + {0x12, (uint8_t[]){0x00}, 1, 0}, + {0x13, (uint8_t[]){0x00}, 1, 0}, + {0x14, (uint8_t[]){0x00}, 1, 0}, + {0x15, (uint8_t[]){0x00}, 1, 0}, + {0x16, (uint8_t[]){0x00}, 1, 0}, + {0x17, (uint8_t[]){0x00}, 1, 0}, + {0x18, (uint8_t[]){0x00}, 1, 0}, + {0x19, (uint8_t[]){0x00}, 1, 0}, + {0x1A, (uint8_t[]){0x00}, 1, 0}, + {0x1B, (uint8_t[]){0x00}, 1, 0}, + {0x1C, (uint8_t[]){0x00}, 1, 0}, + {0x1D, (uint8_t[]){0x00}, 1, 0}, + {0x1E, (uint8_t[]){0x40}, 1, 0}, + {0x1F, (uint8_t[]){0x80}, 1, 0}, + {0x20, (uint8_t[]){0x06}, 1, 0}, + {0x21, (uint8_t[]){0x01}, 1, 0}, + {0x22, (uint8_t[]){0x00}, 1, 0}, + {0x23, (uint8_t[]){0x00}, 1, 0}, + {0x24, (uint8_t[]){0x00}, 1, 0}, + {0x25, (uint8_t[]){0x00}, 1, 0}, + {0x26, (uint8_t[]){0x00}, 1, 0}, + {0x27, (uint8_t[]){0x00}, 1, 0}, + {0x28, (uint8_t[]){0x33}, 1, 0}, + {0x29, (uint8_t[]){0x03}, 1, 0}, + {0x2A, (uint8_t[]){0x00}, 1, 0}, + {0x2B, (uint8_t[]){0x00}, 1, 0}, + {0x2C, (uint8_t[]){0x00}, 1, 0}, + {0x2D, (uint8_t[]){0x00}, 1, 0}, + {0x2E, (uint8_t[]){0x00}, 1, 0}, + {0x2F, (uint8_t[]){0x00}, 1, 0}, + {0x30, (uint8_t[]){0x00}, 1, 0}, + {0x31, (uint8_t[]){0x00}, 1, 0}, + {0x32, (uint8_t[]){0x00}, 1, 0}, + {0x33, (uint8_t[]){0x00}, 1, 0}, + {0x34, (uint8_t[]){0x04}, 1, 0}, + {0x35, (uint8_t[]){0x00}, 1, 0}, + {0x36, (uint8_t[]){0x00}, 1, 0}, + {0x37, (uint8_t[]){0x00}, 1, 0}, + {0x38, (uint8_t[]){0x3C}, 1, 0}, + {0x39, (uint8_t[]){0x00}, 1, 0}, + {0x3A, (uint8_t[]){0x00}, 1, 0}, + {0x3B, (uint8_t[]){0x00}, 1, 0}, + {0x3C, (uint8_t[]){0x00}, 1, 0}, + {0x3D, (uint8_t[]){0x00}, 1, 0}, + {0x3E, (uint8_t[]){0x00}, 1, 0}, + {0x3F, (uint8_t[]){0x00}, 1, 0}, + {0x40, (uint8_t[]){0x00}, 1, 0}, + {0x41, (uint8_t[]){0x00}, 1, 0}, + {0x42, (uint8_t[]){0x00}, 1, 0}, + {0x43, (uint8_t[]){0x00}, 1, 0}, + {0x44, (uint8_t[]){0x00}, 1, 0}, + {0x50, (uint8_t[]){0x10}, 1, 0}, + {0x51, (uint8_t[]){0x32}, 1, 0}, + {0x52, (uint8_t[]){0x54}, 1, 0}, + {0x53, (uint8_t[]){0x76}, 1, 0}, + {0x54, (uint8_t[]){0x98}, 1, 0}, + {0x55, (uint8_t[]){0xBA}, 1, 0}, + {0x56, (uint8_t[]){0x10}, 1, 0}, + {0x57, (uint8_t[]){0x32}, 1, 0}, + {0x58, (uint8_t[]){0x54}, 1, 0}, + {0x59, (uint8_t[]){0x76}, 1, 0}, + {0x5A, (uint8_t[]){0x98}, 1, 0}, + {0x5B, (uint8_t[]){0xBA}, 1, 0}, + {0x5C, (uint8_t[]){0xDC}, 1, 0}, + {0x5D, (uint8_t[]){0xFE}, 1, 0}, + {0x5E, (uint8_t[]){0x00}, 1, 0}, + {0x5F, (uint8_t[]){0x0E}, 1, 0}, + {0x60, (uint8_t[]){0x0F}, 1, 0}, + {0x61, (uint8_t[]){0x0C}, 1, 0}, + {0x62, (uint8_t[]){0x0D}, 1, 0}, + {0x63, (uint8_t[]){0x06}, 1, 0}, + {0x64, (uint8_t[]){0x07}, 1, 0}, + {0x65, (uint8_t[]){0x02}, 1, 0}, + {0x66, (uint8_t[]){0x02}, 1, 0}, + {0x67, (uint8_t[]){0x02}, 1, 0}, + {0x68, (uint8_t[]){0x02}, 1, 0}, + {0x69, (uint8_t[]){0x01}, 1, 0}, + {0x6A, (uint8_t[]){0x00}, 1, 0}, + {0x6B, (uint8_t[]){0x02}, 1, 0}, + {0x6C, (uint8_t[]){0x15}, 1, 0}, + {0x6D, (uint8_t[]){0x14}, 1, 0}, + {0x6E, (uint8_t[]){0x02}, 1, 0}, + {0x6F, (uint8_t[]){0x02}, 1, 0}, + {0x70, (uint8_t[]){0x02}, 1, 0}, + {0x71, (uint8_t[]){0x02}, 1, 0}, + {0x72, (uint8_t[]){0x02}, 1, 0}, + {0x73, (uint8_t[]){0x02}, 1, 0}, + {0x74, (uint8_t[]){0x02}, 1, 0}, + {0x75, (uint8_t[]){0x0E}, 1, 0}, + {0x76, (uint8_t[]){0x0F}, 1, 0}, + {0x77, (uint8_t[]){0x0C}, 1, 0}, + {0x78, (uint8_t[]){0x0D}, 1, 0}, + {0x79, (uint8_t[]){0x06}, 1, 0}, + {0x7A, (uint8_t[]){0x07}, 1, 0}, + {0x7B, (uint8_t[]){0x02}, 1, 0}, + {0x7C, (uint8_t[]){0x02}, 1, 0}, + {0x7D, (uint8_t[]){0x02}, 1, 0}, + {0x7E, (uint8_t[]){0x02}, 1, 0}, + {0x7F, (uint8_t[]){0x01}, 1, 0}, + {0x80, (uint8_t[]){0x00}, 1, 0}, + {0x81, (uint8_t[]){0x02}, 1, 0}, + {0x82, (uint8_t[]){0x14}, 1, 0}, + {0x83, (uint8_t[]){0x15}, 1, 0}, + {0x84, (uint8_t[]){0x02}, 1, 0}, + {0x85, (uint8_t[]){0x02}, 1, 0}, + {0x86, (uint8_t[]){0x02}, 1, 0}, + {0x87, (uint8_t[]){0x02}, 1, 0}, + {0x88, (uint8_t[]){0x02}, 1, 0}, + {0x89, (uint8_t[]){0x02}, 1, 0}, + {0x8A, (uint8_t[]){0x02}, 1, 0}, + + {0xFF, (uint8_t[]){0x98, 0x81, 0x04}, 3, 0}, + {0x38, (uint8_t[]){0x01}, 1, 0}, + {0x39, (uint8_t[]){0x00}, 1, 0}, + {0x6C, (uint8_t[]){0x15}, 1, 0}, + {0x6E, (uint8_t[]){0x2A}, 1, 0}, + {0x6F, (uint8_t[]){0x33}, 1, 0}, + {0x3A, (uint8_t[]){0x94}, 1, 0}, + {0x8D, (uint8_t[]){0x14}, 1, 0}, + {0x87, (uint8_t[]){0xBA}, 1, 0}, + {0x26, (uint8_t[]){0x76}, 1, 0}, + {0xB2, (uint8_t[]){0xD1}, 1, 0}, + {0xB5, (uint8_t[]){0x06}, 1, 0}, + {0X3B, (uint8_t[]){0X98}, 1, 0}, + {0xFF, (uint8_t[]){0x98, 0x81, 0x01}, 3, 0}, + {0x22, (uint8_t[]){0x0A}, 1, 0}, + {0x31, (uint8_t[]){0x00}, 1, 0}, + {0x53, (uint8_t[]){0x71}, 1, 0}, + {0x55, (uint8_t[]){0x8F}, 1, 0}, + {0x40, (uint8_t[]){0x33}, 1, 0}, + {0x50, (uint8_t[]){0x96}, 1, 0}, + {0x51, (uint8_t[]){0x96}, 1, 0}, + {0x60, (uint8_t[]){0x23}, 1, 0}, + {0xA0, (uint8_t[]){0x08}, 1, 0}, + {0xA1, (uint8_t[]){0x1D}, 1, 0}, + {0xA2, (uint8_t[]){0x2A}, 1, 0}, + {0xA3, (uint8_t[]){0x10}, 1, 0}, + {0xA4, (uint8_t[]){0x15}, 1, 0}, + {0xA5, (uint8_t[]){0x28}, 1, 0}, + {0xA6, (uint8_t[]){0x1C}, 1, 0}, + {0xA7, (uint8_t[]){0x1D}, 1, 0}, + {0xA8, (uint8_t[]){0x7E}, 1, 0}, + {0xA9, (uint8_t[]){0x1D}, 1, 0}, + {0xAA, (uint8_t[]){0x29}, 1, 0}, + {0xAB, (uint8_t[]){0x6B}, 1, 0}, + {0xAC, (uint8_t[]){0x1A}, 1, 0}, + {0xAD, (uint8_t[]){0x18}, 1, 0}, + {0xAE, (uint8_t[]){0x4B}, 1, 0}, + {0xAF, (uint8_t[]){0x20}, 1, 0}, + {0xB0, (uint8_t[]){0x27}, 1, 0}, + {0xB1, (uint8_t[]){0x50}, 1, 0}, + {0xB2, (uint8_t[]){0x64}, 1, 0}, + {0xB3, (uint8_t[]){0x39}, 1, 0}, + {0xC0, (uint8_t[]){0x08}, 1, 0}, + {0xC1, (uint8_t[]){0x1D}, 1, 0}, + {0xC2, (uint8_t[]){0x2A}, 1, 0}, + {0xC3, (uint8_t[]){0x10}, 1, 0}, + {0xC4, (uint8_t[]){0x15}, 1, 0}, + {0xC5, (uint8_t[]){0x28}, 1, 0}, + {0xC6, (uint8_t[]){0x1C}, 1, 0}, + {0xC7, (uint8_t[]){0x1D}, 1, 0}, + {0xC8, (uint8_t[]){0x7E}, 1, 0}, + {0xC9, (uint8_t[]){0x1D}, 1, 0}, + {0xCA, (uint8_t[]){0x29}, 1, 0}, + {0xCB, (uint8_t[]){0x6B}, 1, 0}, + {0xCC, (uint8_t[]){0x1A}, 1, 0}, + {0xCD, (uint8_t[]){0x18}, 1, 0}, + {0xCE, (uint8_t[]){0x4B}, 1, 0}, + {0xCF, (uint8_t[]){0x20}, 1, 0}, + {0xD0, (uint8_t[]){0x27}, 1, 0}, + {0xD1, (uint8_t[]){0x50}, 1, 0}, + {0xD2, (uint8_t[]){0x64}, 1, 0}, + {0xD3, (uint8_t[]){0x39}, 1, 0}, + + {0xFF, (uint8_t[]){0x98, 0x81, 0x00}, 3, 0}, + {0x3A, (uint8_t[]){0x77}, 1, 0}, + {0x36, (uint8_t[]){0x00}, 1, 0}, + {0x35, (uint8_t[]){0x00}, 1, 0}, + {0x35, (uint8_t[]){0x00}, 1, 0}, + {0x11, (uint8_t[]){0x00}, 0, 150}, + + {0x29, (uint8_t[]){0x00}, 0, 20}, + + //============ Gamma END=========== +}; +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_8 +static const jd9365_lcd_init_cmd_t lcd_init_cmds[] = { + {0xE0, (uint8_t[]){0x00}, 1, 0}, + {0xE1, (uint8_t[]){0x93}, 1, 0}, + {0xE2, (uint8_t[]){0x65}, 1, 0}, + {0xE3, (uint8_t[]){0xF8}, 1, 0}, + {0x80, (uint8_t[]){0x01}, 1, 0}, // 0X03:4-LANE;0X02:3-LANE;0X01:2-LANE + + {0xE0, (uint8_t[]){0x01}, 1, 0}, + {0x00, (uint8_t[]){0x00}, 1, 0}, + {0x01, (uint8_t[]){0x4E}, 1, 0}, + {0x03, (uint8_t[]){0x00}, 1, 0}, + {0x04, (uint8_t[]){0x65}, 1, 0}, + + {0x0C, (uint8_t[]){0x74}, 1, 0}, + + {0x17, (uint8_t[]){0x00}, 1, 0}, + {0x18, (uint8_t[]){0xB7}, 1, 0}, + {0x19, (uint8_t[]){0x00}, 1, 0}, + {0x1A, (uint8_t[]){0x00}, 1, 0}, + {0x1B, (uint8_t[]){0xB7}, 1, 0}, + {0x1C, (uint8_t[]){0x00}, 1, 0}, + + {0x24, (uint8_t[]){0xFE}, 1, 0}, + + {0x37, (uint8_t[]){0x19}, 1, 0}, + + {0x38, (uint8_t[]){0x05}, 1, 0}, + {0x39, (uint8_t[]){0x00}, 1, 0}, + {0x3A, (uint8_t[]){0x01}, 1, 0}, + {0x3B, (uint8_t[]){0x01}, 1, 0}, + {0x3C, (uint8_t[]){0x70}, 1, 0}, + {0x3D, (uint8_t[]){0xFF}, 1, 0}, + {0x3E, (uint8_t[]){0xFF}, 1, 0}, + {0x3F, (uint8_t[]){0xFF}, 1, 0}, + + {0x40, (uint8_t[]){0x06}, 1, 0}, + {0x41, (uint8_t[]){0xA0}, 1, 0}, + {0x43, (uint8_t[]){0x1E}, 1, 0}, + {0x44, (uint8_t[]){0x0F}, 1, 0}, + {0x45, (uint8_t[]){0x28}, 1, 0}, + {0x4B, (uint8_t[]){0x04}, 1, 0}, + + //{0x4A, (uint8_t[]){0x35}, 1, 0},//bist + + {0x55, (uint8_t[]){0x02}, 1, 0}, + {0x56, (uint8_t[]){0x01}, 1, 0}, + {0x57, (uint8_t[]){0xA9}, 1, 0}, + {0x58, (uint8_t[]){0x0A}, 1, 0}, + {0x59, (uint8_t[]){0x0A}, 1, 0}, + {0x5A, (uint8_t[]){0x37}, 1, 0}, + {0x5B, (uint8_t[]){0x19}, 1, 0}, + + {0x5D, (uint8_t[]){0x78}, 1, 0}, + {0x5E, (uint8_t[]){0x63}, 1, 0}, + {0x5F, (uint8_t[]){0x54}, 1, 0}, + {0x60, (uint8_t[]){0x49}, 1, 0}, + {0x61, (uint8_t[]){0x45}, 1, 0}, + {0x62, (uint8_t[]){0x38}, 1, 0}, + {0x63, (uint8_t[]){0x3D}, 1, 0}, + {0x64, (uint8_t[]){0x28}, 1, 0}, + {0x65, (uint8_t[]){0x43}, 1, 0}, + {0x66, (uint8_t[]){0x41}, 1, 0}, + {0x67, (uint8_t[]){0x43}, 1, 0}, + {0x68, (uint8_t[]){0x62}, 1, 0}, + {0x69, (uint8_t[]){0x50}, 1, 0}, + {0x6A, (uint8_t[]){0x57}, 1, 0}, + {0x6B, (uint8_t[]){0x49}, 1, 0}, + {0x6C, (uint8_t[]){0x44}, 1, 0}, + {0x6D, (uint8_t[]){0x37}, 1, 0}, + {0x6E, (uint8_t[]){0x23}, 1, 0}, + {0x6F, (uint8_t[]){0x10}, 1, 0}, + {0x70, (uint8_t[]){0x78}, 1, 0}, + {0x71, (uint8_t[]){0x63}, 1, 0}, + {0x72, (uint8_t[]){0x54}, 1, 0}, + {0x73, (uint8_t[]){0x49}, 1, 0}, + {0x74, (uint8_t[]){0x45}, 1, 0}, + {0x75, (uint8_t[]){0x38}, 1, 0}, + {0x76, (uint8_t[]){0x3D}, 1, 0}, + {0x77, (uint8_t[]){0x28}, 1, 0}, + {0x78, (uint8_t[]){0x43}, 1, 0}, + {0x79, (uint8_t[]){0x41}, 1, 0}, + {0x7A, (uint8_t[]){0x43}, 1, 0}, + {0x7B, (uint8_t[]){0x62}, 1, 0}, + {0x7C, (uint8_t[]){0x50}, 1, 0}, + {0x7D, (uint8_t[]){0x57}, 1, 0}, + {0x7E, (uint8_t[]){0x49}, 1, 0}, + {0x7F, (uint8_t[]){0x44}, 1, 0}, + {0x80, (uint8_t[]){0x37}, 1, 0}, + {0x81, (uint8_t[]){0x23}, 1, 0}, + {0x82, (uint8_t[]){0x10}, 1, 0}, + + {0xE0, (uint8_t[]){0x02}, 1, 0}, + {0x00, (uint8_t[]){0x47}, 1, 0}, + {0x01, (uint8_t[]){0x47}, 1, 0}, + {0x02, (uint8_t[]){0x45}, 1, 0}, + {0x03, (uint8_t[]){0x45}, 1, 0}, + {0x04, (uint8_t[]){0x4B}, 1, 0}, + {0x05, (uint8_t[]){0x4B}, 1, 0}, + {0x06, (uint8_t[]){0x49}, 1, 0}, + {0x07, (uint8_t[]){0x49}, 1, 0}, + {0x08, (uint8_t[]){0x41}, 1, 0}, + {0x09, (uint8_t[]){0x1F}, 1, 0}, + {0x0A, (uint8_t[]){0x1F}, 1, 0}, + {0x0B, (uint8_t[]){0x1F}, 1, 0}, + {0x0C, (uint8_t[]){0x1F}, 1, 0}, + {0x0D, (uint8_t[]){0x1F}, 1, 0}, + {0x0E, (uint8_t[]){0x1F}, 1, 0}, + {0x0F, (uint8_t[]){0x5F}, 1, 0}, + {0x10, (uint8_t[]){0x5F}, 1, 0}, + {0x11, (uint8_t[]){0x57}, 1, 0}, + {0x12, (uint8_t[]){0x77}, 1, 0}, + {0x13, (uint8_t[]){0x35}, 1, 0}, + {0x14, (uint8_t[]){0x1F}, 1, 0}, + {0x15, (uint8_t[]){0x1F}, 1, 0}, + + {0x16, (uint8_t[]){0x46}, 1, 0}, + {0x17, (uint8_t[]){0x46}, 1, 0}, + {0x18, (uint8_t[]){0x44}, 1, 0}, + {0x19, (uint8_t[]){0x44}, 1, 0}, + {0x1A, (uint8_t[]){0x4A}, 1, 0}, + {0x1B, (uint8_t[]){0x4A}, 1, 0}, + {0x1C, (uint8_t[]){0x48}, 1, 0}, + {0x1D, (uint8_t[]){0x48}, 1, 0}, + {0x1E, (uint8_t[]){0x40}, 1, 0}, + {0x1F, (uint8_t[]){0x1F}, 1, 0}, + {0x20, (uint8_t[]){0x1F}, 1, 0}, + {0x21, (uint8_t[]){0x1F}, 1, 0}, + {0x22, (uint8_t[]){0x1F}, 1, 0}, + {0x23, (uint8_t[]){0x1F}, 1, 0}, + {0x24, (uint8_t[]){0x1F}, 1, 0}, + {0x25, (uint8_t[]){0x5F}, 1, 0}, + {0x26, (uint8_t[]){0x5F}, 1, 0}, + {0x27, (uint8_t[]){0x57}, 1, 0}, + {0x28, (uint8_t[]){0x77}, 1, 0}, + {0x29, (uint8_t[]){0x35}, 1, 0}, + {0x2A, (uint8_t[]){0x1F}, 1, 0}, + {0x2B, (uint8_t[]){0x1F}, 1, 0}, + + {0x58, (uint8_t[]){0x40}, 1, 0}, + {0x59, (uint8_t[]){0x00}, 1, 0}, + {0x5A, (uint8_t[]){0x00}, 1, 0}, + {0x5B, (uint8_t[]){0x10}, 1, 0}, + {0x5C, (uint8_t[]){0x06}, 1, 0}, + {0x5D, (uint8_t[]){0x40}, 1, 0}, + {0x5E, (uint8_t[]){0x01}, 1, 0}, + {0x5F, (uint8_t[]){0x02}, 1, 0}, + {0x60, (uint8_t[]){0x30}, 1, 0}, + {0x61, (uint8_t[]){0x01}, 1, 0}, + {0x62, (uint8_t[]){0x02}, 1, 0}, + {0x63, (uint8_t[]){0x03}, 1, 0}, + {0x64, (uint8_t[]){0x6B}, 1, 0}, + {0x65, (uint8_t[]){0x05}, 1, 0}, + {0x66, (uint8_t[]){0x0C}, 1, 0}, + {0x67, (uint8_t[]){0x73}, 1, 0}, + {0x68, (uint8_t[]){0x09}, 1, 0}, + {0x69, (uint8_t[]){0x03}, 1, 0}, + {0x6A, (uint8_t[]){0x56}, 1, 0}, + {0x6B, (uint8_t[]){0x08}, 1, 0}, + {0x6C, (uint8_t[]){0x00}, 1, 0}, + {0x6D, (uint8_t[]){0x04}, 1, 0}, + {0x6E, (uint8_t[]){0x04}, 1, 0}, + {0x6F, (uint8_t[]){0x88}, 1, 0}, + {0x70, (uint8_t[]){0x00}, 1, 0}, + {0x71, (uint8_t[]){0x00}, 1, 0}, + {0x72, (uint8_t[]){0x06}, 1, 0}, + {0x73, (uint8_t[]){0x7B}, 1, 0}, + {0x74, (uint8_t[]){0x00}, 1, 0}, + {0x75, (uint8_t[]){0xF8}, 1, 0}, + {0x76, (uint8_t[]){0x00}, 1, 0}, + {0x77, (uint8_t[]){0xD5}, 1, 0}, + {0x78, (uint8_t[]){0x2E}, 1, 0}, + {0x79, (uint8_t[]){0x12}, 1, 0}, + {0x7A, (uint8_t[]){0x03}, 1, 0}, + {0x7B, (uint8_t[]){0x00}, 1, 0}, + {0x7C, (uint8_t[]){0x00}, 1, 0}, + {0x7D, (uint8_t[]){0x03}, 1, 0}, + {0x7E, (uint8_t[]){0x7B}, 1, 0}, + + {0xE0, (uint8_t[]){0x04}, 1, 0}, + {0x00, (uint8_t[]){0x0E}, 1, 0}, + {0x02, (uint8_t[]){0xB3}, 1, 0}, + {0x09, (uint8_t[]){0x60}, 1, 0}, + {0x0E, (uint8_t[]){0x2A}, 1, 0}, + {0x36, (uint8_t[]){0x59}, 1, 0}, + {0x37, (uint8_t[]){0x58}, 1, 0}, // A133 + {0x2B, (uint8_t[]){0x0F}, 1, 0}, // A133 + + {0xE0, (uint8_t[]){0x00}, 1, 0}, + + {0x11, (uint8_t[]){0x00}, 1, 120}, + + {0x29, (uint8_t[]){0x00}, 1, 20}, + + {0x35, (uint8_t[]){0x00}, 1, 0}, +}; +#elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_10_1 +static const jd9365_lcd_init_cmd_t lcd_init_cmds[] = { + {0xE0, (uint8_t[]){0x00}, 1, 0}, + {0xE1, (uint8_t[]){0x93}, 1, 0}, + {0xE2, (uint8_t[]){0x65}, 1, 0}, + {0xE3, (uint8_t[]){0xF8}, 1, 0}, + {0x80, (uint8_t[]){0x01}, 1, 0}, + + {0xE0, (uint8_t[]){0x01}, 1, 0}, + {0x00, (uint8_t[]){0x00}, 1, 0}, + {0x01, (uint8_t[]){0x38}, 1, 0}, + {0x03, (uint8_t[]){0x10}, 1, 0}, + {0x04, (uint8_t[]){0x38}, 1, 0}, + + {0x0C, (uint8_t[]){0x74}, 1, 0}, + + {0x17, (uint8_t[]){0x00}, 1, 0}, + {0x18, (uint8_t[]){0xAF}, 1, 0}, + {0x19, (uint8_t[]){0x00}, 1, 0}, + {0x1A, (uint8_t[]){0x00}, 1, 0}, + {0x1B, (uint8_t[]){0xAF}, 1, 0}, + {0x1C, (uint8_t[]){0x00}, 1, 0}, + + {0x35, (uint8_t[]){0x26}, 1, 0}, + + {0x37, (uint8_t[]){0x09}, 1, 0}, + + {0x38, (uint8_t[]){0x04}, 1, 0}, + {0x39, (uint8_t[]){0x00}, 1, 0}, + {0x3A, (uint8_t[]){0x01}, 1, 0}, + {0x3C, (uint8_t[]){0x78}, 1, 0}, + {0x3D, (uint8_t[]){0xFF}, 1, 0}, + {0x3E, (uint8_t[]){0xFF}, 1, 0}, + {0x3F, (uint8_t[]){0x7F}, 1, 0}, + + {0x40, (uint8_t[]){0x06}, 1, 0}, + {0x41, (uint8_t[]){0xA0}, 1, 0}, + {0x42, (uint8_t[]){0x81}, 1, 0}, + {0x43, (uint8_t[]){0x1E}, 1, 0}, + {0x44, (uint8_t[]){0x0D}, 1, 0}, + {0x45, (uint8_t[]){0x28}, 1, 0}, + //{0x4A, (uint8_t[]){0x35}, 1, 0},//bist + + {0x55, (uint8_t[]){0x02}, 1, 0}, + {0x57, (uint8_t[]){0x69}, 1, 0}, + {0x59, (uint8_t[]){0x0A}, 1, 0}, + {0x5A, (uint8_t[]){0x2A}, 1, 0}, + {0x5B, (uint8_t[]){0x17}, 1, 0}, + + {0x5D, (uint8_t[]){0x7F}, 1, 0}, + {0x5E, (uint8_t[]){0x6A}, 1, 0}, + {0x5F, (uint8_t[]){0x5B}, 1, 0}, + {0x60, (uint8_t[]){0x4F}, 1, 0}, + {0x61, (uint8_t[]){0x4A}, 1, 0}, + {0x62, (uint8_t[]){0x3D}, 1, 0}, + {0x63, (uint8_t[]){0x41}, 1, 0}, + {0x64, (uint8_t[]){0x2A}, 1, 0}, + {0x65, (uint8_t[]){0x44}, 1, 0}, + {0x66, (uint8_t[]){0x43}, 1, 0}, + {0x67, (uint8_t[]){0x44}, 1, 0}, + {0x68, (uint8_t[]){0x62}, 1, 0}, + {0x69, (uint8_t[]){0x52}, 1, 0}, + {0x6A, (uint8_t[]){0x59}, 1, 0}, + {0x6B, (uint8_t[]){0x4C}, 1, 0}, + {0x6C, (uint8_t[]){0x48}, 1, 0}, + {0x6D, (uint8_t[]){0x3A}, 1, 0}, + {0x6E, (uint8_t[]){0x26}, 1, 0}, + {0x6F, (uint8_t[]){0x00}, 1, 0}, + {0x70, (uint8_t[]){0x7F}, 1, 0}, + {0x71, (uint8_t[]){0x6A}, 1, 0}, + {0x72, (uint8_t[]){0x5B}, 1, 0}, + {0x73, (uint8_t[]){0x4F}, 1, 0}, + {0x74, (uint8_t[]){0x4A}, 1, 0}, + {0x75, (uint8_t[]){0x3D}, 1, 0}, + {0x76, (uint8_t[]){0x41}, 1, 0}, + {0x77, (uint8_t[]){0x2A}, 1, 0}, + {0x78, (uint8_t[]){0x44}, 1, 0}, + {0x79, (uint8_t[]){0x43}, 1, 0}, + {0x7A, (uint8_t[]){0x44}, 1, 0}, + {0x7B, (uint8_t[]){0x62}, 1, 0}, + {0x7C, (uint8_t[]){0x52}, 1, 0}, + {0x7D, (uint8_t[]){0x59}, 1, 0}, + {0x7E, (uint8_t[]){0x4C}, 1, 0}, + {0x7F, (uint8_t[]){0x48}, 1, 0}, + {0x80, (uint8_t[]){0x3A}, 1, 0}, + {0x81, (uint8_t[]){0x26}, 1, 0}, + {0x82, (uint8_t[]){0x00}, 1, 0}, + + {0xE0, (uint8_t[]){0x02}, 1, 0}, + {0x00, (uint8_t[]){0x42}, 1, 0}, + {0x01, (uint8_t[]){0x42}, 1, 0}, + {0x02, (uint8_t[]){0x40}, 1, 0}, + {0x03, (uint8_t[]){0x40}, 1, 0}, + {0x04, (uint8_t[]){0x5E}, 1, 0}, + {0x05, (uint8_t[]){0x5E}, 1, 0}, + {0x06, (uint8_t[]){0x5F}, 1, 0}, + {0x07, (uint8_t[]){0x5F}, 1, 0}, + {0x08, (uint8_t[]){0x5F}, 1, 0}, + {0x09, (uint8_t[]){0x57}, 1, 0}, + {0x0A, (uint8_t[]){0x57}, 1, 0}, + {0x0B, (uint8_t[]){0x77}, 1, 0}, + {0x0C, (uint8_t[]){0x77}, 1, 0}, + {0x0D, (uint8_t[]){0x47}, 1, 0}, + {0x0E, (uint8_t[]){0x47}, 1, 0}, + {0x0F, (uint8_t[]){0x45}, 1, 0}, + {0x10, (uint8_t[]){0x45}, 1, 0}, + {0x11, (uint8_t[]){0x4B}, 1, 0}, + {0x12, (uint8_t[]){0x4B}, 1, 0}, + {0x13, (uint8_t[]){0x49}, 1, 0}, + {0x14, (uint8_t[]){0x49}, 1, 0}, + {0x15, (uint8_t[]){0x5F}, 1, 0}, + + {0x16, (uint8_t[]){0x41}, 1, 0}, + {0x17, (uint8_t[]){0x41}, 1, 0}, + {0x18, (uint8_t[]){0x40}, 1, 0}, + {0x19, (uint8_t[]){0x40}, 1, 0}, + {0x1A, (uint8_t[]){0x5E}, 1, 0}, + {0x1B, (uint8_t[]){0x5E}, 1, 0}, + {0x1C, (uint8_t[]){0x5F}, 1, 0}, + {0x1D, (uint8_t[]){0x5F}, 1, 0}, + {0x1E, (uint8_t[]){0x5F}, 1, 0}, + {0x1F, (uint8_t[]){0x57}, 1, 0}, + {0x20, (uint8_t[]){0x57}, 1, 0}, + {0x21, (uint8_t[]){0x77}, 1, 0}, + {0x22, (uint8_t[]){0x77}, 1, 0}, + {0x23, (uint8_t[]){0x46}, 1, 0}, + {0x24, (uint8_t[]){0x46}, 1, 0}, + {0x25, (uint8_t[]){0x44}, 1, 0}, + {0x26, (uint8_t[]){0x44}, 1, 0}, + {0x27, (uint8_t[]){0x4A}, 1, 0}, + {0x28, (uint8_t[]){0x4A}, 1, 0}, + {0x29, (uint8_t[]){0x48}, 1, 0}, + {0x2A, (uint8_t[]){0x48}, 1, 0}, + {0x2B, (uint8_t[]){0x5F}, 1, 0}, + + {0x2C, (uint8_t[]){0x01}, 1, 0}, + {0x2D, (uint8_t[]){0x01}, 1, 0}, + {0x2E, (uint8_t[]){0x00}, 1, 0}, + {0x2F, (uint8_t[]){0x00}, 1, 0}, + {0x30, (uint8_t[]){0x1F}, 1, 0}, + {0x31, (uint8_t[]){0x1F}, 1, 0}, + {0x32, (uint8_t[]){0x1E}, 1, 0}, + {0x33, (uint8_t[]){0x1E}, 1, 0}, + {0x34, (uint8_t[]){0x1F}, 1, 0}, + {0x35, (uint8_t[]){0x17}, 1, 0}, + {0x36, (uint8_t[]){0x17}, 1, 0}, + {0x37, (uint8_t[]){0x37}, 1, 0}, + {0x38, (uint8_t[]){0x37}, 1, 0}, + {0x39, (uint8_t[]){0x08}, 1, 0}, + {0x3A, (uint8_t[]){0x08}, 1, 0}, + {0x3B, (uint8_t[]){0x0A}, 1, 0}, + {0x3C, (uint8_t[]){0x0A}, 1, 0}, + {0x3D, (uint8_t[]){0x04}, 1, 0}, + {0x3E, (uint8_t[]){0x04}, 1, 0}, + {0x3F, (uint8_t[]){0x06}, 1, 0}, + {0x40, (uint8_t[]){0x06}, 1, 0}, + {0x41, (uint8_t[]){0x1F}, 1, 0}, + + {0x42, (uint8_t[]){0x02}, 1, 0}, + {0x43, (uint8_t[]){0x02}, 1, 0}, + {0x44, (uint8_t[]){0x00}, 1, 0}, + {0x45, (uint8_t[]){0x00}, 1, 0}, + {0x46, (uint8_t[]){0x1F}, 1, 0}, + {0x47, (uint8_t[]){0x1F}, 1, 0}, + {0x48, (uint8_t[]){0x1E}, 1, 0}, + {0x49, (uint8_t[]){0x1E}, 1, 0}, + {0x4A, (uint8_t[]){0x1F}, 1, 0}, + {0x4B, (uint8_t[]){0x17}, 1, 0}, + {0x4C, (uint8_t[]){0x17}, 1, 0}, + {0x4D, (uint8_t[]){0x37}, 1, 0}, + {0x4E, (uint8_t[]){0x37}, 1, 0}, + {0x4F, (uint8_t[]){0x09}, 1, 0}, + {0x50, (uint8_t[]){0x09}, 1, 0}, + {0x51, (uint8_t[]){0x0B}, 1, 0}, + {0x52, (uint8_t[]){0x0B}, 1, 0}, + {0x53, (uint8_t[]){0x05}, 1, 0}, + {0x54, (uint8_t[]){0x05}, 1, 0}, + {0x55, (uint8_t[]){0x07}, 1, 0}, + {0x56, (uint8_t[]){0x07}, 1, 0}, + {0x57, (uint8_t[]){0x1F}, 1, 0}, + + {0x58, (uint8_t[]){0x40}, 1, 0}, + {0x5B, (uint8_t[]){0x30}, 1, 0}, + {0x5C, (uint8_t[]){0x00}, 1, 0}, + {0x5D, (uint8_t[]){0x34}, 1, 0}, + {0x5E, (uint8_t[]){0x05}, 1, 0}, + {0x5F, (uint8_t[]){0x02}, 1, 0}, + {0x63, (uint8_t[]){0x00}, 1, 0}, + {0x64, (uint8_t[]){0x6A}, 1, 0}, + {0x67, (uint8_t[]){0x73}, 1, 0}, + {0x68, (uint8_t[]){0x07}, 1, 0}, + {0x69, (uint8_t[]){0x08}, 1, 0}, + {0x6A, (uint8_t[]){0x6A}, 1, 0}, + {0x6B, (uint8_t[]){0x08}, 1, 0}, + + {0x6C, (uint8_t[]){0x00}, 1, 0}, + {0x6D, (uint8_t[]){0x00}, 1, 0}, + {0x6E, (uint8_t[]){0x00}, 1, 0}, + {0x6F, (uint8_t[]){0x88}, 1, 0}, + + {0x75, (uint8_t[]){0xFF}, 1, 0}, + {0x77, (uint8_t[]){0xDD}, 1, 0}, + {0x78, (uint8_t[]){0x2C}, 1, 0}, + {0x79, (uint8_t[]){0x15}, 1, 0}, + {0x7A, (uint8_t[]){0x17}, 1, 0}, + {0x7D, (uint8_t[]){0x14}, 1, 0}, + {0x7E, (uint8_t[]){0x82}, 1, 0}, + + {0xE0, (uint8_t[]){0x04}, 1, 0}, + {0x00, (uint8_t[]){0x0E}, 1, 0}, + {0x02, (uint8_t[]){0xB3}, 1, 0}, + {0x09, (uint8_t[]){0x61}, 1, 0}, + {0x0E, (uint8_t[]){0x48}, 1, 0}, + {0x37, (uint8_t[]){0x58}, 1, 0}, // 全志 + {0x2B, (uint8_t[]){0x0F}, 1, 0}, // 全志 + + {0xE0, (uint8_t[]){0x00}, 1, 0}, + + {0xE6, (uint8_t[]){0x02}, 1, 0}, + {0xE7, (uint8_t[]){0x0C}, 1, 0}, + + {0x11, (uint8_t[]){0x00}, 1, 120}, + + {0x29, (uint8_t[]){0x00}, 1, 20}, +}; +#endif \ No newline at end of file