AnsweredAssumed Answered

Set Timer interrupt to control DMA get ADC data

Question asked by Wei-Min Hung on Jul 9, 2019
Latest reply on Jul 22, 2019 by Sebastian Delrio

Hi,

 

I'm using QN9080 DK with SDK_2.x_QN908XCDK

I want to get ADC data by DMA controller

I want to set the timer for DMA that DMA will follow the timer regular transfer ADC Data

ex. set Timer every 4 ms use DMA to transfer ADC [ &DEMO_ADC_BASE->DATA ]

Refer to the sample code of qn908xcdk_driver_examples_adc_dma

I found that there are some api maybe for setting DMA Transfer

#define DEMO_ADC_DMA_CHANNEL 14

DMA_EnableChannel(DMA0, DEMO_ADC_DMA_CHANNEL);
DMA_CreateHandle(&g_adcDmaHandle, DMA0, DEMO_ADC_DMA_CHANNEL);

DMA_PrepareTransfer(&transferConfig, (void *)&DEMO_ADC_BASE->DATA, &g_AdcConvResult, sizeof(uint32_t), 4, kDMA_PeripheralToMemory, NULL);

 

 

How to set the DMA for this question?

 

Thanks.

Outcomes