From 3176a45ebe261edec6a362ba9ab80f89f694b4d5 Mon Sep 17 00:00:00 2001 From: Y1hsiaochunnn <66012385+Y1hsiaochunnn@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:20:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5esp-video=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8=E6=91=84=E5=83=8F=E5=A4=B4=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=88waveshare=20s3-3.5=E3=80=81s3-3.5b=E3=80=81s3?= =?UTF-8?q?-audio-board=EF=BC=89=20(#1291)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 同步esp-video组件驱动摄像头的配置 * 修改Waveshare ESP32-S3-AUDIO-Board 摄像头配置。 * Modify the XCLK parameters of the camera, and modify the config.txt to be compatible with 2640 and 5640. * Update the esp_video component version to 1.3.0 * Downgrade the esp_video component version. There are unfixed bugs. * Update component version --- main/boards/esp32-s3-touch-lcd-3.5/config.json | 10 +++++++++- .../esp32-s3-touch-lcd-3.5.cc | 12 ++++-------- main/boards/waveshare-s3-audio-board/config.json | 12 +++++++++++- .../esp32-s3-audio_board.cc | 16 ++++++---------- .../waveshare-s3-touch-lcd-3.5b/config.json | 10 +++++++++- .../waveshare-s3-touch-lcd-3.5b.cc | 12 ++++-------- main/idf_component.yml | 2 +- 7 files changed, 44 insertions(+), 30 deletions(-) diff --git a/main/boards/esp32-s3-touch-lcd-3.5/config.json b/main/boards/esp32-s3-touch-lcd-3.5/config.json index 45e34fa5..7c6e5f17 100644 --- a/main/boards/esp32-s3-touch-lcd-3.5/config.json +++ b/main/boards/esp32-s3-touch-lcd-3.5/config.json @@ -4,7 +4,15 @@ { "name": "esp32-s3-touch-lcd-3.5", "sdkconfig_append": [ - "CONFIG_USE_WECHAT_MESSAGE_STYLE=y" + "CONFIG_USE_WECHAT_MESSAGE_STYLE=y", + "CONFIG_CAMERA_OV2640=y", + "CONFIG_CAMERA_OV2640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV2640_DVP_YUV422_640X480_6FPS=y", + "CONFIG_CAMERA_OV2640_DVP_IF_FORMAT_INDEX_DEFAULT=1", + "CONFIG_CAMERA_OV5640=y", + "CONFIG_CAMERA_OV5640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5640_DVP_YUV422_800X600_10FPS=y", + "CONFIG_CAMERA_OV5640_DVP_IF_FORMAT_INDEX_DEFAULT=0" ] } ] diff --git a/main/boards/esp32-s3-touch-lcd-3.5/esp32-s3-touch-lcd-3.5.cc b/main/boards/esp32-s3-touch-lcd-3.5/esp32-s3-touch-lcd-3.5.cc index 9c79b2a8..9c2debb9 100644 --- a/main/boards/esp32-s3-touch-lcd-3.5/esp32-s3-touch-lcd-3.5.cc +++ b/main/boards/esp32-s3-touch-lcd-3.5/esp32-s3-touch-lcd-3.5.cc @@ -193,13 +193,9 @@ private: }; esp_video_init_sccb_config_t sccb_config = { - .init_sccb = true, - .i2c_config = { - .port = I2C_NUM_0, - .scl_pin = CAM_PIN_SIOC, - .sda_pin = CAM_PIN_SIOD, - }, - .freq = 100000, + .init_sccb = false, // 不初始化新的 SCCB,使用现有的 I2C 总线 + .i2c_handle = i2c_bus_, // 使用现有的 I2C 总线句柄 + .freq = 100000, // 100kHz }; esp_video_init_dvp_config_t dvp_config = { @@ -207,7 +203,7 @@ private: .reset_pin = CAM_PIN_RESET, .pwdn_pin = CAM_PIN_PWDN, .dvp_pin = dvp_pin_config, - .xclk_freq = 10000000, + .xclk_freq = 12000000, }; esp_video_init_config_t video_config = { diff --git a/main/boards/waveshare-s3-audio-board/config.json b/main/boards/waveshare-s3-audio-board/config.json index 2f21e320..c1c776ba 100644 --- a/main/boards/waveshare-s3-audio-board/config.json +++ b/main/boards/waveshare-s3-audio-board/config.json @@ -3,7 +3,17 @@ "builds": [ { "name": "waveshare-s3-audio-board", - "sdkconfig_append": [] + "sdkconfig_append": [ + "CONFIG_USE_WECHAT_MESSAGE_STYLE=y", + "CONFIG_CAMERA_OV2640=y", + "CONFIG_CAMERA_OV2640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV2640_DVP_YUV422_640X480_6FPS=y", + "CONFIG_CAMERA_OV2640_DVP_IF_FORMAT_INDEX_DEFAULT=1", + "CONFIG_CAMERA_OV5640=y", + "CONFIG_CAMERA_OV5640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5640_DVP_YUV422_800X600_10FPS=y", + "CONFIG_CAMERA_OV5640_DVP_IF_FORMAT_INDEX_DEFAULT=0" + ] } ] } \ No newline at end of file diff --git a/main/boards/waveshare-s3-audio-board/esp32-s3-audio_board.cc b/main/boards/waveshare-s3-audio-board/esp32-s3-audio_board.cc index 7bef240b..85948c65 100644 --- a/main/boards/waveshare-s3-audio-board/esp32-s3-audio_board.cc +++ b/main/boards/waveshare-s3-audio-board/esp32-s3-audio_board.cc @@ -20,7 +20,7 @@ #include "led/circular_strip.h" #include "esp_lcd_jd9853.h" -#define TAG "waveshare_lcd_1_85c" +#define TAG "waveshare_s3_audio_board" #define LCD_OPCODE_WRITE_CMD (0x02ULL) #define LCD_OPCODE_READ_CMD (0x0BULL) @@ -175,13 +175,9 @@ private: }; esp_video_init_sccb_config_t sccb_config = { - .init_sccb = true, - .i2c_config = { - .port = 0, - .scl_pin = CAMERA_PIN_SIOC, - .sda_pin = CAMERA_PIN_SIOD, - }, - .freq = 100000, + .init_sccb = false, // 不初始化新的 SCCB,使用现有的 I2C 总线 + .i2c_handle = i2c_bus_, // 使用现有的 I2C 总线句柄 + .freq = 100000, // 100kHz }; esp_video_init_dvp_config_t dvp_config = { @@ -189,7 +185,7 @@ private: .reset_pin = CAMERA_PIN_RESET, .pwdn_pin = CAMERA_PIN_PWDN, .dvp_pin = dvp_pin_config, - .xclk_freq = XCLK_FREQ_HZ, + .xclk_freq = 12000000, }; esp_video_init_config_t video_config = { @@ -197,7 +193,7 @@ private: }; camera_ = new Esp32Camera(video_config); - camera_->SetVFlip(1); + } public: CustomBoard() : diff --git a/main/boards/waveshare-s3-touch-lcd-3.5b/config.json b/main/boards/waveshare-s3-touch-lcd-3.5b/config.json index aaa7c6e6..27c8e94c 100644 --- a/main/boards/waveshare-s3-touch-lcd-3.5b/config.json +++ b/main/boards/waveshare-s3-touch-lcd-3.5b/config.json @@ -4,7 +4,15 @@ { "name": "waveshare-s3-touch-lcd-3.5b", "sdkconfig_append": [ - "CONFIG_USE_WECHAT_MESSAGE_STYLE=y" + "CONFIG_USE_WECHAT_MESSAGE_STYLE=y", + "CONFIG_CAMERA_OV2640=y", + "CONFIG_CAMERA_OV2640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV2640_DVP_YUV422_640X480_6FPS=y", + "CONFIG_CAMERA_OV2640_DVP_IF_FORMAT_INDEX_DEFAULT=1", + "CONFIG_CAMERA_OV5640=y", + "CONFIG_CAMERA_OV5640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y", + "CONFIG_CAMERA_OV5640_DVP_YUV422_800X600_10FPS=y", + "CONFIG_CAMERA_OV5640_DVP_IF_FORMAT_INDEX_DEFAULT=0" ] } ] diff --git a/main/boards/waveshare-s3-touch-lcd-3.5b/waveshare-s3-touch-lcd-3.5b.cc b/main/boards/waveshare-s3-touch-lcd-3.5b/waveshare-s3-touch-lcd-3.5b.cc index 34764726..2b89f944 100644 --- a/main/boards/waveshare-s3-touch-lcd-3.5b/waveshare-s3-touch-lcd-3.5b.cc +++ b/main/boards/waveshare-s3-touch-lcd-3.5b/waveshare-s3-touch-lcd-3.5b.cc @@ -196,13 +196,9 @@ private: }; esp_video_init_sccb_config_t sccb_config = { - .init_sccb = true, - .i2c_config = { - .port = I2C_NUM_0, - .scl_pin = CAM_PIN_SIOC, - .sda_pin = CAM_PIN_SIOD, - }, - .freq = 100000, + .init_sccb = false, // 不初始化新的 SCCB,使用现有的 I2C 总线 + .i2c_handle = i2c_bus_, // 使用现有的 I2C 总线句柄 + .freq = 100000, // 100kHz }; esp_video_init_dvp_config_t dvp_config = { @@ -210,7 +206,7 @@ private: .reset_pin = CAM_PIN_RESET, .pwdn_pin = CAM_PIN_PWDN, .dvp_pin = dvp_pin_config, - .xclk_freq = 10000000, + .xclk_freq = 12000000, }; esp_video_init_config_t video_config = { diff --git a/main/idf_component.yml b/main/idf_component.yml index 7edfe193..f3f32ebf 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -27,7 +27,7 @@ dependencies: espressif/button: ~4.1.3 espressif/knob: ^1.0.0 espressif/esp_video: - version: '==1.2.0' # for compatibility. update version may need to modify this project code. + version: '==1.3.1' # for compatibility. update version may need to modify this project code. rules: - if: target not in [esp32] espressif/esp_lcd_touch_ft5x06: ~1.0.7