MityDSP Documentation Index
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
MityDSP::tcDspFpgaDma Class Reference

The tcDspFpgaDma class provides the MityDSP FPGA with DMA access to blocks of DSP memory. More...

#include <core/DspFpgaDma.h>

List of all members.

Public Types

enum  teChannelIds { eeChannel1 = 0, eeChannel2 = 1, eeChannel3 = 2, eeChannel4 = 3 }
 Channel enumerator. More...

Public Member Functions

 tcDspFpgaDma (void *apAddress, int anLevel=gnAutoLevel)
 This constructor is used to create an instance of the tcDspFpgaDma class.
 ~tcDspFpgaDma ()
 This destructor is used to close up and free tcDspFpgaDma resources.
bool DmaToFpga (int anChannel, void *apDspAddr, int anLength, bool abContinuous=false, SEM_Handle ahDmaComplete=NULL, bool abReInitFpgaBuffer=false, unsigned int anFpgaBufferOffset=0)
 This routine schedules a DMA transfer from a buffer in DSP RAM to the specified FPGA DMA channel.
bool DmaFromFpga (int anChannel, void *apDspAddr, int anLength, bool abContinuous=false, SEM_Handle ahDmaComplete=NULL, bool abReInitFpgaBuffer=false, unsigned int anFpgaBufferOffset=0)
 This routine schedules a DMA transfer from a specified FPGA DMA channel to a buffer in DSP RAM.
bool IsDmaComplete (int anChannel)
 This routine indicates whether or not a specified DMA channel is currently in use.
void DisableChannel (int anChannel)
 This routine disables all DMA transfers on a specified channel.

Public Attributes

unsigned int mnInterruptCount
 ISR counter (debug).

Static Public Attributes

static const int gnNUM_DMA_CHANNELS = 4
 Number of DMA channels available.

Protected Member Functions

void DmaCompleteInterrupt (void)
 Interrupt service routine for DMA complete interrupts.
void ImplementSize (int anIdx, int anLength, bool abReInit, unsigned int anOffset)
 Internal routine to set the DMA transfer size for a specified FPGA location.
void ImplementFlags (int anIdx, bool abEnable, bool abToFpga, bool abContinuous, bool abIntEnable, void *apDspAddr)
 Internal routine to set-up the DMA transfer flags for a specified FPGA location.

Static Protected Member Functions

static int interrupt_dispatch (Arg arMyObject)
 Static interrupt dispatch routine.

Protected Attributes

SEM_Handle mhMutex
 Used to serialize access.
volatile unsigned int * mpBaseAddr
 Core base address.
unsigned short mnMyIntMask
 core interrupt mask
int mnMyIntLevel
 core interrupt level
int mnMyIntVector
 core interrupt vector
SEM_Handle mhDoneSemaphore [gnNUM_DMA_CHANNELS]
 Storage for completion semaphores.
bool mbDmaEnabled [gnNUM_DMA_CHANNELS]
 True if channel enabled.
bool mbDmaContinuous [gnNUM_DMA_CHANNELS]
 True if continuous DMA.

Detailed Description

The tcDspFpgaDma class provides the MityDSP FPGA with DMA access to blocks of DSP memory.

The accesses may be continuous or one-shot, read or write.

See also:
tcDspFpgaDma Page

Member Enumeration Documentation

Channel enumerator.

Enumerator:
eeChannel1 
eeChannel2 
eeChannel3 
eeChannel4 

Constructor & Destructor Documentation

tcDspFpgaDma::tcDspFpgaDma ( void *  apAddress,
int  anLevel = gnAutoLevel 
)

This constructor is used to create an instance of the tcDspFpgaDma class.

An interrupt level may be specified to install a chained ISR at the proper level, otherwise automatic interrupt vectoring is employed.

Parameters:
[in]apAddressBase Address of the FPGA DMA core
[in]anLevelOptional interrupt level parameter
Returns:
None.
See also:
DspFpgaDma.h
DspIntDispatch.h
tcDspFpgaDma::~tcDspFpgaDma ( )

This destructor is used to close up and free tcDspFpgaDma resources.

Returns:
None.
See also:
DspFpgaDma.h

Member Function Documentation

bool tcDspFpgaDma::DmaToFpga ( int  anChannel,
void *  apDspAddr,
int  anLength,
bool  abContinuous = false,
SEM_Handle  ahDmaComplete = NULL,
bool  abReInitFpgaBuffer = false,
unsigned int  anFpgaBufferOffset = 0 
)

This routine schedules a DMA transfer from a buffer in DSP RAM to the specified FPGA DMA channel.

Parameters:
[in]anChannelThe FPGA DMA channel to use.
[in]apDspAddrThe address of the DSP buffer (must be 4-byte aligned).
[in]anLengthThe length of the buffer to copy from (multiple of 4 bytes).
[in]abContinuousTrue for repeated transfer, false for a single-shot (default: false).
[in]ahDmaCompleteAn optional semaphore to signal upon DMA completion (default: NULL).
[in]abReInitFpgaBufferFPGA buffer should restart from the specified location each transfer (default: false).
[in]anFpgaBufferOffsetFPGA buffer offset used when abReInitFpgaBuffer is true (default: 0).
Returns:
True if scheduled successfully.
See also:
DspFpgaDma.h
bool tcDspFpgaDma::DmaFromFpga ( int  anChannel,
void *  apDspAddr,
int  anLength,
bool  abContinuous = false,
SEM_Handle  ahDmaComplete = NULL,
bool  abReInitFpgaBuffer = false,
unsigned int  anFpgaBufferOffset = 0 
)

