fix(i2c_master): Enhance i2c delete device and bus logic,

Closes https://github.com/espressif/esp-idf/issues/15171
This commit is contained in:
C.S.M
2025-01-21 15:55:32 +08:00
parent 3dd1ad9fdd
commit 847780da3e
4 changed files with 14 additions and 2 deletions
@@ -215,6 +215,8 @@ Uninstall I2C master bus and device
If a previously installed I2C bus or device is no longer needed, it's recommended to recycle the resource by calling :cpp:func:`i2c_master_bus_rm_device` or :cpp:func:`i2c_del_master_bus`, so as to release the underlying hardware.
Please note that removing all devices attached to bus before delete the master bus.
Install I2C slave device
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -216,6 +216,8 @@ I2C 主机设备需要 :cpp:type:`i2c_device_config_t` 指定的配置:
如果不再需要之前安装的 I2C 总线或设备,建议调用 :cpp:func:`i2c_master_bus_rm_device`:cpp:func:`i2c_del_master_bus` 来回收资源,以释放底层硬件。
请注意在删除 I2C master 总线之前应当删除该总线上所有的设备。
安装 I2C 从机设备
~~~~~~~~~~~~~~~~~~~