MityDSP Documentation Index

MityDSP::tcDspAdcBase Class Reference

Instances of this class handle. More...

#include <core/DspAdcBase.h>

Inheritance diagram for MityDSP::tcDspAdcBase:
MityDSP::tcDspAdc776XBase MityDSP::tcDspAdc8329 MityDSP::tcDspAdc8343 MityDSP::tcDspAdc8402 MityDSP::tcDspAdc9235 MityDSP::tcDspAdc776X

List of all members.

Public Types

typedef void(* tfIsrCallback )(tcDspAdcBase *)
 prototype for the ISR callbacks.
typedef void(* tfIsrCallbackWithArg )(tcDspAdcBase *, void *)

Public Member Functions

 tcDspAdcBase (void *apAddress, int anLevel=gnAutoLevel)
 This constructor is used to open a DspAdc interface with the specified settings (optional).
 ~tcDspAdcBase ()
 This destructor is used to close up and free the resources tied to the associated ADC interface.
virtual void SetPack (bool abPackFIFO)
 Sets whether the ADC data should be packed two samples per 32 bit FIFO word.
virtual void SetFlipBit (bool abFlipBit)
 Sets whether the ADC data should flip the most significant bit.
virtual void SetUDClear (bool abABClear)
 Sets whether the user data sent to the ADC should be masked with zeros.
virtual void SetExtTrigger (bool abTrigger)
 Sets trigger mode of device.
virtual void SetBurstCapture (bool abBurstCapture)
 Sets capture mode of device.
virtual void SetCaptureDelay (unsigned short Delay)
 Sets burst capture delay of device.
virtual void SetCaptureLength (unsigned short Length)
 Sets burst capture quantity.
virtual void SetSaturationMode (bool abEnable)
 Sets saturation mode.
virtual void SetDifferentialMode (bool abEnable)
 Sets differential mode.
virtual void SetChannelMask (unsigned int anMask)
 Sets the channel mask bits.
virtual bool GetPack (void)
 Gets packing mode.
virtual bool GetFlipBit (void)
 Gets Flip Bit Mode.
virtual bool GetUDClear (void)
 Gets User Data Clearing Mode.
virtual bool GetExtTrigger (void)
 Gets External Trigger Mode.
virtual bool GetBurstCapture (void)
 Gets Capture Mode.
virtual unsigned short GetCaptureDelay (void)
 Gets Capture Delay Length (minus 1).
virtual unsigned short GetCaptureLength (void)
 Gets Capture Length.
virtual bool GetSaturationMode (void)
 Returns the saturation mode.
virtual bool GetDifferentialMode (void)
 Returns the differential mode.
virtual unsigned int GetChannelMask (void)
 Returns the channel mask.
virtual void Enable (bool abEnable)
 Enables the capture enginer for the ADC.
virtual bool IsEnabled (void)
 Returns the enabled state of the capture engine.
virtual bool GetFIFOLevel (teFIFOLevel level)
 Gets FIFO Level flag.
virtual unsigned short GetFIFOLevel (void)
 Gets FIFO Level.
virtual bool IsBurstComplete (void)
 Gets Burst Complete flag.
virtual void ClearBurstComplete (void)
 Clears Burst Complete flag.
virtual void DisableFIFOInterrupts (void)
 Clears Any Set FIFO Interrupt Enables.
virtual void SetFIFOInterruptLevel (teFIFOLevel aeLevel)
 Sets the FIFO interrupt based on the level specified.
virtual void SetBCInterrupt (bool Enable)
 Sets the Burst Complete Interrupt Enable Flag based on the Enable Flag.
virtual void RegisterFIFOHandler (teFIFOLevel aeLevel, tfIsrCallback afCallback)
 Registers the specified ISR callback for the given FIFO level interrupt.
virtual void RegisterFIFOHandler (teFIFOLevel aeLevel, tfIsrCallbackWithArg afCallback, void *apUserArg=NULL)
 Registers the specified ISR callback for the given FIFO level interrupt.
virtual void RegisterBCHandler (tfIsrCallback afCallback)
 Registers the specified ISR callback for the burst complete interrupt.
virtual void RegisterBCHandler (tfIsrCallbackWithArg afCallback, void *apUserArg=NULL)
 Registers the specified ISR callback for the burst complete interrupt.
