Add ESP32-S3 camera component selection and support (#1670)

Introduces a new esp32s3_camera implementation for ESP32-S3 boards using the esp_camera component, with conditional compilation and Kconfig options to select between esp_camera and esp_video. Updates board initialization code and config files to use the new camera class where appropriate, and adjusts build system and dependencies to support both camera components on ESP32-S3 and ESP32-P4 targets.
This commit is contained in:
Kevincoooool
2026-01-20 19:56:36 +08:00
committed by GitHub
parent 89674f8838
commit d5ec8f7081
13 changed files with 699 additions and 170 deletions

View File

@ -53,6 +53,7 @@ list(APPEND SOURCES
"boards/common/backlight.cc"
"boards/common/button.cc"
"boards/common/esp32_camera.cc"
"boards/common/esp32s3_camera.cc"
"boards/common/i2c_device.cc"
"boards/common/knob.cc"
"boards/common/power_save_timer.cc"
@ -758,10 +759,30 @@ if(CONFIG_IDF_TARGET_ESP32)
"display/lvgl_display/jpg/image_to_jpeg.cpp"
"display/lvgl_display/jpg/jpeg_to_image.c"
"boards/common/esp32_camera.cc"
"boards/common/esp32s3_camera.cc"
"boards/common/nt26_board.cc"
)
endif()
# ESP32-S3: 根据 Kconfig 选择使用哪个摄像头组件
if(CONFIG_IDF_TARGET_ESP32S3)
if(CONFIG_XIAOZHI_USE_ESP_CAMERA)
# 使用 esp_camera 组件,排除 esp32_camera.cc
list(REMOVE_ITEM SOURCES "boards/common/esp32_camera.cc")
elseif(CONFIG_XIAOZHI_USE_ESP_VIDEO)
# 使用 esp_video 组件,排除 esp32s3_camera.cc
list(REMOVE_ITEM SOURCES "boards/common/esp32s3_camera.cc")
else()
# 默认使用 esp_camera 组件
list(REMOVE_ITEM SOURCES "boards/common/esp32_camera.cc")
endif()
endif()
# ESP32-P4: 只能使用 esp_video 组件,排除 esp32s3_camera.cc
if(CONFIG_IDF_TARGET_ESP32P4)
list(REMOVE_ITEM SOURCES "boards/common/esp32s3_camera.cc")
endif()
idf_component_register(SRCS ${SOURCES}
EMBED_FILES ${LANG_SOUNDS} ${COMMON_SOUNDS}
INCLUDE_DIRS ${INCLUDE_DIRS}