/* Initialize I2C. 
Port Function I2C Interface //////////////////////// For use Digital compass, you need to rewrite three functions _I2CComPortInit : Initialize the communication hardware port _I2CRegWriteByte : Write a byte to accelerometer register _I2CRegReadByte : Read a byte from accelerometer register */
static Result _I2CComPortInit(void)
/* Initialize I2C. 
Port Function I2C Interface //////////////////////// For use Digital compass, you need to rewrite three functions _I2CComPortInit : Initialize the communication hardware port _I2CRegWriteByte : Write a byte to accelerometer register _I2CRegReadByte : Read a byte from accelerometer register */
static Result _I2CComPortInit(void)
{
    uint32_t I2CInitClkRate = 100000;
    xSysCtlPeripheralEnable(HMC5883L_I2C_GPIO);
    xSysCtlPeripheralEnable(SYSCTL_PERIPH_AFIO);
    xSysCtlPeripheralEnable2(HMC5883L_PIN_I2C_PORT);
    xSPinTypeI2C(HMC5883L_I2C_SCK, HMC5883L_PIN_I2C_SCK);
    xSPinTypeI2C(HMC5883L_I2C_SDA, HMC5883L_PIN_I2C_SDA);
    xI2CMasterEnable(HMC5883L_PIN_I2C_PORT);
    xI2CMasterInit(HMC5883L_PIN_I2C_PORT, I2CInitClkRate);
    return(SUCCESS);
}