MityDSP Documentation Index

tcDspQDMA

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:

 #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);

 } 

  
Generated on Fri Sep 23 16:33:45 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.