I2C Manager Kconfig now generic

This commit is contained in:
Rop Gonggrijp 2021-07-12 10:24:11 +02:00
parent 048438738c
commit ef76fd1056
2 changed files with 98 additions and 99 deletions

View file

@ -4,6 +4,11 @@ menu "LVGL ESP Drivers"
rsource "lvgl_touch/Kconfig" rsource "lvgl_touch/Kconfig"
rsource "i2c_manager/Kconfig" menu "I2C Port Settings"
depends on LV_I2C && !HAVE_I2C_MANAGER
rsource "i2c_manager/Kconfig"
endmenu
endmenu endmenu

View file

@ -1,102 +1,96 @@
menu "I2C Port Settings" menu "I2C Port 0"
depends on LV_I2C && !HAVE_I2C_MANAGER
menu "I2C Port 0" config I2C_MANAGER_0_ENABLED
bool "Enable I2C port 0"
config I2C_MANAGER_0_ENABLED if I2C_MANAGER_0_ENABLED
bool "Enable I2C port 0" config I2C_MANAGER_0_SDA
int "SDA (GPIO pin)"
if I2C_MANAGER_0_ENABLED config I2C_MANAGER_0_SCL
config I2C_MANAGER_0_SDA int "SCL (GPIO pin)"
int "SDA (GPIO pin)" config I2C_MANAGER_0_FREQ_HZ
config I2C_MANAGER_0_SCL int "Frequency (Hz)"
int "SCL (GPIO pin)" default 400000
config I2C_MANAGER_0_FREQ_HZ range 100000 5000000
int "Frequency (Hz)" help
default 400000 The clock speed in Hz. Ranges from 100000 (100 kHz) to
range 100000 5000000 5000000 (5 Mhz). I2C busses that involve external wires may
help have to be slower, and the real maximum speed the bus will
The clock speed in Hz. Ranges from 100000 (100 kHz) to support depends on the value of the pullup resistors and the
5000000 (5 Mhz). I2C busses that involve external wires may design of the overall circuit.
have to be slower, and the real maximum speed the bus will config I2C_MANAGER_0_TIMEOUT
support depends on the value of the pullup resistors and the int "R/W timeout (ms)"
design of the overall circuit. default 20
config I2C_MANAGER_0_TIMEOUT range 10 1000
int "R/W timeout (ms)" help
default 20 Timeout for I2C read and write operations. This does not
range 10 1000 include the time waiting for a lock.
help config I2C_MANAGER_0_LOCK_TIMEOUT
Timeout for I2C read and write operations. This does not int "Stale lock override (ms)"
include the time waiting for a lock. default 50
config I2C_MANAGER_0_LOCK_TIMEOUT range 10 1000
int "Stale lock override (ms)" help
default 50 Timeout at which point an operation waiting for its turn on
range 10 1000 the port will assume that whatever set the lock has died and
help overrides it. Set this somewhat larger than the previous
Timeout at which point an operation waiting for its turn on timeout.
the port will assume that whatever set the lock has died and config I2C_MANAGER_0_PULLUPS
overrides it. Set this somewhat larger than the previous bool "Use ESP32 built-in bus pull-up resistors"
timeout. help
config I2C_MANAGER_0_PULLUPS The I2C bus needs resistors to make sure it's in a defined
bool "Use ESP32 built-in bus pull-up resistors" state when nobody is talking. Many circuits have external
help pullup resistors already and turning these on will increase
The I2C bus needs resistors to make sure it's in a defined power consumption slightly and may limit the speed your bus
state when nobody is talking. Many circuits have external can attain. Try with these off first if you don't know.
pullup resistors already and turning these on will increase endif
power consumption slightly and may limit the speed your bus
can attain. Try with these off first if you don't know.
endif
endmenu
menu "I2C Port 1"
config I2C_MANAGER_1_ENABLED
bool "Enable I2C port 1"
if I2C_MANAGER_1_ENABLED
config I2C_MANAGER_1_SDA
int "SDA (GPIO pin)"
config I2C_MANAGER_1_SCL
int "SCL (GPIO pin)"
config I2C_MANAGER_1_FREQ_HZ
int "Frequency (Hz)"
default 1000000
range 100000 5000000
help
The clock speed in Hz. Ranges from 100000 (100 kHz) to
5000000 (5 Mhz). I2C busses that involve external wires may
have to be slower, and the real maximum speed the bus will
support depends on the value of the pullup resistors and the
design of the overall circuit.
config I2C_MANAGER_1_TIMEOUT
int "R/W timeout (ms)"
default 20
range 10 1000
help
Timeout for I2C read and write operations. This does not
include the time waiting for a lock. Default should be fine.
config I2C_MANAGER_1_LOCK_TIMEOUT
int "Stale lock override (ms)"
default 50
help
Timeout at which point an operation waiting for its turn on
the port will assume that whatever set the lock has died and
overrides it. Set this somewhat larger than the previous
timeout. Default should be fine.
range 30 1000
config I2C_MANAGER_1_PULLUPS
bool "Use ESP32 built-in bus pull-up resistors"
help
The I2C bus needs resistors to make sure it's in a defined
state when nobody is talking. Many circuits have external
pullup resistors already and turning these on will increase
power consumption slightly and may limit the speed your bus
can attain. Try with these off first if you don't know.
endif
endmenu
endmenu endmenu
menu "I2C Port 1"
config I2C_MANAGER_1_ENABLED
bool "Enable I2C port 1"
if I2C_MANAGER_1_ENABLED
config I2C_MANAGER_1_SDA
int "SDA (GPIO pin)"
config I2C_MANAGER_1_SCL
int "SCL (GPIO pin)"
config I2C_MANAGER_1_FREQ_HZ
int "Frequency (Hz)"
default 1000000
range 100000 5000000
help
The clock speed in Hz. Ranges from 100000 (100 kHz) to
5000000 (5 Mhz). I2C busses that involve external wires may
have to be slower, and the real maximum speed the bus will
support depends on the value of the pullup resistors and the
design of the overall circuit.
config I2C_MANAGER_1_TIMEOUT
int "R/W timeout (ms)"
default 20
range 10 1000
help
Timeout for I2C read and write operations. This does not
include the time waiting for a lock. Default should be fine.
config I2C_MANAGER_1_LOCK_TIMEOUT
int "Stale lock override (ms)"
default 50
help
Timeout at which point an operation waiting for its turn on
the port will assume that whatever set the lock has died and
overrides it. Set this somewhat larger than the previous
timeout. Default should be fine.
range 30 1000
config I2C_MANAGER_1_PULLUPS
bool "Use ESP32 built-in bus pull-up resistors"
help
The I2C bus needs resistors to make sure it's in a defined
state when nobody is talking. Many circuits have external
pullup resistors already and turning these on will increase
power consumption slightly and may limit the speed your bus
can attain. Try with these off first if you don't know.
endif
endmenu