Introduction
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.
- Note:
- Use extreme care when using this class from within an ISR. The first call to GetInstance creates a singleton. This must not be done in an ISR (malloc/new is illegal in an ISR). If using tcDspQDMA from an ISR, make sure to call tcDspQDMA::GetInstance() at least once before the ISR is installed!
- See also:
- MityDSP::tcDspQDMA Class Reference
Example
This is a simple example of tcDspSerial creation and usage:
void SomeFunc()
{
unsigned int* src = SOMEADDRESS;
unsigned int* dst = SOMEOTHERADDRESS;
unsigned int numbytes = SOMENUMBYTES;
unsigned int ii = numbytes>>2;
if (numbytes&3)
ii++;
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);
...
}