Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

confused about I2C on ESP32-P4 #12090

jho59 started this conversation in General
Dec 1, 2025 · 1 comments · 1 reply
Discussion options

  1. ArduinoIDE 2.3.6 and ESP32 Core 3.3.3
  2. 10.1inch display from Guition JC8012P4A1C with MIPI-DSI display, ESP32-P4/ESP32-C6
  3. 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 ...

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

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.

You must be logged in to vote
1 reply
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /