Skip to content

Commit 1923553

Browse files
authored
Merge pull request #746 from esp-cpp/master
feat: Allow users to configure new/legacy I2C driver for SCCB hardware
2 parents 6e5c163 + 0fe33c0 commit 1923553

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
8585
# include the SCCB I2C driver
8686
# this uses either the legacy I2C API or the newwer version from IDF v5.4
8787
# as this features a method to obtain the I2C driver from a port number
88-
if (idf_version VERSION_GREATER_EQUAL "5.4")
88+
if (idf_version VERSION_GREATER_EQUAL "5.4" AND NOT CONFIG_SCCB_HARDWARE_I2C_DRIVER_LEGACY)
8989
list(APPEND srcs driver/sccb-ng.c)
9090
else()
9191
list(APPEND srcs driver/sccb.c)

Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ menu "Camera configuration"
124124
Enable this option if you want to use the MEGA CCM.
125125
Disable this option to save memory.
126126

127+
choice SCCB_HARDWARE_I2C_DRIVER_SELECTION
128+
prompt "I2C driver selection for SCCB"
129+
default SCCB_HARDWARE_I2C_DRIVER_NEW
130+
help
131+
Select the I2C driver to use for SCCB communication.
132+
NOTE: new driver is only supported for ESP-IDF >= 5.4.
133+
134+
config SCCB_HARDWARE_I2C_DRIVER_LEGACY
135+
bool "Legacy I2C driver"
136+
config SCCB_HARDWARE_I2C_DRIVER_NEW
137+
bool "New I2C driver"
138+
139+
endchoice
140+
127141
choice SCCB_HARDWARE_I2C_PORT
128142
bool "I2C peripheral to use for SCCB"
129143
default SCCB_HARDWARE_I2C_PORT1

0 commit comments

Comments
 (0)