//***************************************************************************** // //! Initialize the DMA controller //! //! \param None //! //! This function initializes //! 1. Initializes the McASP module //! //! \return None. // //***************************************************************************** void UDMAInit() { unsigned int uiLoopCnt; // // Enable McASP at the PRCM module // MAP_PRCMPeripheralClkEnable(PRCM_UDMA,PRCM_RUN_MODE_CLK); MAP_PRCMPeripheralReset(PRCM_UDMA); // // Register interrupt handlers // MAP_uDMAIntRegister(UDMA_INT_SW, DmaSwIntHandler); MAP_uDMAIntRegister(UDMA_INT_ERR, DmaErrorIntHandler); // // Enable uDMA using master enable // MAP_uDMAEnable(); // // Set Control Table // memset(gpCtlTbl,0,sizeof(tDMAControlTable)*CTL_TBL_SIZE); MAP_uDMAControlBaseSet(gpCtlTbl); // // Reset App Callbacks // for(uiLoopCnt = 0; uiLoopCnt < MAX_NUM_CH; uiLoopCnt++) { gfpAppCallbackHndl[uiLoopCnt] = NULL; } }
//***************************************************************************** // //! Initialize the DMA controller //! //! \param None //! //! This function initializes //! 1. Initializes the McASP module //! //! \return None. // //***************************************************************************** void UDMAInit() { unsigned int uiLoopCnt; // // Enable McASP at the PRCM module // MAP_PRCMPeripheralClkEnable(PRCM_UDMA,PRCM_RUN_MODE_CLK); MAP_PRCMPeripheralReset(PRCM_UDMA); // // Register interrupt handlers // #if defined(USE_TIRTOS) || defined(USE_FREERTOS) || defined(SL_PLATFORM_MULTI_THREADED) // USE_TIRTOS: if app uses TI-RTOS (either networking/non-networking) // USE_FREERTOS: if app uses Free-RTOS (either networking/non-networking) // SL_PLATFORM_MULTI_THREADED: if app uses any OS + networking(simplelink) osi_InterruptRegister(INT_UDMA, DmaSwIntHandler, INT_PRIORITY_LVL_1); osi_InterruptRegister(INT_UDMAERR, DmaErrorIntHandler, INT_PRIORITY_LVL_1); #else MAP_IntPrioritySet(INT_UDMA, INT_PRIORITY_LVL_1); MAP_uDMAIntRegister(UDMA_INT_SW, DmaSwIntHandler); MAP_IntPrioritySet(INT_UDMAERR, INT_PRIORITY_LVL_1); MAP_uDMAIntRegister(UDMA_INT_ERR, DmaErrorIntHandler); #endif // // Enable uDMA using master enable // MAP_uDMAEnable(); // // Set Control Table // memset(gpCtlTbl,0,sizeof(tDMAControlTable)*CTL_TBL_SIZE); MAP_uDMAControlBaseSet(gpCtlTbl); // // Reset App Callbacks // for(uiLoopCnt = 0; uiLoopCnt < MAX_NUM_CH; uiLoopCnt++) { gfpAppCallbackHndl[uiLoopCnt] = NULL; } }