/* retval kStatus_Success retval kStatus_I2S_Busy if all queue slots are occupied with buffers which are not full.  */
status_t I2S_RxTransferNonBlocking(I2S_Type *base, i2s_handle_t *handle, i2s_transfer_t transfer)
/* retval kStatus_Success retval kStatus_I2S_Busy if all queue slots are occupied with buffers which are not full.  */
status_t I2S_RxTransferNonBlocking(I2S_Type *base, i2s_handle_t *handle, i2s_transfer_t transfer)
{
    assert(handle != NULL);
    status_t result;
    if (NULL == handle)
    {
        return kStatus_InvalidArgument;
    }
    result = I2S_ValidateBuffer(handle, &transfer);
    if (result != kStatus_Success)
    {
        return result;
    }
    if (handle->i2sQueue[handle->queueUser].dataSize != 0UL)
    {
        return kStatus_I2S_Busy;
    }
    handle->i2sQueue[handle->queueUser].data     = transfer.data;
    handle->i2sQueue[handle->queueUser].dataSize = transfer.dataSize;
    handle->queueUser                            = (handle->queueUser + 1U) % I2S_NUM_BUFFERS;
    base->FIFOTRIG = (base->FIFOTRIG & (~I2S_FIFOTRIG_RXLVL_MASK)) | I2S_FIFOTRIG_RXLVL(handle->watermark);
    I2S_RxEnable(base, true);
    return kStatus_Success;
}