MityDSP Documentation Index

MityDSP::tcDspPulseIntegrator Class Reference

The tcDspPulseIntegrator class is used to interface to the MityDSP pulse integrator core. More...

#include <core/DspPulseIntegrator.h>

List of all members.

Public Types

typedef void(* tfIsrCallback )(int, float)
 Prototype for the ISR callbacks.
typedef void(* tfIsrCallbackWithArg )(int, float, void *)

Public Member Functions

 tcDspPulseIntegrator (void *apBaseAddr, int anLevel=gnAutoLevel)
 This constructor is used to create an interface to the MityDSP Pulse Integrator core located at the specified base address.
 ~tcDspPulseIntegrator ()
 This destructor is used to close up and free tcDspPulseIntegrator resources.
void enableIntegrator (int anIntegrator, bool abState, bool fromISR=false)
 Enables or disables the specified integrator.
unsigned int getNumCycles (int anIntegrator)
 Gets the number of cycles over which the specified integrator will make measurements.
unsigned int setNumCycles (int anIntegrator, unsigned int anNewCycles)
 Sets the number of cycles over which the specified integrator will make measurements.
bool getInterruptEnable (int anIntegrator)
 Gets the state of the interrupt on measurement complete for the specified integrator.
void setInterruptEnable (int anIntegrator, bool abEnable)
 Sets the state of the measurement complete interrupt for the specified integrator.
bool getExtMeasEnable (int anIntegrator)
 Gets the state of the external Measurement Enable signal usage for the specified integrator.
void setExtMeasEnable (int anIntegrator, bool abState)
 Sets the state of the external Measurement Enable signal usage for the specified integrator.
void getOutputPulse (float &afTmeasUsec, float &afTpulseUsec)
 Gets the parameters of the output pulse generator.
void setOutputPulse (float afTmeasUsec, float afTpulseUsec)
 Sets the parameters of the output pulse generator.
bool getMeasurement (int anIntegrator, float &afMeasurementUsec)
 Attempts to get a measurement from the specified integrator.
void registerIsrHandler (int anIntegrator, tfIsrCallback afCallback)
 Registers the user-supplied callback to be run whenever the specified integrator's measurement complete interrupt occurs.
void registerIsrHandler (int anIntegrator, tfIsrCallbackWithArg afCallback, void *apUserArg=NULL)
 Registers the user-supplied callback to be run whenever the specified integrator's measurement complete 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 gnNumIntegrators = 4
 Four integrators per core.
static const unsigned int gnMaxCycles = 256
 Max integration cycles.

Detailed Description

The tcDspPulseIntegrator class is used to interface to the MityDSP pulse integrator core.

Up to 4 integrators may be used, which count the number of EMIF clocks that an external signal is asserted during a measurement period. This measurement period is determined by either an internally generated ouput pulse, or an externally provided measurement enable pulse. To average out jitter errors, the integration may occur over 1-256 measurement periods.

Interrupts may be enabled to signal when a measurement has been completed by any of the integrators.

See also:
tcDspPulseIntegrator Page

Member Typedef Documentation

typedef void(* MityDSP::tcDspPulseIntegrator::tfIsrCallback)(int, float)

Prototype for the ISR callbacks.

The callback is provided with the integrator number, and the measurement value (in usec, already divided by

typedef void(* MityDSP::tcDspPulseIntegrator::tfIsrCallbackWithArg)(int, float, void *)

Constructor & Destructor Documentation

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

This constructor is used to create an interface to the MityDSP Pulse Integrator core located at the specified base address.

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 Pulse Integrator core
[in] anLevel Optional interrupt level parameter
Returns:
None.
See also:
DspPulseIntegrator.h
DspIntDispatch.h
tcDspPulseIntegrator::~tcDspPulseIntegrator (  ) 

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

Returns:
None.
See also:
DspPulseIntegrator.h

Member Function Documentation

int tcDspPulseIntegrator::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 tcDspPulseIntegrator associated with this ISR.
Returns:
0
void tcDspPulseIntegrator::enableIntegrator ( int  anIntegrator,
bool  abState,
bool  fromISR = false 
)

Enables or disables the specified integrator.

Note:
Each integrator is enabled for a single measurement. Once the measurement is complete, the firmware disables the integrator. The software must re-enable the integrator to make another measurement.
Parameters:
[in] anIntegrator The integrator to enable/disable (0 - 3).
[in] abState True to enable integrator.
[in] fromISR True if called from ISR space (default: false).
Returns:
None.
See also:
DspPulseIntegrator.h
unsigned int tcDspPulseIntegrator::getNumCycles ( int  anIntegrator  ) 

Gets the number of cycles over which the specified integrator will make measurements.

Values may be 1-256.

Parameters:
[in] anIntegrator The integrator whose cycle count is requested.
Returns:
Cycle setting (1-256), or 0 if integrator not valid.
See also:
DspPulseIntegrator.h
unsigned int tcDspPulseIntegrator::setNumCycles ( int  anIntegrator,
unsigned int  anNewCycles 
)

Sets the number of cycles over which the specified integrator will make measurements.

Values may be 1-256 (values greater than 256 are truncated to 256).

Parameters:
[in] anIntegrator The integrator to update (0 - 3).
[in] anNewCycles The new cycle value (1 - 256).
Returns:
Actual number of cycles set, or 0 if integrator not valid.
See also:
DspPulseIntegrator.h
bool tcDspPulseIntegrator::getInterruptEnable ( int  anIntegrator  ) 

Gets the state of the interrupt on measurement complete for the specified integrator.

Parameters:
[in] anIntegrator The integrator whose interrupt state is being read (0 - 3).
Returns:
True if measurement interrupts are enabled, false otherwise.
See also:
DspPulseIntegrator.h
void tcDspPulseIntegrator::setInterruptEnable ( int  anIntegrator,
bool  abEnable 
)

Sets the state of the measurement complete interrupt for the specified integrator.

Parameters:
[in] anIntegrator The integrator whose interrupt state is being set (0 - 3).
[in] abEnable True to enable measurement interrupts.
Returns:
None.
See also:
DspPulseIntegrator.h
bool tcDspPulseIntegrator::getExtMeasEnable ( int  anIntegrator  ) 

Gets the state of the external Measurement Enable signal usage for the specified integrator.

Parameters:
[in] anIntegrator The integrator whose external measurement enable state is being read (0 - 3).
Returns:
True indicates that the specified integrator uses an external pulse to control measurement periods, otherwise False indicates that the internal output pulse generator is used.
See also:
DspPulseIntegrator.h
void tcDspPulseIntegrator::setExtMeasEnable ( int  anIntegrator,
bool  abState 
)

Sets the state of the external Measurement Enable signal usage for the specified integrator.

Setting the state to True indicates that the integrator should use the external measurement enable pulse to control measurement periods. Setting the state to False indicates that the internal output pulse generator should be used.

Parameters:
[in] anIntegrator The integrator whose external measurement enable state is being set (0 - 3).
[in] abState True to use the external Measurement Enable pulse, False to use the internal output pulse generator.
Returns:
None.
See also:
DspPulseIntegrator.h
void tcDspPulseIntegrator::getOutputPulse ( float &  afTmeasUsec,
float &  afTpulseUsec 
)

Gets the parameters of the output pulse generator.

The pulse is specified by a floating-point measurement time (in usec), as well as the total pulse period (also in usec).

Parameters:
[out] afTmeasUsec The output pulse measurement time (in usec)
[out] afTpulseUsec The output pulse total time (in usec)
Returns:
None.
See also:
DspPulseIntegrator.h
void tcDspPulseIntegrator::setOutputPulse ( float  afTmeasUsec,
float  afTpulseUsec 
)

Sets the parameters of the output pulse generator.

The pulse is specified by providing a floating-point measurement time (in usec), as well as the total pulse period (also in usec).

Note:
The pulse parameters are converted to the nearest number of EMIF clocks. If quantization is a concern to the application, getOutputPulse should be called to retrieve the actual settings that were computed.
Parameters:
[in] afTmeasUsec The output pulse measurement time (in usec)
[in] afTpulseUsec The output pulse total time (in usec)
Returns:
None.
See also:
DspPulseIntegrator.h
bool tcDspPulseIntegrator::getMeasurement ( int  anIntegrator,
float &  afMeasurementUsec 
)

Attempts to get a measurement from the specified integrator.

If no measurement is available, false is returned. If a measurement is ready, the return value is set to true, the result is converted from EMIF clocks to usec, and divided by the number of cycles integrated.

Parameters:
[in] anIntegrator The integrator to retrieve the measurement from.
[out] afMeasurementUsec The measurement (in usec), already divided by the number of cycles integrated.
Returns:
True if a measurement is available, False otherwise.
See also:
DspPulseIntegrator.h
void tcDspPulseIntegrator::registerIsrHandler ( int  anIntegrator,
tfIsrCallback  afCallback 
)

Registers the user-supplied callback to be run whenever the specified integrator's measurement complete 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] anIntegrator The integrator to install the callback for.
[in] afCallback Pointer to the callback routine (or NULL to disable callbacks.
Returns:
None.
See also:
DspPulseIntegrator.h
void tcDspPulseIntegrator::registerIsrHandler ( int  anIntegrator,
tfIsrCallbackWithArg  afCallback,
void *  apUserArg = NULL 
)

Registers the user-supplied callback to be run whenever the specified integrator's measurement complete 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] anIntegrator The integrator to install the callback for.
[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:
DspPulseIntegrator.h

Member Data Documentation

Four integrators per core.

const unsigned int MityDSP::tcDspPulseIntegrator::gnMaxCycles = 256 [static]

Max integration cycles.

ISR counter (debug).


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