/* Gets the error status of the I2C Master module. */
uint32_t I2CMasterErr(uint32_t ui32Base)
/* Gets the error status of the I2C Master module. */
uint32_t I2CMasterErr(uint32_t ui32Base)
{
    uint32_t ui32Err;
    ASSERT(_I2CBaseValid(ui32Base));
    ui32Err = HWREG(ui32Base + I2C_O_MCS);
    if(ui32Err & I2C_MCS_BUSY)
    {
        return(I2C_MASTER_ERR_NONE);
    }
    if(ui32Err & (I2C_MCS_ERROR | I2C_MCS_ARBLST))
    {
        return(ui32Err & (I2C_MCS_ARBLST | I2C_MCS_ACK | I2C_MCS_ADRACK));
    }
    else
    {
        return(I2C_MASTER_ERR_NONE);
    }
}