You can reset or disable the I2C module in two ways:
- Write 0 to the I2C reset bit (IRS) in the I2C
mode register (I2CMDR). All status bits (in I2CSTR) are forced to the
default values, and the I2C module remains disabled until IRS is changed to
1. The SDA and SCL pins are in the high-impedance state.
- Initiate a device reset by driving the
XRS pin low. The entire device is reset and is held
in the reset state until you drive the pin high. When the
XRS pin is released, all I2C module registers are
reset to the default values. The IRS bit is forced to 0, which resets the
I2C module. The I2C module stays in the reset state until you write 1 to
IRS.
The IRS must be 0 while you configure or reconfigure the I2C module. Forcing IRS to 0 can be used to save power and to clear error conditions.