/* param base PDM base pointer param handle Pointer to the pdm_handle_t structure which stores the transfer state. param xfer Pointer to the pdm_transfer_t structure. retval kStatus_Success Successfully started the data receive. retval kStatus_PDM_Busy Previous receive still not finished.  */
status_t PDM_TransferReceiveNonBlocking(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_t *xfer)
/* param base PDM base pointer param handle Pointer to the pdm_handle_t structure which stores the transfer state. param xfer Pointer to the pdm_transfer_t structure. retval kStatus_Success Successfully started the data receive. retval kStatus_PDM_Busy Previous receive still not finished.  */
status_t PDM_TransferReceiveNonBlocking(PDM_Type *base, pdm_handle_t *handle, pdm_transfer_t *xfer)
{
    assert(handle != NULL);
    if (handle->pdmQueue[handle->queueUser].data != NULL)
    {
        return kStatus_PDM_QueueFull;
    }
    handle->transferSize[handle->queueUser]      = xfer->dataSize;
    handle->pdmQueue[handle->queueUser].data     = xfer->data;
    handle->pdmQueue[handle->queueUser].dataSize = xfer->dataSize;
    handle->queueUser                            = (handle->queueUser + 1U) % PDM_XFER_QUEUE_SIZE;
    handle->state = kStatus_PDM_Busy;
    PDM_EnableInterrupts(base, (uint32_t)kPDM_FIFOInterruptEnable);
    PDM_Enable(base, true);
    return kStatus_Success;
}