/* param base eDMA peripheral base address. param channel eDMA channel number. return Major loop count which has not been transferred yet for the current TCD. note 1. This function can only be used to get unfinished major loop count of transfer without the next TCD, or it might be inaccuracy. */
uint32_t EDMA_GetRemainingMajorLoopCount(DMA_Type *base, uint32_t channel)
/* param base eDMA peripheral base address. param channel eDMA channel number. return Major loop count which has not been transferred yet for the current TCD. note 1. This function can only be used to get unfinished major loop count of transfer without the next TCD, or it might be inaccuracy. */
uint32_t EDMA_GetRemainingMajorLoopCount(DMA_Type *base, uint32_t channel)
{
    assert(channel < FSL_FEATURE_EDMA_MODULE_CHANNEL);
    uint32_t remainingCount = 0;
    if (DMA_CSR_DONE_MASK & base->TCD[channel].CSR)
    {
        remainingCount = 0;
    }
    else
    {
        if (base->TCD[channel].CITER_ELINKNO & DMA_CITER_ELINKNO_ELINK_MASK)
        {
            remainingCount =
                (base->TCD[channel].CITER_ELINKYES & DMA_CITER_ELINKYES_CITER_MASK) >> DMA_CITER_ELINKYES_CITER_SHIFT;
        }
        else
        {
            remainingCount =
                (base->TCD[channel].CITER_ELINKNO & DMA_CITER_ELINKNO_CITER_MASK) >> DMA_CITER_ELINKNO_CITER_SHIFT;
        }
    }
    return remainingCount;
}