fix(drivers): migrate I2C drivers to new esp_driver_i2c API#23
Closed
Ghost64847 wants to merge 4 commits intoHighCodeh:mainfrom
Closed
fix(drivers): migrate I2C drivers to new esp_driver_i2c API#23Ghost64847 wants to merge 4 commits intoHighCodeh:mainfrom
Ghost64847 wants to merge 4 commits intoHighCodeh:mainfrom
Conversation
f5241c8 to
7abde6d
Compare
Replace deprecated driver/i2c.h with driver/i2c_master.h across all I2C-related components to fix build errors on ESP-IDF v5.5.3. - i2c_init: use i2c_new_master_bus() and expose i2c_get_bus_handle() - bq25896: register device via i2c_master_bus_add_device(), replace cmd_link pattern with i2c_master_transmit / transmit_receive - pn7150: same migration as bq25896; pn7150_i2c_init now reuses the global bus handle instead of re-initializing the bus - kernel: remove direct include of deprecated driver/i2c.h
Member
|
#22 |
Author
|
Additionally, I have a suggestion to use the esp_lvgl_adapter component (https://components.espressif.com/components/espressif/esp_lvgl_adapter/versions/0.4.1/readme) and its dependencies, which would facilitate support for more features, such as multilingual support. I hope you can consider it. :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates all I2C drivers from the deprecated
driver/i2c.hAPI to the newdriver/i2c_master.hAPI introduced in ESP-IDF v5.x.Changes
components/Drivers/i2c_init/i2c_init.c: Replacedi2c_config_t+i2c_param_config()+i2c_driver_install()withi2c_master_bus_config_t+i2c_new_master_bus(). The bus handle is stored globally and exposed viai2c_get_bus_handle().i2c_init.h: Added#include "driver/i2c_master.h"and declaredi2c_get_bus_handle().components/Drivers/bq25896/bq25896.h: Updated include fromdriver/i2c.htodriver/i2c_master.h.bq25896.c: Replaced legacyi2c_cmd_link_create()/i2c_master_cmd_begin()pattern withi2c_master_bus_add_device()+i2c_master_transmit_receive()/i2c_master_transmit().components/Drivers/pn7150/pn7150.h: Updated include fromdriver/i2c.htodriver/i2c_master.h+i2c_init.h.pn7150.c: Replaced alli2c_cmd_link_create()patterns with new transmit API.pn7150_i2c_init()now registers device on the shared bus viai2c_master_bus_add_device().components/Core/kernel.c#include "driver/i2c.h"(now handled transitively viai2c_init.h).Testing
Compiled successfully for ESP32-P4 with ESP-IDF v5.5.3. Confirmed working on hardware via serial monitor -
I2CInit: I2C mestre inicializado com sucesso no I2C_NUM_0 usando o novo driver.appears at boot.Related
error: unknown type name 'i2c_config_t'caused by includingdriver/i2c_master.hwhile using legacy API symbols.