diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ebc992..e021df0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Kconfig b/Kconfig index 2285e43..124a597 100755 --- a/Kconfig +++ b/Kconfig @@ -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