/* Gets the remaining bytes of the current DMA descriptor transfer.  */
uint32_t DMA_GetRemainingBytes(DMA_Type *base, uint32_t channel)
/* Gets the remaining bytes of the current DMA descriptor transfer.  */
uint32_t DMA_GetRemainingBytes(DMA_Type *base, uint32_t channel)
{
    assert(channel < FSL_FEATURE_DMA_NUMBER_OF_CHANNELS);
    if (
        (!(base->COMMON[DMA_CHANNEL_GROUP(channel)].ACTIVE & (1U << (DMA_CHANNEL_INDEX(channel))))) && 
        (0x3FF == ((base->CHANNEL[channel].XFERCFG & DMA_CHANNEL_XFERCFG_XFERCOUNT_MASK) >> DMA_CHANNEL_XFERCFG_XFERCOUNT_SHIFT))
    )
    {
        return 0;
    }
    return base->CHANNEL[channel].XFERCFG + 1;
}