/* Configure channel enable or disable. It will unbind descriptor with channel, when channel has been disable.  */
void ald_dma_channel_config(uint8_t channel, type_func_t state)
/* Configure channel enable or disable. It will unbind descriptor with channel, when channel has been disable.  */
void ald_dma_channel_config(uint8_t channel, type_func_t state)
{
    assert_param(IS_DMA_CHANNEL(channel));
    assert_param(IS_FUNC_STATE(state));
    if (state)
    {
        SET_BIT(DMA->CHANNEL[channel].CON, DMA_CON_CHEN_MSK);
    }
    else
    {
        CLEAR_BIT(DMA->CHANNEL[channel].CON, DMA_CON_CHEN_MSK);
        WRITE_REG(DMA->CHANNEL[channel].CON, 0x0);
        WRITE_REG(DMA->CHANNEL[channel].SAR, 0x0);
        WRITE_REG(DMA->CHANNEL[channel].DAR, 0x0);
        WRITE_REG(DMA->CHANNEL[channel].NDT, 0x0);
        WRITE_REG(DMA_MUX->CH_SELCON[channel], 0x0);
    }
    return;
}