Merge pull request #746 from esp-cpp/master

feat: Allow users to configure new/legacy I2C driver for SCCB hardware
This commit is contained in:
Me No Dev
2025-06-30 19:14:06 +03:00
committed by GitHub
2 changed files with 15 additions and 1 deletions

View File

@ -85,7 +85,7 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
# include the SCCB I2C driver
# this uses either the legacy I2C API or the newwer version from IDF v5.4
# as this features a method to obtain the I2C driver from a port number
if (idf_version VERSION_GREATER_EQUAL "5.4")
if (idf_version VERSION_GREATER_EQUAL "5.4" AND NOT CONFIG_SCCB_HARDWARE_I2C_DRIVER_LEGACY)
list(APPEND srcs driver/sccb-ng.c)
else()
list(APPEND srcs driver/sccb.c)

14
Kconfig
View File

@ -124,6 +124,20 @@ menu "Camera configuration"
Enable this option if you want to use the MEGA CCM.
Disable this option to save memory.
choice SCCB_HARDWARE_I2C_DRIVER_SELECTION
prompt "I2C driver selection for SCCB"
default SCCB_HARDWARE_I2C_DRIVER_NEW
help
Select the I2C driver to use for SCCB communication.
NOTE: new driver is only supported for ESP-IDF >= 5.4.
config SCCB_HARDWARE_I2C_DRIVER_LEGACY
bool "Legacy I2C driver"
config SCCB_HARDWARE_I2C_DRIVER_NEW
bool "New I2C driver"
endchoice
choice SCCB_HARDWARE_I2C_PORT
bool "I2C peripheral to use for SCCB"
default SCCB_HARDWARE_I2C_PORT1