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.

[参考译文] TM4C1294NCPDT:SPI 直接存储器访问-示例代码

Guru**** 1555290 points
Other Parts Discussed in Thread: ADS1274, EK-TM4C1294XL
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1369026/tm4c1294ncpdt-spi-direct-memory-access---example-code

器件型号:TM4C1294NCPDT
主题中讨论的其他器件:ADS1274EK-TM4C1294XL

工具与软件:

您好、TI 团队、

我们将 TM4C1294NCPDTT3微控制器与 ADS1274 ADC 模块集成。 从 SSI_DR_DATA(0x40008008)寄存器,我们需要通过直接存储器访问方法将该值传输到另一个变量。  

请提供 SPI DMA 方法的示例代码。

谢谢。此致、

A. Ajith Kumar

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

     您可以参考示例 C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\udma_demo。 本例演示了存储器到存储器的传输以及存储器到 UART 外设的传输。 如示例代码所示、 UART1/2基地 址+ UART_O_DR (UART 移位寄存器)用作 uDMA 传输的目标地址。  

    //
    // Set up the transfer parameters for the uDMA UART TX channel. This will
    // configure the transfer source and destination and the transfer size.
    // Basic mode is used because the peripheral is making the uDMA transfer
    // request. The source is the TX buffer and the destination is the UART
    // data register.
    //
    MAP_uDMAChannelTransferSet(UDMA_CHANNEL_UART1TX | UDMA_PRI_SELECT,
    UDMA_MODE_BASIC, g_ui8TxBuf,
    (void *)(UART1_BASE + UART_O_DR),
    sizeof(g_ui8TxBuf));

    从存储器到 SSI1外设的传输可以更改为下面的示例设置。 您需要将示例中的其余代码相应地从 UART1更改为 SSI1。  

    MAP_uDMAChannelTransferSet(UDMA_CHANNEL_SSI1TX| UDMA_PRI_SELECT,
    UDMA_MODE_BASIC, g_ui16TxBuf,
    (void *)(SSI1_BASE + SSI_O_DR),
    sizeof(g_ui16TxBuf));