TM4C123x使能外设后,需要延时5个时钟周期才可以的,最好的办法是进行时钟开启的判断,代码如下所示:
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C2);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_I2C2)));
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
TM4C123x使能外设后,需要延时5个时钟周期才可以的,最好的办法是进行时钟开启的判断,代码如下所示:
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C2);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_I2C2)));