/* param base pointer to FLEXIO_I2C_Type structure. param xfer pointer to flexio_i2c_master_transfer_t structure. return status of status_t.  */
status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer)
/* param base pointer to FLEXIO_I2C_Type structure. param xfer pointer to flexio_i2c_master_transfer_t structure. return status of status_t.  */
status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, flexio_i2c_master_transfer_t *xfer)
{
    assert(xfer);
    flexio_i2c_master_handle_t tmpHandle;
    uint32_t statusFlags;
    uint32_t result = kStatus_Success;
    memset(&tmpHandle, 0, sizeof(tmpHandle));
    FLEXIO_I2C_MasterTransferInitStateMachine(base, &tmpHandle, xfer);
    do
    {
        while (!((statusFlags = FLEXIO_I2C_MasterGetStatusFlags(base)) &
                 (kFLEXIO_I2C_TxEmptyFlag | kFLEXIO_I2C_RxFullFlag)))
        {
        }
        result = FLEXIO_I2C_MasterTransferRunStateMachine(base, &tmpHandle, statusFlags);
    } while ((tmpHandle.state != kFLEXIO_I2C_Idle) && (result == kStatus_Success));
    return result;
}