-
Notifications
You must be signed in to change notification settings - Fork 7.8k
-
- ArduinoIDE 2.3.6 and ESP32 Core 3.3.3
- 10.1inch display from Guition JC8012P4A1C with MIPI-DSI display, ESP32-P4/ESP32-C6
- Additional ESP32-P4 board for testing. Several sensor modules like BMP585, SHT45 etc.
During the last last weeks I'using the display board from Gution with lvgl9-demo they offer for downlaod. It works until I try to add a sensor and include Wire-library. Then I got the error i2c: CONFLICT! driver_ng is not allowed to be used with this old driver
So at the moment I use a seperate ESP32-P4 board without display. My idea is to write some sketches, that use i2c_master. For the moment I'm successful with BMP585 module.
Next sensor on my list is SHT45. First I look for an Arduino-example, that is using Wire-library. I found a simple one called "ArtronShop_SHT45" [(https://github.com/ArtronShop/ArtronShop_SHT45/tree/main)].
For my suprise I see in serial monitor this line:
[I][esp32-hal-i2c-ng.c:112] i2cInit(): Initializing I2C Master: num=0 sda=6 scl=5 freq=100000
That is a new driver, that uses i2c_master in the end?
But why? Wire.h/Wire.cpp doesn't include esp32-hal-i2c-ng.c ...
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
esp32-hal-i2c-ng.c is exactly the implementation currently in use in the core and Wire is on top of it.
I am guessing that the libraries for the screen also use I2C, but instead of calling Wire, they use the old driver API.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you for your answer.
I checked files on my Win10 computer and it looks like I made a mistake.
Wire.cpp includes esp32-hal-i2c.h. Inside esp32-hal-i2c.c is an include for the old driver/i2c.h, but only if ESP-IDF version is lower than 5.4.0. The whole code of esp32-hal-i2c.c is inside that #if ... #endif.
Can you please explain, on which path esp32-hal-i2c-ng.c is included, when I use Wire?
And yes: Guition offers a large zip with demos etc. Their gsl3680_touch.cpp includes driver/i2c.h instead of using Wire-library. That file is from 07.04.2025.
Bye, Jürgen
Beta Was this translation helpful? Give feedback.