mirror of
https://github.com/espressif/esp32-camera.git
synced 2025-07-04 08:03:17 +08:00
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:
@ -85,7 +85,7 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
|
|||||||
# include the SCCB I2C driver
|
# include the SCCB I2C driver
|
||||||
# this uses either the legacy I2C API or the newwer version from IDF v5.4
|
# 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
|
# 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)
|
list(APPEND srcs driver/sccb-ng.c)
|
||||||
else()
|
else()
|
||||||
list(APPEND srcs driver/sccb.c)
|
list(APPEND srcs driver/sccb.c)
|
||||||
|
14
Kconfig
14
Kconfig
@ -124,6 +124,20 @@ menu "Camera configuration"
|
|||||||
Enable this option if you want to use the MEGA CCM.
|
Enable this option if you want to use the MEGA CCM.
|
||||||
Disable this option to save memory.
|
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
|
choice SCCB_HARDWARE_I2C_PORT
|
||||||
bool "I2C peripheral to use for SCCB"
|
bool "I2C peripheral to use for SCCB"
|
||||||
default SCCB_HARDWARE_I2C_PORT1
|
default SCCB_HARDWARE_I2C_PORT1
|
||||||
|
Reference in New Issue
Block a user