Dear colleagues,
I'd be very grateful for your help in the following challenge: I would need to change pins and/or i2c bus speed without recompilation of my code.
I can perfectly communicate to my i2c slaves from the 52833 (custom board) when my i2c0 is defined in DTS. This works great allowing me to use various devices just by calling i2c_transfer() with different flags and device addresses.
This is not enough. I need to be able to reconfigure SCL/SDA pins "on the fly" per external request. It seems the relevant API is present here, and here. Is there any example of how to use i2c bus without DTS please?
As an option I am also considering taking the initial i2c configuration from the dts (like it works now) just by letting it be initialized on runlevel stage. Next I would need to reconfigure that one. Unfortunately I see in the code that lefts .get_config field of device's API not filled and configuration structures are left static - for the driver's internal use as I can imagine. As such i2c_get_config() is not working in that context due to above mentioned reason. So in this case so there must be some other way to program i2c that would allow e.g. using i2c_get_config(), i2c_configure(), etc.
Any other approach / example on how to change i2c pins and speed without recompilation of the code would be very much appreciated.
Thanks!