During I2C module debug, sometimes I will stop I2C communication in the wrong state. When I reload the project and restart, the program will hang up in
while(I2CMasterBusBusy(I2C2_BASE));
even the following can't get it out of trouble
SysCtlPeripheralDisable(SYSCTL_PERIPH_I2C2);
SysCtlPeripheralReset(SYSCTL_PERIPH_I2C2);
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C2);
Only recycling the power will get it out of this mess.
How do I reset the I2C module when I start the program?