virtual unsigned int * GetFIFODataPtr (void)
 Returns the pointer to the FIFO containing captured ADC data.
virtual unsigned int GetFIFODepth (void)
 Returns the depth (in 32 bit words) of the FIFO.
virtual bool DrainFIFO (void)
 This routine will drain the FIFO on the engine.

Static Public Member Functions

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

Public Attributes

unsigned int mnInterruptCount
 ISR counter (debug).

Protected Member Functions

virtual void adcInterrupt (void)
 Interrupt service routine for the ADC cores.

Protected Attributes

tfIsrCallback mfOneQCallback
tfIsrCallbackWithArg mfOneQCallbackWithArg
void * mpOneQUserArg
tfIsrCallback mfHalfCallback
tfIsrCallbackWithArg mfHalfCallbackWithArg
void * mpHalfUserArg
tfIsrCallback mfThreeQCallback
tfIsrCallbackWithArg mfThreeQCallbackWithArg
void * mpThreeQUserArg
tfIsrCallback mfFullCallback
tfIsrCallbackWithArg mfFullCallbackWithArg
void * mpFullUserArg
tfIsrCallback mfBurstCallback
tfIsrCallbackWithArg mfBurstCallbackWithArg
void * mpBurstUserArg
bool mbHasUDClear
bool mbHasFlipBit
bool mbHasSaturationMode
bool mbHasDifferentialMode
bool mbHasChannelMask
bool mbHasPackFIFO
bool mbHasExtTrigger
bool mbHasBurstCapture
bool mbHasCaptureDelay
bool mbHasCaptureLength
volatile unsigned int * mpBaseAddr
unsigned short mnMyIntMask
 core interrupt mask.
int mnMyIntLevel
 core interrupt level.
int mnMyIntVector
 core interrupt vector.

Detailed Description

Instances of this class handle.

See also:
tcDspAdcBase Page

Member Typedef Documentation

prototype for the ISR callbacks.


Constructor & Destructor Documentation

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

This constructor is used to open a DspAdc interface with the specified settings (optional).

The interface is not yet enabled for capture following construction.

Parameters:
[in] apAddress Base Address of ADC core
[in] anLevel The interrupt vector used by the core (default: gnAutoLevel).
Returns:
None.
See also:
DspAdcBase.h
tcDspAdcBase::~tcDspAdcBase (  ) 

This destructor is used to close up and free the resources tied to the associated ADC interface.

Returns:
None.
See also:
DspAdcBase.h

Member Function Documentation

int tcDspAdcBase::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:
ahMyObject The "this->" pointer for the instance of tcDspAdcBase associated with this ISR.
Returns:
0
void tcDspAdcBase::SetPack ( bool  abPackFIFO  )  [virtual]

Sets whether the ADC data should be packed two samples per 32 bit FIFO word.

Parameters:
[in] abPackFIFO When true two word packing is enabled.
Returns:
None.
See also:
DspAdcBase.h

Reimplemented in MityDSP::tcDspAdc9235.

void tcDspAdcBase::SetFlipBit ( bool  abFlipBit  )  [virtual]

Sets whether the ADC data should flip the most significant bit.

Parameters:
[in] abFlipBit When true two's complementing is enabled.
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::SetUDClear ( bool  abUDClear  )  [virtual]

Sets whether the user data sent to the ADC should be masked with zeros.

Parameters:
[in] abUDClear When true masking is enabled.
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::SetExtTrigger ( bool  abExtTrigger  )  [virtual]

Sets trigger mode of device.

Parameters:
[in] abExtTrigger When true capture logic starts on rising edge of externally provided trigger (and enable). Otherwise, capture logic starts immediately on software enable.
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::SetBurstCapture ( bool  abBurstCapture  )  [virtual]

Sets capture mode of device.

Parameters:
[in] abBurstCapture When true burst capture logic is enabled. When false continuous capture logic is enabled.
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::SetCaptureDelay ( unsigned short  Delay  )  [virtual]

Sets burst capture delay of device.

Parameters:
[in] Delay The number of samples minus 1 that will be delayed following a trigger event prior to capturing when in burst capture mode.
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::SetCaptureLength ( unsigned short  Length  )  [virtual]

Sets burst capture quantity.

