MityDSP Documentation Index

MityDSP::tcDspQDMA Class Reference

Instances of this class handle sending, receiving, and configuring Quick DMA tranfers. More...

#include <core/DspQDMA.h>

List of all members.

Public Member Functions

int ReadFromFIFO (SEM_Handle *apHandle, void *apSRC, void *apDST, unsigned short NumWords, unsigned int anSize=EDMA_OPT_ESIZE_32BIT, unsigned int anPri=EDMA_OPT_PRI_HIGH, bool apFromIsr=false)
 Reads data from a FIFO to contiguous block of memory.
int WriteToFIFO (SEM_Handle *apHandle, void *apSRC, void *apDST, unsigned short NumWords, unsigned int anSize=EDMA_OPT_ESIZE_32BIT, unsigned int anPri=EDMA_OPT_PRI_HIGH, bool apFromIsr=false)
 Writes data from a contiguous block of memory to a FIFO (single address endpoint).
int BlockTransfer (SEM_Handle *apHandle, void *apSRC, void *apDST, unsigned short NumWords, unsigned int anSize=EDMA_OPT_ESIZE_32BIT, unsigned int anPri=EDMA_OPT_PRI_HIGH, bool apFromIsr=false)
 Transfer a contiguous block of data from one location to another.

Static Public Member Functions

static tcDspQDMAGetInstance (void)
 Single accessor.

Static Public Attributes

static const int NUM_QDMA_CHANNELS = 6
static const unsigned int EDMA_OPT_PRI_ANY = 0xFFFFFFFF

Protected Member Functions

int AcquireChannel (unsigned int &anPri, bool apFromIsr)
 Internal function.
 tcDspQDMA (void)
 Constructor.
 ~tcDspQDMA (void)
 Destructor.

Static Protected Member Functions

static void QDMA_Channel_Handler (int anTcc)
 Handler for Quick DMA complete.
static void QDMA_ISR_Handler (void)
 QDMA interrupt handler.

Protected Attributes

SEM_Handle mhThreadLock
 Semaphore to serialize access.

Static Protected Attributes

static tcDspQDMAgpDspQDMA = NULL
 Singleton object.
static volatile SEM_Handle * ghDMADone [6]
 Indicated QDMA transfer is complete.
static volatile bool maDMAActive [6]
 Used to check SEMS are complete.
static int mnTcc [NUM_QDMA_CHANNELS]
 EDMA channel assignments.
static int mnChannel [EDMA_CHA_CNT]
 Reverse EDMA to channel lookup.

Detailed Description

Instances of this class handle sending, receiving, and configuring Quick DMA tranfers.

This class installs an ISR and should be used for all application quick DMA transfer requests.

See also:
tcDspQDMA Page

Constructor & Destructor Documentation

tcDspQDMA::tcDspQDMA ( void   )  [protected]

Constructor.

tcDspQDMA::~tcDspQDMA ( void   )  [protected]

Destructor.


Member Function Documentation

tcDspQDMA * tcDspQDMA::GetInstance ( void   )  [static]

Single accessor.

int tcDspQDMA::ReadFromFIFO ( SEM_Handle *  apHandle,
void *  apSRC,
void *  apDST,
unsigned short  NumWords,
unsigned int  anSize = EDMA_OPT_ESIZE_32BIT,
unsigned int  anPri = EDMA_OPT_PRI_HIGH,
bool  abFromIsr = false 
)

Reads data from a FIFO to contiguous block of memory.

Parameters:
apHandle Pointer to semaphore handle for notification of FIFO completion. Can be NULL.
apSRC Source location, must be word aligned.
apDST Destination location, must be word aligned
NumWords Total number of words to transfer
anSize specify:

  • EDMA_OPT_ESIZE_8BIT
  • EDMA_OPT_ESIZE_32BIT
  • EDMA_OPT_ESIZE_16BIT
anPri specify:

  • EDMA_OPT_PRI_HIGH
  • EDMA_OPT_PRI_LOW
  • EDMA_OPT_PRI_ANY
abFromIsr Set to true if being called from an HWI or SWI (default:false)
Warning:
This function does not manage system caches. The user should consider calling a CACHE_InvL2() or CACHE_wbInvL1() as required.
Returns:
Less than zero if a failure occurred (no DMA available)
int tcDspQDMA::WriteToFIFO ( SEM_Handle *  apHandle,
void *  apSRC,
void *  apDST,
unsigned short  NumWords,
unsigned int  anSize = EDMA_OPT_ESIZE_32BIT,
unsigned int  anPri = EDMA_OPT_PRI_HIGH,
bool  abFromIsr = false 
)

