This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C6748: SPI在使用EDMA传输的时候可以不用EDMA传输完成中断吗?

Part Number: TMS320C6748

您好,

请问在C6748中,参考PDK示例使用SPI+EDMA访问外部flash时可以不使用EDMA传输完成中断,而改用polling的模式吗?

  • 可以不使用中断模式,通过polling标志位的方式传输。但中断方式会比Polling模式快。

  • uint32_t edma3Id;
    EDMA3_RM_Handle edmaHandle = NULL;
    EDMA3_DRV_Result edmaResult = EDMA3_DRV_E_INVALID_PARAM;

    /* SPI params structure */
    SPI_Params spiParams;
    /* SPI Hardware attributes */
    SPI_v0_HWAttrs spiHwAttr;

    // Initialize edma3 driver handle
    edma3Id = 0;
    edmaHandle = (EDMA3_RM_Handle)EDMA3_init(edma3Id, &edmaResult);

    /* Get the default SPI init configurations */
    SPI_socGetInitCfg(configIndex, &spiHwAttr);

    /* Set the DMA related init config */
    spiHwAttr.pinMode = SPI_PINMODE_4_PIN;
    spiHwAttr.edmaHandle = edmaHandle;
    spiHwAttr.dmaMode = true;
    spiHwAttr.enableIntr = false;

    /* Set customized SPI hard attr to spi_config list*/
    SPI_socSetInitCfg(configIndex, &spiHwAttr);

    /* Get default SPI params configurations */
    SPI_Params_init(&spiParams);

    /* Config SPI params*/
    spiParams.transferMode = SPI_MODE_BLOCKING;
    spiParams.frameFormat = SPI_POL1_PHA0;
    spiParams.dataSize = 8;
    spiParams.bitRate = bitRate;

    请问以上配置需要改什么地方呢?

  • 请问轮询模式传输数据时,还需要使用EDMA吗?

  • 最好需要,不使用EDMA的话是不是传输大数据的比较慢?由于现在EMIF也使用了EDMA的中断,为了避免冲突才考虑SPI能不能不用EDMA中断也可以进行传输

  • 可以参考SPI_LoopbackExample_lcdkOMAPL138_c674xExampleProject的例程,没有用EDMA。

  • 请问用了EDMA是不是必须要用EDMA的传输完成中断信号?

  • 一般都是用中断信号完成的,轮询会占用CPU资源,效率不高。