Parameters:
[in] Length The number of samples to capture in burst capture mode.
Returns:
None.
Note:
When in packed mode, the length typically refers to the number of pairs of samples. For some devices, this may not be the case and it may be necessary to supply an even length when in packed mode. Check your particular device to be sure.
See also:
DspAdcBase.h

Reimplemented in MityDSP::tcDspAdc9235.

void tcDspAdcBase::SetSaturationMode ( bool  abEnable  )  [virtual]

Sets saturation mode.

Parameters:
[in] abEnable Boolean indicating whether saturation mode should be enabled.
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::SetDifferentialMode ( bool  abEnable  )  [virtual]

Sets differential mode.

If enabled, captures on adjacent channels are assumed to be differential and are combined together appropriately.

Parameters:
[in] abEnable Boolean indicating whether differential mode should be enabled.
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::SetChannelMask ( unsigned int  anMask  )  [virtual]

Sets the channel mask bits.

These bits determine which ADC channels are enabled in round-robin mode. The results are also modified by the DIF bit as follows:

CHM bits

DIF=0

DIF=1

gnCH0_MASK

ch0 - COM

ch0 - ch1

gnCH1_MASK

ch1 - COM

ch1 - ch0

gnCH2_MASK

ch2 - COM

ch2 - ch3

gnCH3_MASK

ch3 - COM

ch3 - ch2

gnCH4_MASK

ch4 - COM

ch4 - ch5

gnCH5_MASK

ch5 - COM

ch5 - ch4

gnCH6_MASK

ch6 - COM

ch6 - ch7

gnCH7_MASK

ch7 - COM

ch7 - ch6

