Multiple I2c Addresses on same bus (IDFGH-14214) #15011
Labels
Resolution: NA
Issue resolution is unavailable
Status: Done
Issue is done internally
Type: Feature Request
Feature request for IDF
Is your feature request related to a problem?
I am using ESP32-S3-Touch-LCD-4.3B. This device have 26 Address on the bus, which needs to add each and every address using i2c_master_bus_add_device. Which sums up 26 (i2c_master_dev_handle_t) Devs handles. Ref: https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-4.3B
Describe the solution you'd like.
By adding these tow functions in i2c_master.c we can change the device address on the fly.
uint16_t i2c_master_get_device_address(i2c_master_dev_handle_t i2c_dev)
{
ESP_RETURN_ON_FALSE(i2c_dev != NULL, ESP_ERR_INVALID_ARG, TAG, "i2c handle not initialized");
return i2c_dev->device_address;
}
esp_err_t i2c_master_set_device_address(i2c_master_dev_handle_t i2c_dev, uint16_t device_address)
{
ESP_RETURN_ON_FALSE(i2c_dev != NULL, ESP_ERR_INVALID_ARG, TAG, "i2c handle not initialized");
i2c_dev->device_address = device_address;
return ESP_OK;
}
Describe alternatives you've considered.
If we can change the address of the (i2c_master_dev_handle_t) dynamically, then the task can be achieved using a small number of (i2c_master_dev_handle_t) dev Handles.,
Additional context.
The text was updated successfully, but these errors were encountered: