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.

CC2652R: GPIO to DMA

Part Number: CC2652R

I am working with a project that need to collect 32 gpio input data by API "GPIO_readMultiDio(mask)" 

And I wonder how to put these 32bit data into the device buffer through DMA?

I've studied CC26XX TRM and datasheet, couldn't find the example or any detailed development flow.

Just found "UDMACC26XX.h", but in the header it says :

The UDMACC26XX driver currently only supports internal use by the drivers
* that use the uDMA peripheral (e.g., SPICC26XXDMA).
* In other words, the application should never call any of the functions in this file.

Hence, gpio.h library does not include any dma function.....is there any other example or information I could refer?

  • Hi,

    From what I know, there is not a dedicated DMA channel for GPIO. Other solutions exist like using the Software DMA channel. You could also use the Sensor Controller if you want to save power and CPU time.

    Here a link to a thread providing code that could help you.

    If needed, I will ask an expert of the subject for more help.

    Best regards,

  • Hi,

    Have you solved your issue? Do you need further assistance?

    Due to inactivity, I will close this thread in the next few days. After this, if you problem needs further assistance, you will still be able to open a new thread.

    If your problem is solved, please click the green button "This Resolved My Issue".

    Regards,

  • Hi,

    I found some solution like using GPT to trigger DMA transfer. (link)

    I am using periodic mode to do so, but it still not work

    Could you help to see if there are something wrong? Thanks!

    void GPIO2DMA_Configure(){
        /*power up uDMA module*/
        PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
        PRCMPeripheralRunEnable(PRCM_PERIPH_UDMA);
        PRCMPeripheralSleepEnable(PRCM_PERIPH_UDMA);
        PRCMLoadSet();
    
        /*Configure uDMA controller*/
        uDMAEnable(UDMA0_BASE);
        uDMAControlBaseSet(UDMA0_BASE,&uDMAControlTable[0]);//set the control table
        uDMAChannelAttributeDisable(UDMA0_BASE,UDMA_CHAN_TIMER0_A ,UDMA_ATTR_HIGH_PRIORITY);
        uDMAChannelControlSet(UDMA0_BASE,UDMA_CHAN_TIMER0_A |UDMA_PRI_SELECT,UDMA_SIZE_32|UDMA_SRC_INC_NONE|UDMA_DST_INC_NONE|UDMA_ARB_1);//set for control table
        uDMAChannelTransferSet(UDMA0_BASE,UDMA_PRI_SELECT,UDMA_MODE_BASIC,(void*)(GPIO_BASE + GPIO_O_DIN31_0),&gpioDataBuf,sizeof(gpioDataBuf));
        uDMAChannelEnable(UDMA0_BASE,UDMA_CHAN_TIMER0_A );
    }
    
    void TimerDMA_Configure(){
        /* Setting up the timer in continuous callback mode that calls the callback function every 1,000 us*/
        /*Timer_Params timer_params;
        Timer_Params_init(&timer_params);
            timer_params.period = 1000;//microseconds
            timer_params.periodUnits = Timer_PERIOD_US;
            timer_params.timerMode = Timer_CONTINUOUS_CALLBACK;
            timer_params.timerCallback = timerCallback;
        Timer_Handle timerhandle = Timer_open(CONFIG_TIMER_0, &timer_params);*/
    
        Types_FreqHz  freq;
        BIOS_getCpuFreq(&freq);
        uint32_t loadVal = freq.lo / 1000 - 1; //47999
    
        // GPT not enabled by default Turn on PERIPH power domain and clock for GPT0
        PRCMPeripheralRunEnable(PRCM_PERIPH_TIMER0);
        PRCMPeripheralSleepEnable(PRCM_PERIPH_TIMER0);
        PRCMPeripheralDeepSleepEnable(PRCM_PERIPH_TIMER0);
        PRCMLoadSet();
    
        TimerDisable(GPT0_BASE, TIMER_A);
        TimerConfigure(GPT0_BASE, TIMER_CFG_PERIODIC);
        TimerLoadSet(GPT0_BASE, TIMER_A, loadVal);
        TimerEnable(GPT0_BASE, TIMER_A);
    
        TimerIntClear(GPT0_BASE,TIMER_TIMA_DMA);
        EventRegister(EVENT_O_UDMACH9SSEL,EVENT_UDMACH9SSEL_EV_GPT0A_DMABREQ);//GPT DMAEV register single request
        EventRegister(EVENT_O_GPT0ACAPTSEL,EVENT_GPT0ACAPTSEL_EV_GPT0A_CMP);
        TimerIntEnable(GPT0_BASE,TIMER_TIMA_DMA);
    }