/* Set the clock rate of the specified I2C port. 
The  */
void I2CMasterInit(unsigned long ulBase, unsigned long ulI2CClk)
/* Set the clock rate of the specified I2C port. 
The  */
void I2CMasterInit(unsigned long ulBase, unsigned long ulI2CClk)
{
    unsigned long ulHclk;
    unsigned long ulDiv;
    xASSERT((ulBase == I2C0_BASE) || (ulBase == I2C1_BASE));
    if (ulBase == I2C0_BASE)
    {
        SysCtlPeripheralReset(SYSCTL_PERIPH_I2C0);
    }
    else
    {
        SysCtlPeripheralReset(SYSCTL_PERIPH_I2C1);
    }
    xHWREG(ulBase + I2C_O_CON) = I2C_CON_ENS1;
    ulHclk = SysCtlHClockGet();
    ulDiv = (unsigned long) (((ulHclk * 10)/(ulI2CClk * 4) + 5) / 10 - 1);
    xHWREG(ulBase + I2C_O_CLK) = ulDiv;
    xHWREG(ulBase + I2C_O_CON) = 0;
    xHWREG(ulBase + I2C_O_CON) = I2C_CON_ENS1;
}