/* param base Pointer to FLEXIO_I2S_Type structure. param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state param xfer Pointer to flexio_i2s_transfer_t structure retval kStatus_Success Successfully start the data receive. retval kStatus_FLEXIO_I2S_RxBusy Previous receive still not finished. retval kStatus_InvalidArgument The input parameter is invalid.  */
status_t FLEXIO_I2S_TransferReceiveNonBlocking(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, flexio_i2s_transfer_t *xfer)
/* param base Pointer to FLEXIO_I2S_Type structure. param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state param xfer Pointer to flexio_i2s_transfer_t structure retval kStatus_Success Successfully start the data receive. retval kStatus_FLEXIO_I2S_RxBusy Previous receive still not finished. retval kStatus_InvalidArgument The input parameter is invalid.  */
status_t FLEXIO_I2S_TransferReceiveNonBlocking(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, flexio_i2s_transfer_t *xfer)
{
    assert(handle);
    if (handle->queue[handle->queueUser].data)
    {
        return kStatus_FLEXIO_I2S_QueueFull;
    }
    if ((xfer->dataSize == 0) || (xfer->data == NULL))
    {
        return kStatus_InvalidArgument;
    }
    handle->queue[handle->queueUser].data = xfer->data;
    handle->queue[handle->queueUser].dataSize = xfer->dataSize;
    handle->transferSize[handle->queueUser] = xfer->dataSize;
    handle->queueUser = (handle->queueUser + 1) % FLEXIO_I2S_XFER_QUEUE_SIZE;
    handle->state = kFLEXIO_I2S_Busy;
    FLEXIO_I2S_EnableInterrupts(base, kFLEXIO_I2S_RxDataRegFullInterruptEnable);
    FLEXIO_I2S_Enable(base, true);
    return kStatus_Success;
}