The difference between DMA、EDMA、QDMA、DATA_XXX

  EDMA: in C64x DSP is a basically enhanced version of the DMA which was used in the C620x/C670x devices.The EDMA includes several enhancements to the DMA. For more details please refer spru234b.pdf literature.

QDMA: is an quick DMA which is local to the CPU. So, QDMA allows direct and quick CPU-initiated DMA submission without having to submit requests to the EDMA channel controller. A QDMA transfer is best suited for applications that require quick data transfers, such as data requests in a tight loop algorithm.
And is used to move data in the background, QDMA or quick DMA stands for CPU triggered transfers, and EDMA stands for event synchronized transfers triggered by hardware events.

DAT module can be used to move data to/from external memory to CPU by DMA/EDMA hardware.
DAT_copy: -API Copies a linear block of data from Src to Dst using DMA or EDMA hardware. (Refer ch.6 in Spru401e.pdf lit)

An example code is given for your clarification.

void main(void)
{
    byte *src; // source pointer
    byte *dst; // destination pointer
 

    int i; // loop counter
    unsigned long id; // transfer id for dma

    // initialise CSL
    CSL_init();

    // configure L2 cache
    CACHE_reset();
    CACHE_setL2Mode(CACHE_64KCACHE);
    CACHE_enableCaching(CACHE_EMIFA_CE00);

    // allocate memory
    if ((src = calloc(256, sizeof(byte))) == NULL)
    {
        printf("Can't allocate src!/n");
        exit(1);
    }

    if ((dst = calloc(256, sizeof(byte))) == NULL)
    {
        printf("Can't allocate dst!/n");
        exit(1);
    }

    // initialise src data
    for (i = 0; i < 256; i++)
    src[i] = i;


    printf("Performing DMA test./n");

   // open dma channel
    if (!DAT_open(DAT_CHAANY, DAT_PRI_LOW, 0))
    {
        printf("Can't open DMA channel!/n");
        exit(2);
    }

    // dma src to dst
    id = DAT_copy(src, dst, 256); //linear copy of 256 bytes
    DAT_wait(id);

    // check result
    for (i = 0; i < 256; i++)
    if ((src[i] - dst[i]) != 0)
    printf("src[%d] = %d, dst[%d] = %d/n", i, src[i], i, dst[i]);

    printf("DMA test done./n/n");

    free(src);
    free(dst);

    DAT_close();

}

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值