/* retval #kStatus_Success Slave transfers were successfully started. retval #kStatus_I2C_Busy Slave transfers have already been started on this handle.  */
status_t I2C_SlaveTransferNonBlocking(I2C_Type *base, i2c_slave_handle_t *handle, uint32_t eventMask)
/* retval #kStatus_Success Slave transfers were successfully started. retval #kStatus_I2C_Busy Slave transfers have already been started on this handle.  */
status_t I2C_SlaveTransferNonBlocking(I2C_Type *base, i2c_slave_handle_t *handle, uint32_t eventMask)
{
    assert(NULL != handle);
    if (true == handle->isBusy)
    {
        return kStatus_I2C_Busy;
    }
    else
    {
        I2C_DisableInterrupts(base, (uint32_t)kIrqFlags);
        (void)memset(&handle->transfer, 0, sizeof(handle->transfer));
        handle->isBusy = true;
        handle->eventMask = eventMask | (uint32_t)kI2C_SlaveTransmitEvent | (uint32_t)kI2C_SlaveReceiveEvent |
                            (uint32_t)kI2C_SlaveGenaralcallEvent;
        I2C_SlaveClearStatusFlags(base, (uint32_t)kClearFlags);
        I2C_EnableInterrupts(base, (uint32_t)kIrqFlags);
    }
    return kStatus_Success;
}