Parameters:
[in] anMask The desired CHM bit settings (gnCHx_MASKs Or'd together in any combination).
Returns:
None.
See also:
DspAdcBase.h
bool tcDspAdcBase::GetPack ( void   )  [virtual]

Gets packing mode.

Returns:
true if packing is enabled.
See also:
DspAdcBase.h
bool tcDspAdcBase::GetFlipBit ( void   )  [virtual]

Gets Flip Bit Mode.

Returns:
true if complement is enabled.
See also:
DspAdcBase.h
bool tcDspAdcBase::GetUDClear ( void   )  [virtual]

Gets User Data Clearing Mode.

Returns:
true if clearing is enabled.
See also:
DspAdcBase.h
bool tcDspAdcBase::GetExtTrigger ( void   )  [virtual]

Gets External Trigger Mode.

Returns:
true if external triggering is enabled.
See also:
DspAdcBase.h
bool tcDspAdcBase::GetBurstCapture ( void   )  [virtual]

Gets Capture Mode.

Returns:
true if burst capture mode is enabled.
See also:
DspAdcBase.h
unsigned short tcDspAdcBase::GetCaptureDelay ( void   )  [virtual]

Gets Capture Delay Length (minus 1).

Returns:
number of samples minus 1 that will be delayed in burst mode.
See also:
DspAdcBase.h
unsigned short tcDspAdcBase::GetCaptureLength ( void   )  [virtual]

Gets Capture Length.

Returns:
number of samples will be captured in a burst.
See also:
DspAdcBase.h
bool tcDspAdcBase::GetSaturationMode ( void   )  [virtual]

Returns the saturation mode.

Returns:
true if saturation mode is enabled.
See also:
DspAdcBase.h
bool tcDspAdcBase::GetDifferentialMode ( void   )  [virtual]

Returns the differential mode.

Returns:
true if differential mode is enabled.
See also:
DspAdcBase.h
unsigned int tcDspAdcBase::GetChannelMask ( void   )  [virtual]

Returns the channel mask.

Returns:
the current channel mask.
See also:
DspAdcBase.h
void tcDspAdcBase::Enable ( bool  abEnable  )  [virtual]

Enables the capture enginer for the ADC.

Parameters:
[in] abEnable When true, capture is enabled.
Returns:
none.
See also:
DspAdcBase.h
bool tcDspAdcBase::IsEnabled ( void   )  [virtual]

Returns the enabled state of the capture engine.

Returns:
the pointer (this is a 32 bit word)
See also:
DspAdcBase.h
bool tcDspAdcBase::GetFIFOLevel ( teFIFOLevel  level  )  [virtual]

Gets FIFO Level flag.

Parameters:
[in] level The level to check
Returns:
true if the level is set
See also:
DspAdcBase.h
unsigned short tcDspAdcBase::GetFIFOLevel ( void   )  [virtual]

Gets FIFO Level.

Returns:
the number of 32 bit words that can be read from the FIFO
See also:
DspAdcBase.h
bool tcDspAdcBase::IsBurstComplete ( void   )  [virtual]

Gets Burst Complete flag.

Returns:
true if a burst has completed since the last time it was cleared
See also:
DspAdcBase.h
void tcDspAdcBase::ClearBurstComplete ( void   )  [virtual]

Clears Burst Complete flag.

See also:
DspAdcBase.h
void tcDspAdcBase::DisableFIFOInterrupts ( void   )  [virtual]

Clears Any Set FIFO Interrupt Enables.

See also:
DspAdcBase.h
void tcDspAdcBase::SetFIFOInterruptLevel ( teFIFOLevel  aeLevel  )  [virtual]

Sets the FIFO interrupt based on the level specified.

Parameters:
[in] aeLevel The desired FIFO level interrupt.
See also:
DspAdcBase.h
Note:
eeEmpty is not a valid level for interrupts
To disable interrupts, call DisableFIFOInterrups()
void tcDspAdcBase::SetBCInterrupt ( bool  abEnable  )  [virtual]

Sets the Burst Complete Interrupt Enable Flag based on the Enable Flag.

Parameters:
[in] abEnable When true, enable burst complete interrupt
See also:
DspAdcBase.h
void tcDspAdcBase::RegisterFIFOHandler ( teFIFOLevel  aeLevel,
tfIsrCallback  afCallback 
) [virtual]

Registers the specified ISR callback for the given FIFO level interrupt.

Parameters:
[in] aeLevel The desired FIFO level interrupt.
[in] afCallback The callback to associate with the interrupt (or NULL for none).
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::RegisterFIFOHandler ( teFIFOLevel  aeLevel,
tfIsrCallbackWithArg  afCallback,
void *  apUserArg = NULL 
) [virtual]

Registers the specified ISR callback for the given FIFO level interrupt.

This version registers a callback with a user-supplied argument.

Parameters:
[in] aeLevel The desired FIFO level interrupt.
[in] afCallback The callback to associate with the interrupt (or NULL for none).
[in] apUserArg An argument to be supplied with the callback.
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::RegisterBCHandler ( tfIsrCallback  afCallback  )  [virtual]

Registers the specified ISR callback for the burst complete interrupt.

Parameters:
[in] afCallback The callback to associate with the interrupt (or NULL for none).
Returns:
None.
See also:
DspAdcBase.h
void tcDspAdcBase::RegisterBCHandler ( tfIsrCallbackWithArg  afCallback,
void *  apUserArg = NULL 
) [virtual]

Registers the specified ISR callback for the burst complete interrupt.

This version registers a callback with a user-supplied argument.

Parameters:
[in] afCallback The callback to associate with the interrupt (or NULL for none).
[in] apUserArg An argument to be supplied with the callback.
Returns:
None.
See also:
DspAdcBase.h
unsigned int * tcDspAdcBase::GetFIFODataPtr ( void   )  [virtual]

Returns the pointer to the FIFO containing captured ADC data.

Returns:
the pointer (this is a 32 bit word)
See also:
DspAdcBase.h
unsigned int tcDspAdcBase::GetFIFODepth ( void   )  [virtual]

Returns the depth (in 32 bit words) of the FIFO.

Returns:
the depth in 32 bit words of the FIFO.
See also:
DspAdcBase.h
bool tcDspAdcBase::DrainFIFO ( void   )  [virtual]

This routine will drain the FIFO on the engine.

It is useful when a clearing operation is require or after initialization.

Returns:
true if operation completed successfully.
See also:
DspAdcBase.h
void tcDspAdcBase::adcInterrupt ( void   )  [protected, virtual]

Interrupt service routine for the ADC cores.

The ISR reads and clears any pending interrupts. If any of the pending interrupts 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.


Member Data Documentation

ISR counter (debug).

volatile unsigned int* MityDSP::tcDspAdcBase::mpBaseAddr [protected]
unsigned short MityDSP::tcDspAdcBase::mnMyIntMask [protected]

core interrupt mask.

core interrupt level.

core interrupt vector.


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