The codes with DMA enabling are as follows:
For example, I use AB synchronization, numenabled = ccnt; and then the function EDMA3_DRV_enableTransfer () will run ccnt times and so as the number of iterations for completion check.
My question is:
* operation, we have to 'Enable the Transfer' multiple times.
* Number of times depends upon the Mode (A/AB Sync)
* and the different counts. */
if (result == EDMA3_DRV_SOK)
{ /*Need to activate next param*/
if (syncType == EDMA3_DRV_SYNC_A){
numenabled = bcnt * ccnt;
}
else{/* AB Sync Transfer Mode */
numenabled = ccnt;
}
for (i = 0; i < numenabled; i++)
{irqRaised1 = 0;
/** Now enable the transfer as many times as calculated above.*/
result = EDMA3_DRV_enableTransfer (hEdma, *chId, EDMA3_DRV_TRIG_MODE_MANUAL);
if (result != EDMA3_DRV_SOK)
{printf ("edma3_test: EDMA3_DRV_enableTransfer " \"Failed, error code: %d\r\n", result);
break;
}
// Wait for the Completion ISR.
while (irqRaised1 == 0u){
// Wait for the Completion ISR on Master Channel.
// You can insert your code here to do something meaningful.
}
// Check the status of the completed transfer
if (irqRaised1 < 0){
// Some error occured, break from the FOR loop.
/// printf ("\r\nedma3_test: Event Miss Occured!!!\r\n");
// Clear the error bits first
result = EDMA3_DRV_clearErrorBits (hEdma, *chId);
break;
}
}
} // End of data transferring