You can just call Wire.reset(). You can only do it after previously initializing it using begin(), and reset() will initialize it again, so you should not call begin() again.
The only other thing is that reset() obtains the Wire lock, so make sure you've unlocked it first if you are using locking.
Wire.reset does a lot to release the I2C bus; the code looks similar for RTL872x:
There isn't really an I2C reset, the NXP I2C spec unlike other protocols doesn't explicitly define a reset sequence, so the reset sequence above only resets the interface on the slave/client device. Creating 9 clocks can get the device back into a known state, but you still may need a Power-on-Reset event to really reset the device.
For example, if the client device is holding SDA LOW, you can create the clocks until it gives up the bus, then you should be able to do a start-stop condition and presto, device is ready for the next transaction. If the device is still holding SDA LOW after the 9 clocks, then a POR must occur. Having a scope or logic capture will give you the details on what's occurring.
Hi Erik, yes I am aware that this reset does not exist at I2C level, and is only a list of things one can try to recover from a situation, and the result is not guaranteed.
I'll take this reset as a first measure, before executing a POR.
Thank you