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>
List of all members.
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.
|
Protected Member Functions |
void | blockDirtyInterrupt (void) |
| Interrupt service routine for RAM Block-based cores.
|
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] | apAddress | Base Address of the RAM Block interface |
[in] | anLevel | Optional interrupt level parameter |
- Returns:
- None.
- See also:
- DspRamBlock.h
-
DspIntDispatch.h
tcDspRamBlock::~tcDspRamBlock |
( |
| ) |
|
|
virtual |
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] | ahMyObject | The "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] | anId | The 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] | anId | The output block ID being updated. |
[in] | anValue | The 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] | anId | The 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] | abEnable | True 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] | afCallback | Pointer to the callback routine (or NULL to disable callbacks. |
- Returns:
- None.
- See also:
- DspRamBlock.h
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] | afCallback | Pointer to the callback routine (or NULL to disable callbacks. |
[in] | apUserArg | An 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 |
SEM_Handle MityDSP::tcDspRamBlock::mhMutex |
|
protected |
Used to serialize access.
volatile unsigned int* MityDSP::tcDspRamBlock::mpBaseAddr |
|
protected |
unsigned short MityDSP::tcDspRamBlock::mnMyIntMask |
|
protected |
int MityDSP::tcDspRamBlock::mnMyIntLevel |
|
protected |
int MityDSP::tcDspRamBlock::mnMyIntVector |
|
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)