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.

AM2634: Switching between SPI Operating Modes

Part Number: AM2634

Hi

Is there a good way to change between MCSPI Operating Mode "Polled" and "DMA" in an application?

Background: For large transfers I want to use the DMA. For short (low latency transfers) I want to use the polled mode.

Thanks and Regards

Dominik

  • Hi Dominik,

    The gMcspiAttrs.operMode (defined in ti_drivers_config.c which is generated by syscfg) decides the McSPI operation mode. It is configured in the syscfg. If you want to switch between the modes on fly, you have to configure it for McSPI DMA mode first, so that the EMDA instance is configured properly. When you want to switch the operation mode from DMA to interrupt, you will need to close the McSPI instance by calling the MCSPI_close(), then change the   gMcspiAttrs.operMode and call the  MCSPI_open().

    Since it involves to close and open the McSPI instance for every operation mode switch, I am not sure it is efficient to make the operation mode switch on fly.

    Best regards,

    Ming