static void Llc_VolumeInit(void) { I2cConfig_t i2cConfig; I2c_Enable(); i2cConfig.i2cBroadcastEn = FALSE; i2cConfig.freqDivider = 0x20; i2cConfig.saplingRate = 0x01; i2cConfig.slaveAddress = 0x00; i2cConfig.i2cInterruptEn = FALSE; I2c_SetConfig(&i2cConfig); }
//////////////////////////////////////////////////////////////////////////////////////////////////// // Name I2C_EEPROM_Init // Author Dorin Muica // Brief Init I2C Module // Param none // none // Return none //////////////////////////////////////////////////////////////////////////////////////////////////// void I2C_EEPROM_Init (void) { Gpio_SetPinFunction(GPIO_EEPROM_WP , gGpioNormalMode_c); Gpio_SetPinDir( GPIO_EEPROM_WP, gGpioDirOut_c ); EEPROM_WRITE_DISABLE(); Gpio_SetPinFunction( gGpioPin12_c, gGpioAlternate1Mode_c ); // Peripheral Control Mode of pin #22 SCL Gpio_SetPinFunction( gGpioPin13_c, gGpioAlternate1Mode_c ); // Peripheral Control Mode of pin #21 SDA I2c_Init(); I2c_Enable(); I2c_SetConfig(&stI2cConfig); }