/* param base DMA peripheral base address. param channel DMA channel number. return The number of bytes which have not been transferred yet.  */
uint32_t DMA_GetRemainingBytes(DMA_Type *base, uint32_t channel)
/* param base DMA peripheral base address. param channel DMA channel number. return The number of bytes which have not been transferred yet.  */
uint32_t DMA_GetRemainingBytes(DMA_Type *base, uint32_t channel)
{
    assert(FSL_FEATURE_DMA_NUMBER_OF_CHANNELSn(base) != -1);
    assert(channel < (uint32_t)FSL_FEATURE_DMA_NUMBER_OF_CHANNELSn(base));
    if ((!DMA_ChannelIsActive(base, channel)) &&
        (0x3FFUL == ((base->CHANNEL[channel].XFERCFG & DMA_CHANNEL_XFERCFG_XFERCOUNT_MASK) >>
                     DMA_CHANNEL_XFERCFG_XFERCOUNT_SHIFT)))
    {
        return 0UL;
    }
    return ((base->CHANNEL[channel].XFERCFG & DMA_CHANNEL_XFERCFG_XFERCOUNT_MASK) >>
            DMA_CHANNEL_XFERCFG_XFERCOUNT_SHIFT) +
           1UL;
}