/* DMA request selects for peripherals will override either src_addr or dst_addr. In these cases, the overridden address is a don't care and may be 0.  */
int DMA_SetSrcDstCnt(int ch, void *src_addr, void *dst_addr, unsigned int count)
/* DMA request selects for peripherals will override either src_addr or dst_addr. In these cases, the overridden address is a don't care and may be 0.  */
int DMA_SetSrcDstCnt(int ch, void *src_addr, void *dst_addr, unsigned int count)
{
    if (CHECK_HANDLE(ch)) {
        dma_resource[ch].regs->src = (unsigned int)src_addr;
        dma_resource[ch].regs->dst = (unsigned int)dst_addr;
        dma_resource[ch].regs->cnt = count;
    } else {
        return E_BAD_PARAM;
    }
    return E_NO_ERROR;
}