From 83eba9b04cc212a01051e6839fe31455ae58499b Mon Sep 17 00:00:00 2001 From: Rop Gonggrijp Date: Fri, 15 Oct 2021 15:37:36 +0200 Subject: [PATCH 1/2] Fixes potential ESP-IDF config editor crash (#115) --- lvgl_i2c/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lvgl_i2c/Kconfig b/lvgl_i2c/Kconfig index 4011bcf..48df924 100644 --- a/lvgl_i2c/Kconfig +++ b/lvgl_i2c/Kconfig @@ -6,8 +6,10 @@ menu "I2C Port 0" if I2C_MANAGER_0_ENABLED config I2C_MANAGER_0_SDA int "SDA (GPIO pin)" + default 0 config I2C_MANAGER_0_SCL int "SCL (GPIO pin)" + default 0 config I2C_MANAGER_0_FREQ_HZ int "Frequency (Hz)" default 400000 From db3d00e3744a5884c60ba8a8c13239bdd29194d2 Mon Sep 17 00:00:00 2001 From: Rop Gonggrijp Date: Fri, 15 Oct 2021 15:38:16 +0200 Subject: [PATCH 2/2] Addresses confusion: I2C manager component install only when others need I2C too. See #115 --- lvgl_i2c/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lvgl_i2c/README.md b/lvgl_i2c/README.md index fb74e27..90f3728 100644 --- a/lvgl_i2c/README.md +++ b/lvgl_i2c/README.md @@ -8,9 +8,11 @@ ### I2C Manager support -`lvgl_esp32_drivers` integrates [I2C Manager](https://github.com/ropg/i2c_manager), which is used in case you select a touch sensor or screen that uses the I2C bus. If you're just using LVGL you don't need to do anything special. +`lvgl_esp32_drivers` integrates [I2C Manager](https://github.com/ropg/i2c_manager), which is used in case you select a touch sensor or screen that uses the I2C bus. -I2C Manager can help if you are in a situation where you want to avoid "bus conflicts" on the I2C bus. Suppose you use LVGL with a touch sensor that uses I2C, and your device also has another I2C device that needs to be read frequently, such as a 3D-accelerometer. ESP-IDF is not inherently "thread-safe". So if you read that from another task than the one LVGL uses to read the touch data, you need some kind of mechanism to keep these communications from interfering. +I2C Manager is also available as a separate ESP-IDF component and can help if you are in a situation where you want to avoid "bus conflicts" on the I2C bus. **If in your application nothing outside of LVGL needs to talk to the I2C bus, you can stop reading here.** + +Suppose you use LVGL with a touch sensor that uses I2C, and your device also has another I2C device that needs to be read frequently, such as a 3D-accelerometer. ESP-IDF is not inherently "thread-safe". So if you read that from another task than the one LVGL uses to read the touch data, you need some kind of mechanism to keep these communications from interfering. If you have (or write) a driver for that 3D-accelerometer that can use I2C Manager (or the I2C HAL and i2cdev abstraction layers that I2C Manager is compatible with) then put I2C Manager in your components directory by cloning the repository from below and in your main program do: