Instances of this class handle. More...
#include <core/DspAdcBase.h>
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. |
Instances of this class handle.
typedef void(* MityDSP::tcDspAdcBase::tfIsrCallback)(tcDspAdcBase *) |
prototype for the ISR callbacks.
typedef void(* MityDSP::tcDspAdcBase::tfIsrCallbackWithArg)(tcDspAdcBase *, void *) |
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.
[in] | apAddress | Base Address of ADC core |
[in] | anLevel | The interrupt vector used by the core (default: gnAutoLevel). |
tcDspAdcBase::~tcDspAdcBase | ( | ) |
This destructor is used to close up and free the resources tied to the associated ADC interface.
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.
ahMyObject | The "this->" pointer for the instance of tcDspAdcBase associated with this ISR. |
void tcDspAdcBase::SetPack | ( | bool | abPackFIFO | ) | [virtual] |
Sets whether the ADC data should be packed two samples per 32 bit FIFO word.
[in] | abPackFIFO | When true two word packing is enabled. |
Reimplemented in MityDSP::tcDspAdc9235.
void tcDspAdcBase::SetFlipBit | ( | bool | abFlipBit | ) | [virtual] |
Sets whether the ADC data should flip the most significant bit.
[in] | abFlipBit | When true two's complementing is enabled. |
void tcDspAdcBase::SetUDClear | ( | bool | abUDClear | ) | [virtual] |
Sets whether the user data sent to the ADC should be masked with zeros.
[in] | abUDClear | When true masking is enabled. |
void tcDspAdcBase::SetExtTrigger | ( | bool | abExtTrigger | ) | [virtual] |
Sets trigger mode of device.
[in] | abExtTrigger | When true capture logic starts on rising edge of externally provided trigger (and enable). Otherwise, capture logic starts immediately on software enable. |
void tcDspAdcBase::SetBurstCapture | ( | bool | abBurstCapture | ) | [virtual] |
Sets capture mode of device.
[in] | abBurstCapture | When true burst capture logic is enabled. When false continuous capture logic is enabled. |
void tcDspAdcBase::SetCaptureDelay | ( | unsigned short | Delay | ) | [virtual] |
Sets burst capture delay of device.
[in] | Delay | The number of samples minus 1 that will be delayed following a trigger event prior to capturing when in burst capture mode. |
void tcDspAdcBase::SetCaptureLength | ( | unsigned short | Length | ) | [virtual] |
Sets burst capture quantity.
[in] | Length | The number of samples to capture in burst capture mode. |
Reimplemented in MityDSP::tcDspAdc9235.
void tcDspAdcBase::SetSaturationMode | ( | bool | abEnable | ) | [virtual] |
Sets saturation mode.
[in] | abEnable | Boolean indicating whether saturation mode should be enabled. |
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.
[in] | abEnable | Boolean indicating whether differential mode should be enabled. |
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 |
[in] | anMask | The desired CHM bit settings (gnCHx_MASKs Or'd together in any combination). |
bool tcDspAdcBase::GetPack | ( | void | ) | [virtual] |
bool tcDspAdcBase::GetFlipBit | ( | void | ) | [virtual] |
bool tcDspAdcBase::GetUDClear | ( | void | ) | [virtual] |
bool tcDspAdcBase::GetExtTrigger | ( | void | ) | [virtual] |
bool tcDspAdcBase::GetBurstCapture | ( | void | ) | [virtual] |
unsigned short tcDspAdcBase::GetCaptureDelay | ( | void | ) | [virtual] |
Gets Capture Delay Length (minus 1).
unsigned short tcDspAdcBase::GetCaptureLength | ( | void | ) | [virtual] |
bool tcDspAdcBase::GetSaturationMode | ( | void | ) | [virtual] |
bool tcDspAdcBase::GetDifferentialMode | ( | void | ) | [virtual] |
unsigned int tcDspAdcBase::GetChannelMask | ( | void | ) | [virtual] |
void tcDspAdcBase::Enable | ( | bool | abEnable | ) | [virtual] |
Enables the capture enginer for the ADC.
[in] | abEnable | When true, capture is enabled. |
bool tcDspAdcBase::IsEnabled | ( | void | ) | [virtual] |
Returns the enabled state of the capture engine.
bool tcDspAdcBase::GetFIFOLevel | ( | teFIFOLevel | level | ) | [virtual] |
Gets FIFO Level flag.
[in] | level | The level to check |
unsigned short tcDspAdcBase::GetFIFOLevel | ( | void | ) | [virtual] |
Gets FIFO Level.
bool tcDspAdcBase::IsBurstComplete | ( | void | ) | [virtual] |
Gets Burst Complete flag.
void tcDspAdcBase::ClearBurstComplete | ( | void | ) | [virtual] |
Clears Burst Complete flag.
void tcDspAdcBase::DisableFIFOInterrupts | ( | void | ) | [virtual] |
Clears Any Set FIFO Interrupt Enables.
void tcDspAdcBase::SetFIFOInterruptLevel | ( | teFIFOLevel | aeLevel | ) | [virtual] |
Sets the FIFO interrupt based on the level specified.
[in] | aeLevel | The desired FIFO level interrupt. |
void tcDspAdcBase::SetBCInterrupt | ( | bool | abEnable | ) | [virtual] |
Sets the Burst Complete Interrupt Enable Flag based on the Enable Flag.
[in] | abEnable | When true, enable burst complete interrupt |
void tcDspAdcBase::RegisterFIFOHandler | ( | teFIFOLevel | aeLevel, | |
tfIsrCallback | afCallback | |||
) | [virtual] |
Registers the specified ISR callback for the given FIFO level interrupt.
[in] | aeLevel | The desired FIFO level interrupt. |
[in] | afCallback | The callback to associate with the interrupt (or NULL for none). |
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.
[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. |
void tcDspAdcBase::RegisterBCHandler | ( | tfIsrCallback | afCallback | ) | [virtual] |
Registers the specified ISR callback for the burst complete interrupt.
[in] | afCallback | The callback to associate with the interrupt (or NULL for none). |
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.
[in] | afCallback | The callback to associate with the interrupt (or NULL for none). |
[in] | apUserArg | An argument to be supplied with the callback. |
unsigned int * tcDspAdcBase::GetFIFODataPtr | ( | void | ) | [virtual] |
Returns the pointer to the FIFO containing captured ADC data.
unsigned int tcDspAdcBase::GetFIFODepth | ( | void | ) | [virtual] |
Returns the depth (in 32 bit words) of the FIFO.
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.
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.
unsigned int MityDSP::tcDspAdcBase::mnInterruptCount |
ISR counter (debug).
tfIsrCallback MityDSP::tcDspAdcBase::mfOneQCallback [protected] |
void* MityDSP::tcDspAdcBase::mpOneQUserArg [protected] |
tfIsrCallback MityDSP::tcDspAdcBase::mfHalfCallback [protected] |
void* MityDSP::tcDspAdcBase::mpHalfUserArg [protected] |
tfIsrCallback MityDSP::tcDspAdcBase::mfThreeQCallback [protected] |
void* MityDSP::tcDspAdcBase::mpThreeQUserArg [protected] |
tfIsrCallback MityDSP::tcDspAdcBase::mfFullCallback [protected] |
void* MityDSP::tcDspAdcBase::mpFullUserArg [protected] |
tfIsrCallback MityDSP::tcDspAdcBase::mfBurstCallback [protected] |
void* MityDSP::tcDspAdcBase::mpBurstUserArg [protected] |
bool MityDSP::tcDspAdcBase::mbHasUDClear [protected] |
bool MityDSP::tcDspAdcBase::mbHasFlipBit [protected] |
bool MityDSP::tcDspAdcBase::mbHasSaturationMode [protected] |
bool MityDSP::tcDspAdcBase::mbHasDifferentialMode [protected] |
bool MityDSP::tcDspAdcBase::mbHasChannelMask [protected] |
bool MityDSP::tcDspAdcBase::mbHasPackFIFO [protected] |
bool MityDSP::tcDspAdcBase::mbHasExtTrigger [protected] |
bool MityDSP::tcDspAdcBase::mbHasBurstCapture [protected] |
bool MityDSP::tcDspAdcBase::mbHasCaptureDelay [protected] |
bool MityDSP::tcDspAdcBase::mbHasCaptureLength [protected] |
volatile unsigned int* MityDSP::tcDspAdcBase::mpBaseAddr [protected] |
unsigned short MityDSP::tcDspAdcBase::mnMyIntMask [protected] |
core interrupt mask.
int MityDSP::tcDspAdcBase::mnMyIntLevel [protected] |
core interrupt level.
int MityDSP::tcDspAdcBase::mnMyIntVector [protected] |
core interrupt vector.