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

The tcDspRamBlock class is a virtual base class to provide consistent access to various firmware cores that adhere to the RAM Block interface. More...

#include <core/DspRamBlock.h>

Inheritance diagram for MityDSP::tcDspRamBlock:
MityDSP::tcDspTmp0506

List of all members.

Public Types

typedef void(* tfIsrCallback )(unsigned int, tcDspRamBlock *)
 prototype for the ISR callback
typedef void(* tfIsrCallbackWithArg )(unsigned int, tcDspRamBlock *, void *)

Public Member Functions

 tcDspRamBlock (void *apAddress, int anLevel=gnAutoLevel)
 This constructor is used to create the base class functionality required for cores that adhere to the MityDSP RAM Block interface.
virtual ~tcDspRamBlock ()
 This destructor is used to close up and free tcDspRamBlock resources.
virtual bool isDirty (unsigned int anId)
 Determine whether a given input block is dirty.
virtual int getBlockWidth (void)
 Returns the width of the registers in the RAM block interface.
virtual void writeBlock (unsigned int anId, unsigned int anValue)
 Writes the value at the specified RAM Block ID.
virtual unsigned int readBlock (unsigned int anId)
 Reads the value at the specified RAM Block ID.
virtual void interruptEnable (bool abEnable)
 Enables or disables the Block Dirty interrupt.
virtual void registerIsrHandler (tfIsrCallback afCallback)
 Registers the user-supplied callback to be run whenever the Block Dirty interrupt occurs.
virtual void registerIsrHandler (tfIsrCallbackWithArg afCallback, void *apUserArg=NULL)
 Registers the user-supplied callback to be run whenever the Block Dirty interrupt occurs.

Static Public Member Functions

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

Public Attributes

unsigned int mnInterruptCount
 ISR counter (debug).

Static Public Attributes

static const int gnNUM_RAM_BLOCKS = 16

Protected Member Functions

void blockDirtyInterrupt (void)
 Interrupt service routine for RAM Block-based cores.

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
tfIsrCallback mfIsrCallback
 ISR callbacks.
tfIsrCallbackWithArg mfIsrCallbackWithArg
 ISR callback with user argument.
void * mpUserArg
 User-supplied callback parameter.
int mnBlockWidth
 RAM block data width (bytes)

Detailed Description

The tcDspRamBlock class is a virtual base class to provide consistent access to various firmware cores that adhere to the RAM Block interface.

In general, this class should be used to derive a specific class for a given device and should not be used directly.

See also:
tcDspRamBlock Page

Member Typedef Documentation

typedef void(* MityDSP::tcDspRamBlock::tfIsrCallback)(unsigned int, tcDspRamBlock *)

prototype for the ISR callback

typedef void(* MityDSP::tcDspRamBlock::tfIsrCallbackWithArg)(unsigned int, tcDspRamBlock *, void *)

Constructor & Destructor Documentation

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

This constructor is used to create the base class functionality required for cores that adhere to the MityDSP RAM Block interface.

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 RAM Block interface
[in]anLevelOptional interrupt level parameter
Returns:
None.
See also:
DspRamBlock.h
DspIntDispatch.h
tcDspRamBlock::~tcDspRamBlock ( )
virtual

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

Returns:
None.
See also:
DspRamBlock.h

Member Function Documentation

int tcDspRamBlock::interrupt_dispatch ( Arg  ahMyObject)
static

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 tcDspRamBlock associated with this ISR.
Returns:
0
bool tcDspRamBlock::isDirty ( unsigned int  anId)
virtual

Determine whether a given input block is dirty.

Parameters:
[in]anIdThe input block ID being queried.
Returns:
True if there's new unread data available.
See also:
DspRamBlock.h
int tcDspRamBlock::getBlockWidth ( void  )
virtual

Returns the width of the registers in the RAM block interface.

Returns:
Register width in bytes (1-4).
See also:
DspRamBlock.h
void tcDspRamBlock::writeBlock ( unsigned int  anId,
unsigned int  anValue 
)
virtual

Writes the value at the specified RAM Block ID.

The width of the data actually written is determined by the data width reported in the block control register. The dirty flag associated with the output block ID is set after writing it.

Parameters:
[in]anIdThe output block ID being updated.
[in]anValueThe value to be stored at the specified block.
Returns:
None.
See also:
DspRamBlock.h
unsigned int tcDspRamBlock::readBlock ( unsigned int  anId)
virtual

Reads the value at the specified RAM Block ID.

The dirty flag associated with the value is cleared.

Parameters:
[in]anIdThe input block ID being requested.
Returns:
Value stored at the specified location.
See also:
DspRamBlock.h
void tcDspRamBlock::interruptEnable ( bool  abEnable)
virtual

Enables or disables the Block Dirty interrupt.

Parameters:
[in]abEnableTrue to enable interrupts.
Returns:
None.
See also:
DspRamBlock.h
void tcDspRamBlock::registerIsrHandler ( tfIsrCallback  afCallback)
virtual

Registers the user-supplied callback to be run whenever the Block Dirty interrupt occurs.

Caution should be used as this callback will execute in ISR context (no DSP/BIOS calls that can potentially block are allowed).

Parameters:
[in]afCallbackPointer to the callback routine (or NULL to disable callbacks.
Returns:
None.
See also:
DspRamBlock.h
void tcDspRamBlock::registerIsrHandler ( tfIsrCallbackWithArg  afCallback,
void *  apUserArg = NULL 
)
virtual

Registers the user-supplied callback to be run whenever the Block Dirty interrupt occurs.

Caution should be used as this callback will execute in ISR context (no DSP/BIOS calls that can potentially block are allowed).

Parameters:
[in]afCallbackPointer to the callback routine (or NULL to disable callbacks.
[in]apUserArgAn argument to be supplied with the callback.
Returns:
None.
See also:
DspRamBlock.h
void tcDspRamBlock::blockDirtyInterrupt ( void  )
protected

Interrupt service routine for RAM Block-based cores.

The ISR reads and clears any pending interrupts. If the pending interrupt has a callback registered for it, the routine is called.

"Interrupt-ness" is taken care of by the 'dispatcher' in DSP/BIOS. Installed by the constructor.

See also:
DspRamBlock.h

Member Data Documentation

const int MityDSP::tcDspRamBlock::gnNUM_RAM_BLOCKS = 16
static
unsigned int MityDSP::tcDspRamBlock::mnInterruptCount

ISR counter (debug).

SEM_Handle MityDSP::tcDspRamBlock::mhMutex
protected

Used to serialize access.

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

Core base address.

unsigned short MityDSP::tcDspRamBlock::mnMyIntMask
protected

core interrupt mask

int MityDSP::tcDspRamBlock::mnMyIntLevel
protected

core interrupt level

int MityDSP::tcDspRamBlock::mnMyIntVector
protected

core interrupt vector

tfIsrCallback MityDSP::tcDspRamBlock::mfIsrCallback
protected

ISR callbacks.

tfIsrCallbackWithArg MityDSP::tcDspRamBlock::mfIsrCallbackWithArg
protected

ISR callback with user argument.

void* MityDSP::tcDspRamBlock::mpUserArg
protected

User-supplied callback parameter.

int MityDSP::tcDspRamBlock::mnBlockWidth
protected

RAM block data width (bytes)


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