Writes data from a contiguous block of memory to a FIFO (single address endpoint).

Data must be contiguously packed in memory.

Parameters:
apHandle Pointer to semaphore handle for notification of FIFO completion. Can be NULL.
apSRC Source location, must be word aligned.
apDST Destination location, must be word aligned
NumWords Total number of words to transfer
anSize specify:

  • EDMA_OPT_ESIZE_8BIT
  • EDMA_OPT_ESIZE_32BIT
  • EDMA_OPT_ESIZE_16BIT
anPri specify:

  • EDMA_OPT_PRI_HIGH
  • EDMA_OPT_PRI_LOW
  • EDMA_OPT_PRI_ANY
abFromIsr Set to true if being called from an HWI or SWI (default:false)
Warning:
This function does not manage system caches. The user should consider calling a CACHE_InvL2() or CACHE_wbInvL1() as required.
Returns:
Less than zero if a failure occurred (no DMA available)
int tcDspQDMA::BlockTransfer ( SEM_Handle *  apHandle,
void *  apSRC,
void *  apDST,
unsigned short  NumWords,
unsigned int  anSize = EDMA_OPT_ESIZE_32BIT,
unsigned int  anPri = EDMA_OPT_PRI_HIGH,
bool  abFromIsr = false 
)

Transfer a contiguous block of data from one location to another.

Words must be packed.

Parameters:
apHandle Pointer to semaphore handle for notification of FIFO completion. Can be NULL.
apSRC Source location, must be word aligned.
apDST Destination location, must be word aligned
NumWords Total number of words to transfer
anSize specify:

  • EDMA_OPT_ESIZE_8BIT
  • EDMA_OPT_ESIZE_32BIT
  • EDMA_OPT_ESIZE_16BIT
anPri specify:

  • EDMA_OPT_PRI_HIGH
  • EDMA_OPT_PRI_LOW
  • EDMA_OPT_PRI_ANY
abFromIsr Set to true if being called from an HWI or SWI (default:false)
Warning:
This function does not manage system caches. The user should consider calling a CACHE_InvL2() or CACHE_wbInvL1() as required.
Returns:
Less than zero if a failure occurred (no DMA available)
int tcDspQDMA::AcquireChannel ( unsigned int &  anPri,
bool  abFromIsr 
) [protected]

Internal function.

This routine locates an available TCC code for use with the QDMA transfer.

Parameters:
anPri The priority EDMA_OPT_PRI_HIGH, EDMA_OPT_PRI_LOW or EDMA_OPT_PRI_ANY
abFromIsr True if function called from ISR space (default: false)
Returns:
the index (0 to 5) to use or non-zero
void tcDspQDMA::QDMA_Channel_Handler ( int  anTcc  )  [static, protected]

Handler for Quick DMA complete.

Parameters:
[in] anTcc DMA channel number.
Returns:
None.
void tcDspQDMA::QDMA_ISR_Handler ( void   )  [static, protected]

QDMA interrupt handler.

The EDMA library does not auto-install the interrupt dispatcher, so we'll install it here. A couple of notes: The interrupt dispatcher clears the CIPR register before it calls the corresponding channel handler. This is sort of bad, because corresponding handlers can't be written to deal with multiple channel events (as they can't figure out which event fired the handler).

Rather then creating a slightly smarter handler, we chose to use the EDMA_ library approach to support other applications which might want to use the EDMA_intHook() type interface.


Member Data Documentation

const int MityDSP::tcDspQDMA::NUM_QDMA_CHANNELS = 6 [static]
const unsigned int MityDSP::tcDspQDMA::EDMA_OPT_PRI_ANY = 0xFFFFFFFF [static]
tcDspQDMA * tcDspQDMA::gpDspQDMA = NULL [static, protected]

Singleton object.

volatile SEM_Handle * tcDspQDMA::ghDMADone [static, protected]

Indicated QDMA transfer is complete.

volatile bool tcDspQDMA::maDMAActive [static, protected]

Used to check SEMS are complete.

int tcDspQDMA::mnTcc [static, protected]

EDMA channel assignments.

int tcDspQDMA::mnChannel [static, protected]

Reverse EDMA to channel lookup.

SEM_Handle MityDSP::tcDspQDMA::mhThreadLock [protected]

Semaphore to serialize access.


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