This routine schedules a DMA transfer from a specified FPGA DMA channel to a buffer in DSP RAM.

Parameters:
[in]anChannelThe FPGA DMA channel to use.
[in]apDspAddrThe address of the DSP buffer (must be 4-byte aligned).
[in]anLengthThe length of the buffer to copy to (multiple of 4 bytes).
[in]abContinuousTrue for repeated transfer, false for a single-shot (default: false).
[in]ahDmaCompleteAn optional semaphore to signal upon DMA completion (default: NULL).
[in]abReInitFpgaBufferFPGA buffer should restart from the specified location each transfer (default: false).
[in]anFpgaBufferOffsetFPGA buffer offset used when abReInitFpgaBuffer is true (default: 0).
Returns:
True if scheduled successfully.
See also:
DspFpgaDma.h
bool tcDspFpgaDma::IsDmaComplete ( int  anChannel)

This routine indicates whether or not a specified DMA channel is currently in use.

Parameters:
[in]anChannelThe FPGA DMA channel to query.
Returns:
True if there is currently not a DMA in progress.
See also:
DspFpgaDma.h
void tcDspFpgaDma::DisableChannel ( int  anChannel)

This routine disables all DMA transfers on a specified channel.

Parameters:
[in]anChannelThe FPGA DMA channel to disable.
Returns:
None.
See also:
DspFpgaDma.h
int tcDspFpgaDma::interrupt_dispatch ( Arg  ahMyObject)
staticprotected

Static interrupt dispatch routine.

Required because of the hidden this pointer associated with a member function, which cannot be passed directly to the interrupt dispatcher.

Parameters:
[in]ahMyObjectThe "this->" pointer for the instance of tcDspFpgaDma associated with this ISR.
Returns:
0
void tcDspFpgaDma::DmaCompleteInterrupt ( void  )
protected

Interrupt service routine for DMA complete interrupts.

Each channel is checked to see if the enable bit is low, and the interrupt enable bit is high. If so, the interrupt is acknowledged appropriately, and any semaphore registered for the channel is posted.

See also:
DspFpgaDma.h
void tcDspFpgaDma::ImplementSize ( int  anIdx,
int  anLength,
bool  abReInit,
unsigned int  anOffset 
)
protected

Internal routine to set the DMA transfer size for a specified FPGA location.

Parameters:
[in]anIdxThe location of the FPGA register who's size is to be set.
[in]anLengthThe size to write to the register.
[in]abReInitSet to true to re-initialize any in-process transfers (default:false).
[in]anOffsetByte offset into buffer to begin at following a re-initialization (default: 0).
Returns:
None.
See also:
DspFpgaDma.h
void tcDspFpgaDma::ImplementFlags ( int  anIdx,
bool  abEnable,
bool  abToFpga,
bool  abContinuous,
bool  abIntEnable,
void *  apDspAddr 
)
protected

Internal routine to set-up the DMA transfer flags for a specified FPGA location.

Parameters:
[in]anIdxThe location of the FPGA register who's flags are to be set.
[in]abEnableTrue to enable the channel.
[in]abToFpgaTrue for a transfer to the FPGA.
[in]abContinuousTrue for a continuous transfer.
[in]abIntEnableTrue to enable the DMA complete interrupt.
[in]apDspAddrAddress of the DSP buffer to be read or written.
Returns:
None.
See also:
DspFpgaDma.h

Member Data Documentation

const int MityDSP::tcDspFpgaDma::gnNUM_DMA_CHANNELS = 4
static

Number of DMA channels available.

unsigned int MityDSP::tcDspFpgaDma::mnInterruptCount

ISR counter (debug).

SEM_Handle MityDSP::tcDspFpgaDma::mhMutex
protected

Used to serialize access.

volatile unsigned int* MityDSP::tcDspFpgaDma::mpBaseAddr
protected

Core base address.

unsigned short MityDSP::tcDspFpgaDma::mnMyIntMask
protected

core interrupt mask

int MityDSP::tcDspFpgaDma::mnMyIntLevel
protected

core interrupt level

int MityDSP::tcDspFpgaDma::mnMyIntVector
protected

core interrupt vector

SEM_Handle MityDSP::tcDspFpgaDma::mhDoneSemaphore[gnNUM_DMA_CHANNELS]
protected

Storage for completion semaphores.

bool MityDSP::tcDspFpgaDma::mbDmaEnabled[gnNUM_DMA_CHANNELS]
protected

True if channel enabled.

bool MityDSP::tcDspFpgaDma::mbDmaContinuous[gnNUM_DMA_CHANNELS]
protected

True if continuous DMA.


  
Generated on Mon Apr 22 2013 11:33:03 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.