/* param base pointer to FLEXIO_MCULCD_Type structure. param handle FlexIO MCULCD eDMA handle pointer. param count Number of count transferred so far by the eDMA transaction. retval kStatus_Success Get the transferred count Successfully. retval kStatus_NoTransferInProgress No transfer in process.  */
status_t FLEXIO_MCULCD_TransferGetCountEDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle, size_t *count)
/* param base pointer to FLEXIO_MCULCD_Type structure. param handle FlexIO MCULCD eDMA handle pointer. param count Number of count transferred so far by the eDMA transaction. retval kStatus_Success Get the transferred count Successfully. retval kStatus_NoTransferInProgress No transfer in process.  */
status_t FLEXIO_MCULCD_TransferGetCountEDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle, size_t *count)
{
    assert(NULL != handle);
    assert(NULL != count);
    uint32_t state = handle->state;
    if ((uint32_t)kFLEXIO_MCULCD_StateIdle == state)
    {
        return kStatus_NoTransferInProgress;
    }
    else
    {
        *count = handle->dataCount - handle->remainingCount;
        if ((uint32_t)kFLEXIO_MCULCD_StateReadArray == state)
        {
            *count -= handle->minorLoopBytes *
                      EDMA_GetRemainingMajorLoopCount(handle->rxDmaHandle->base, handle->rxDmaHandle->channel);
        }
        else
        {
            *count -= handle->minorLoopBytes *
                      EDMA_GetRemainingMajorLoopCount(handle->txDmaHandle->base, handle->txDmaHandle->channel);
        }
    }
    return kStatus_Success;
}