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?
Change I2C clock speed without reinitializing
Re: Change I2C clock speed without reinitializing
The way I got arround this same issue was to set up of them instead of just one. Set the parameters for the first one with the fast clk speed, then set the second with the slower one. The trick is to use the same pins for both.
Re: Change I2C clock speed without reinitializing
Thanks for this - I'm not sure I understand what you mean when you say 'set up {two} of them instead of just one' - can you clarify what functions you're calling to do this?
Who is online
Users browsing this forum: No registered users and 267 guests