/* This function gets the number of bytes that have been received. Note: Do not trying to use this api to get the number of received bytes, it make no sense to link transfer. param base DMIC peripheral base address. param handle DMIC handle pointer. param count Receive bytes count. retval kStatus_NoTransferInProgress No receive in progress. retval kStatus_InvalidArgument Parameter is invalid. retval kStatus_Success Get successfully through the parameter count;  */
status_t DMIC_TransferGetReceiveCountDMA(DMIC_Type *base, dmic_dma_handle_t *handle, uint32_t *count)
/* This function gets the number of bytes that have been received. Note: Do not trying to use this api to get the number of received bytes, it make no sense to link transfer. param base DMIC peripheral base address. param handle DMIC handle pointer. param count Receive bytes count. retval kStatus_NoTransferInProgress No receive in progress. retval kStatus_InvalidArgument Parameter is invalid. retval kStatus_Success Get successfully through the parameter count;  */
status_t DMIC_TransferGetReceiveCountDMA(DMIC_Type *base, dmic_dma_handle_t *handle, uint32_t *count)
{
    assert(handle != NULL);
    assert(handle->rxDmaHandle != NULL);
    assert(count != NULL);
    if ((uint8_t)kDMIC_Idle == handle->state)
    {
        return kStatus_NoTransferInProgress;
    }
    *count = handle->transferSize - DMA_GetRemainingBytes(handle->rxDmaHandle->base, handle->rxDmaHandle->channel);
    return kStatus_Success;
}