/* Initializes pin muxing for I2C interface */
static void Init_I2C_PinMux(void)//I2C引脚初始化
{
#if (defined(BOARD_NXP_LPCXPRESSO_812) || defined(BOARD_LPC812MAX) || defined(BOARD_NXP_LPCXPRESSO_824))
/* Enable the clock to the Switch Matrix */
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);//使能开关矩阵时钟
#if defined(BOARD_NXP_LPCXPRESSO_824)
Chip_SWM_EnableFixedPin(SWM_FIXED_I2C0_SDA);//使能I2C SDA脚
Chip_SWM_EnableFixedPin(SWM_FIXED_I2C0_SCL);//使能I2C SCL脚
#else
/* Connect the I2C_SDA and I2C_SCL signals to port pins(P0.10, P0.11) */
Chip_SWM_MovablePinAssign(SWM_I2C_SDA_IO, 10);选择P0.10作为I2C SDA脚
Chip_SWM_MovablePinAssign(SWM_I2C_SCL_IO, 11);选择P0.11作为I2C SDA脚
#endif
/* Enable Fast Mode Plus for I2C pins */
Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO10, PIN_I2CMODE_FASTPLUS);//使能I2C SDA脚为快速模式
Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO11, PIN_I2CMODE_FASTPLUS);//使能I2C SCL脚为快速模式
/* Disable the clock to the Switch Matrix to save power */
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);//关闭开关矩阵时钟
#else
/* Configure your own I2C pin muxing here if needed */
#warning "No I2C pin muxing defined"
#endif
}