/* The peripheral clock will be the same as the PCLK1 clock. This will be the value returned by SysCtlClockGet(), or it can be explicitly hard coded if it is constant and known (to save the code/execution overhead of a call to SysCtlClockGet()). */
void I2CMasterInit(unsigned long ulBase, unsigned long ulI2CClk)
/* The peripheral clock will be the same as the PCLK1 clock. This will be the value returned by SysCtlClockGet(), or it can be explicitly hard coded if it is constant and known (to save the code/execution overhead of a call to SysCtlClockGet()). */
void I2CMasterInit(unsigned long ulBase, unsigned long ulI2CClk)
{
    unsigned long ulSCLFreq;
    xASSERT((ulBase == I2C0_BASE) || (ulBase == I2C1_BASE));
    xHWREG(ulBase + I2C_CR) |= I2C_CR_I2CEN;
    ulSCLFreq = xSysCtlClockGet();
    xHWREG(ulBase + I2C_SHPGR) = (ulSCLFreq*2)/(ulI2CClk*5) -7;
    xHWREG(ulBase + I2C_SLPGR) = (ulSCLFreq*3)/(ulI2CClk*5) -7;
}