/* Callers are responsible for ensuring the channel is inactive, and will not be reactivated by linking, chaining, or software calls to edma_start().  */
void edma_free_channel(unsigned channel)
/* Callers are responsible for ensuring the channel is inactive, and will not be reactivated by linking, chaining, or software calls to edma_start().  */
void edma_free_channel(unsigned channel)
{
    unsigned ctlr;
    ctlr = EDMA_CTLR(channel);
    channel = EDMA_CHAN_SLOT(channel);
    if (channel >= edma_cc[ctlr]->num_channels)
        return;
    setup_dma_interrupt(channel, RT_NULL, RT_NULL);
    rt_memcpy((void *)(edmacc_regs_base[ctlr] + PARM_OFFSET(channel)),
            &dummy_paramset, PARM_SIZE);
    clear_bit(channel, edma_cc[ctlr]->edma_inuse);
}