按官方提供的stm32f0xx_i2c.c中的说明部分做完初始化... ============================================================================ ##### How to use this driver ##### ============================================================================ [..] (#) Enable peripheral clock using RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2Cx, ENABLE) function for I2C1 or I2C2. (#) Enable SDA, SCL and SMBA (when used) GPIO clocks using RCC_AHBPeriphClockCmd() function. (#) Peripherals alternate function: (++) Connect the pin to the desired peripherals' Alternate Function (AF) using GPIO_PinAFConfig() function. (++) Configure the desired pin in alternate function by: GPIO_InitStruct->GPIO_Mode = GPIO_Mode_AF (++) Select the type, OpenDrain and speed via GPIO_PuPd, GPIO_OType and GPIO_Speed members (++) Call GPIO_Init() function. (#) Program the Mode, Timing , O