The tcDspQDMA class is used to provide common access to the EDMA quick direct memory access (QDMA) engines. Because there may be only 3 high and 3 low priority engines running at any one time, and additional requests will stall the CPU, a top level management class has been created in order to allow application classes and MityDSP core components to leverage the Quick DMAs.
This is a simple example of tcDspSerial creation and usage:
#include "core/DspQDMA.h" void SomeFunc() { unsigned int* src = SOMEADDRESS; unsigned int* dst = SOMEOTHERADDRESS; unsigned int numbytes = SOMENUMBYTES; SEM_Handle myHandle = SEM_create(0,NULL); // In this example, we'll transfer 32 bit words unsigned int ii = numbytes>>2; if (numbytes&3) ii++; // NOTE - Caches should be managed appropriately for // transfers... // In this case, the caching mode has been determined // earlier using the CACHE_setL2Mode() API. if (msL2Mode != CACHE_64KSRAM) { CACHE_wbInvL2(dst,numwords*4,CACHE_WAIT); CACHE_wbInvL2(src,ii*4,CACHE_WAIT); } else { CACHE_wbInvL1d(dst,ii*4,CACHE_WAIT); CACHE_wbInvL1d(src,ii*4,CACHE_WAIT); } tcDspQDMA::GetInstance()->BlockTransfer(&myHandle, src, dst, ii, EDMA_OPT_ESIZE_32BIT, EDMA_OPT_PRI_HIGH); // do some other stuff ... // Wait for it to complete... SEM_pend(myHandle,SYS_FOREVER); }