/* Deinitializes the DMA Channeln registers to their default reset values.  */
void DMA_DeInit(DMA_Channel_TypeDef *channel)
/* Deinitializes the DMA Channeln registers to their default reset values.  */
void DMA_DeInit(DMA_Channel_TypeDef *channel)
{
    channel->CCR &= ~DMA_CCR_EN;
    channel->CCR   = 0;
    channel->CNDTR = 0;
    channel->CPAR  = 0;
    channel->CMAR  = 0;
    if((*(vu32*)&channel) >= (*(vu32*)DMA2_Channel1_BASE)) {
        DMA2->IFCR |= (u32)0x0F << (((*(vu32*)&channel & (u32)0xff) - 8) / 5);
    }
    else {
        DMA1->IFCR |= (u32)0x0F << (((*(vu32*)&channel & (u32)0xff) - 8) / 5);
    }
}