drivers/eeprom/eeprom.c
void Eeprom_Init (void)
{
    I2C_InitTypeDef  I2C_InitStruct;
    GPIO_InitTypeDef GPIO_InitStruct;

    GPIO_InitStruct.GPIO_Mode  = GPIO_Mode_AF;
    GPIO_InitStruct.GPIO_Speed = GPIO_Speed_Level_2;
    GPIO_InitStruct.GPIO_OType = GPIO_OType_OD;
    GPIO_InitStruct.GPIO_PuPd  = GPIO_PuPd_UP;
    /* Initialize PB13 SCL */
    GPIO_InitStruct.GPIO_Pin = EEPROM_I2C_SCL_PIN;
    GPIO_Init(EEPROM_I2C_SCL_PORT, &GPIO_InitStruct);
    GPIO_PinAFConfig(EEPROM_I2C_SCL_PORT, EEPROM_SCL_PIN_SRC, EEPROM_GPIO_AF_FUNC);
    /* Initialize PB14 SDA */
    GPIO_InitStruct.GPIO_Pin = EEPROM_I2C_SDA_PIN;
    GPIO_Init(EEPROM_I2C_SDA_PORT, &GPIO_InitStruct);
    GPIO_PinAFConfig(EEPROM_I2C_SDA_PORT, EEPROM_SDA_PIN_SRC, EEPROM_GPIO_AF_FUNC);
    /*  Initialize I2C module */
    I2C_InitStruct.I2C_Ack                 = I2C_Ack_Enable;
    I2C_InitStruct.I2C_DigitalFilter       = 0x00;
    I2C_InitStruct.I2C_Mode                = I2C_Mode_I2C;
    I2C_InitStruct.I2C_Timing              = I2C_TIMING;
    I2C_InitStruct.I2C_AnalogFilter        = I2C_AnalogFilter_Enable;
    I2C_InitStruct.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
    I2C_Init(EEPROM_HW, &I2C_InitStruct);
    I2C_Cmd(EEPROM_HW, ENABLE);
	I2C_10BitAddressingModeCmd(EEPROM_HW, DISABLE);

}
/******************************************************************************/
/**!                        EXPORTED FUNCTIONS                                */
/******************************************************************************/
/*
 * @brief Initialize EEPROM driver
 * @param none
 * @return none
 */
EXPORTED FUNCTIONS
@brief Initialize EEPROM driver
@param none
@return none
EXPORTED FUNCTIONS @brief Initialize EEPROM driver @param none @return none
void Eeprom_Init (void)
{
    I2C_InitTypeDef  I2C_InitStruct;
    GPIO_InitTypeDef GPIO_InitStruct;
    GPIO_InitStruct.GPIO_Mode  = GPIO_Mode_AF;
    GPIO_InitStruct.GPIO_Speed = GPIO_Speed_Level_2;
    GPIO_InitStruct.GPIO_OType = GPIO_OType_OD;
    GPIO_InitStruct.GPIO_PuPd  = GPIO_PuPd_UP;
    GPIO_InitStruct.GPIO_Pin = EEPROM_I2C_SCL_PIN;
    GPIO_Init(EEPROM_I2C_SCL_PORT, &GPIO_InitStruct);
    GPIO_PinAFConfig(EEPROM_I2C_SCL_PORT, EEPROM_SCL_PIN_SRC, EEPROM_GPIO_AF_FUNC);
    GPIO_InitStruct.GPIO_Pin = EEPROM_I2C_SDA_PIN;
    GPIO_Init(EEPROM_I2C_SDA_PORT, &GPIO_InitStruct);
    GPIO_PinAFConfig(EEPROM_I2C_SDA_PORT, EEPROM_SDA_PIN_SRC, EEPROM_GPIO_AF_FUNC);
    I2C_InitStruct.I2C_Ack                 = I2C_Ack_Enable;
    I2C_InitStruct.I2C_DigitalFilter       = 0x00;
    I2C_InitStruct.I2C_Mode                = I2C_Mode_I2C;
    I2C_InitStruct.I2C_Timing              = I2C_TIMING;
    I2C_InitStruct.I2C_AnalogFilter        = I2C_AnalogFilter_Enable;
    I2C_InitStruct.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
    I2C_Init(EEPROM_HW, &I2C_InitStruct);
    I2C_Cmd(EEPROM_HW, ENABLE);
	I2C_10BitAddressingModeCmd(EEPROM_HW, DISABLE);
}
void Eeprom_Init ( void ) { I2C_InitTypeDef I2C_InitStruct ; GPIO_InitTypeDef GPIO_InitStruct ; GPIO_InitStruct . GPIO_Mode = GPIO_Mode_AF ; GPIO_InitStruct . GPIO_Speed = GPIO_Speed_Level_2 ; GPIO_InitStruct . GPIO_OType = GPIO_OType_OD ; GPIO_InitStruct . GPIO_PuPd = GPIO_PuPd_UP ; GPIO_InitStruct . GPIO_Pin = EEPROM_I2C_SCL_PIN ; GPIO_Init ( EEPROM_I2C_SCL_PORT , & GPIO_InitStruct ) ; GPIO_PinAFConfig ( EEPROM_I2C_SCL_PORT , EEPROM_SCL_PIN_SRC , EEPROM_GPIO_AF_FUNC ) ; GPIO_InitStruct . GPIO_Pin = EEPROM_I2C_SDA_PIN ; GPIO_Init ( EEPROM_I2C_SDA_PORT , & GPIO_InitStruct ) ; GPIO_PinAFConfig ( EEPROM_I2C_SDA_PORT , EEPROM_SDA_PIN_SRC , EEPROM_GPIO_AF_FUNC ) ; I2C_InitStruct . I2C_Ack = I2C_Ack_Enable ; I2C_InitStruct . I2C_DigitalFilter = 0x00 ; I2C_InitStruct . I2C_Mode = I2C_Mode_I2C ; I2C_InitStruct . I2C_Timing = I2C_TIMING ; I2C_InitStruct . I2C_AnalogFilter = I2C_AnalogFilter_Enable ; I2C_InitStruct . I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit ; I2C_Init ( EEPROM_HW , & I2C_InitStruct ) ; I2C_Cmd ( EEPROM_HW , ENABLE ) ; I2C_10BitAddressingModeCmd ( EEPROM_HW , DISABLE ) ; }
EXPORTED FUNCTIONS
 @brief Initialize EEPROM driver
 @param none
 @return none
EXPORTED FUNCTIONS @brief Initialize EEPROM driver @param none @return none
/* Initialize PB13 SCL */ /* Initialize PB14 SDA */ /*  Initialize I2C module */