您好,欢迎来到爱go旅游网。
搜索
您的当前位置:首页The difference between DMA、EDMA、QDMA、DATA_XXX

The difference between DMA、EDMA、QDMA、DATA_XXX

来源:爱go旅游网
  EDMA: in Cx 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_KCACHE);
    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();

}

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- igat.cn 版权所有 赣ICP备2024042791号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务