Change I2C clock speed without reinitializing
Posted: Sat Oct 28, 2023 12:09 pm
I have two I2C devices, one supports 1Mbit, the other supports 400Kbit. I would like to use the fast device at the fast speed but if I initialize the I2C device with `i2c_param_config` at 1Mbit then, when I want to communicate with the slow device I need to change the clock speed to 400Kbit.
At the moment I am tearing the I2C driver down and reinitializing it, but this isn't ideal.
Is it supported to call `i2c_param_config` after `i2c_driver_install` with a different clock speed?
If not, am I required to leave the clock speed at 1Mbit and change the timings with `i2c_set_period`, `i2c_set_start_timing` etc?
At the moment I am tearing the I2C driver down and reinitializing it, but this isn't ideal.
Is it supported to call `i2c_param_config` after `i2c_driver_install` with a different clock speed?
If not, am I required to leave the clock speed at 1Mbit and change the timings with `i2c_set_period`, `i2c_set_start_timing` etc?