/* Gets the error status of the I2C Master module. */
unsigned long I2CMasterErr(unsigned long ulBase)
/* Gets the error status of the I2C Master module. */
unsigned long I2CMasterErr(unsigned long ulBase)
{
    unsigned long ulErr;
    xASSERT((ulBase == I2C0_BASE) || (ulBase == I2C1_BASE));
    ulErr = xHWREG(ulBase + I2C_CSR);
    if(ulErr & (I2C_CSR_ARBLOS | I2C_CSR_RXNACK | I2C_CSR_BUSERR))
    {
        return(ulErr & (I2C_CSR_ARBLOS | I2C_CSR_RXNACK | I2C_CSR_BUSERR));
    }
    else
    {
        return(I2C_MASTER_ERR_NONE);
    }
}