/* Make sure the bus isn't already busy. 
A busy bus is allowed if we are the one driving it. */
status_t LPI2C_CheckForBusyBus(LPI2C_Type *base)
/* Make sure the bus isn't already busy. 
A busy bus is allowed if we are the one driving it. */
status_t LPI2C_CheckForBusyBus(LPI2C_Type *base)
{
    uint32_t status = LPI2C_MasterGetStatusFlags(base);
    if ((status & kLPI2C_MasterBusBusyFlag) && (!(status & kLPI2C_MasterBusyFlag)))
    {
        return kStatus_LPI2C_Busy;
    }
    return kStatus_Success;
}