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

Instances of this class handle configuring, and enabling the MityDSP Dual Arbitrary Waveform Generator core I/O interface. More...

#include <core/DspAwgDual.h>

List of all members.

Classes

union  tuSampleData
 Definition of sample data holding area. More...

Public Types

enum  teDegOrRad { eeDegrees, eeRadians }
 Enumeration to specify inputs in degrees vs. radians. More...
enum  teWaveform { eeA, eeB }
 Enumeration to specify the A or B waveform. More...

Public Member Functions

 tcDspAwgDual (void *apAddress)
 This constructor is used to open a AWG core instance.
 ~tcDspAwgDual ()
 Default destructor.
void Enable (bool abEnable, teWaveform aeAorB)
 Enable the AWG Core (output waveform on next clock if internally triggered, or next clock after external trigger).
void SetExtTrigger (bool abExtTrigger, teWaveform aeAorB)
 Configure AWG Trigger Mode.
void SetPhase (unsigned int anPhase, teWaveform aeAorB)
 Configure AWG starting phase.
void SetPhase (double afValue, teDegOrRad aeUnits, teWaveform aeAorB)
 Configure AWG starting phase.
void SetPhaseIncrement (unsigned int anPhaseInc, teWaveform aeAorB)
 Set the AWG phase increment.
void SetPhaseIncrement (double afValue, teDegOrRad aeUnits, teWaveform aeAorB)
 Set the AWG phase increment.
int SetWaveformSamples (unsigned short *apValues, int anNumValues, int anStartIndex=0, bool abImplementNow=true)
 Update the working copy of the AWG waveform sample table.
void SetWaveformSin (unsigned short anHalfAmplitude=0x7FFF)
 Configure AWG waveform memory for sin wave output.
bool IsEnabled (teWaveform aeAorB)
 Check if AWG Core is enabled.
bool IsExtTriggered (teWaveform aeAorB)
 Check if AWG Core is configured for external trigger operation.
unsigned int GetPhase (teWaveform aeAorB)
 Read back the current 24-bit phase value.
unsigned int GetPhaseIncrement (teWaveform aeAorB)
 Read back the current phase increment value.

Static Public Attributes

static const int gnNumSamples = 512
 Number of waveform samples supported.
static const int gnPhaseAccumulatorSize = 0x01000000
 Number of possible phase values.

Protected Member Functions

void CopyWaveform (void)
 Internal routine to copy the working waveform table to the FPGA core.

Protected Attributes

SEM_Handle mhMutex
volatile unsigned int * mpBaseAddr
 Mutex to serialize access.
tuSampleData maSamples [gnNumSamples]
 AWG Core base address.

Detailed Description

Instances of this class handle configuring, and enabling the MityDSP Dual Arbitrary Waveform Generator core I/O interface.

Each AWG Core provides 512 16-bit samples (linearly interpolated) to define a waveform, and a a pair of 24-bit phase accumulators and programmable increments to define the frequencies.

See also:
tcDspAwgDual Page

Member Enumeration Documentation

Enumeration to specify inputs in degrees vs. radians.

Enumerator:
eeDegrees 
eeRadians 

Enumeration to specify the A or B waveform.

Enumerator:
eeA 
eeB 

Constructor & Destructor Documentation

tcDspAwgDual::tcDspAwgDual ( void *  apAddress)

This constructor is used to open a AWG core instance.

The base address of the FPGA core must be provided.

Parameters:
[in]apAddressThe base address of the AWG core.
Returns:
None.
See also:
DspAwgDual.h
tcDspAwgDual::~tcDspAwgDual ( )

Default destructor.


Member Function Documentation

void tcDspAwgDual::Enable ( bool  abEnable,
teWaveform  aeAorB 
)

Enable the AWG Core (output waveform on next clock if internally triggered, or next clock after external trigger).

Parameters:
[in]abEnableWhen true, waveform generation is enabled.
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
None.
void tcDspAwgDual::SetExtTrigger ( bool  abExtTrigger,
teWaveform  aeAorB 
)

Configure AWG Trigger Mode.

Parameters:
[in]abExtTriggerWhen true, the core will be configured to start generating pulses when a rising edge is seen on the provided external trigger port of the core. When false, the core will generate pulses immediately (given it is enabled).
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
None.
void tcDspAwgDual::SetPhase ( unsigned int  anPhase,
teWaveform  aeAorB 
)

Configure AWG starting phase.

It is not recommended that this value be updated while the AWG is enabled.

Parameters:
[in]anPhaseThe initial phase, as a 24-bit integer.
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
None.
void tcDspAwgDual::SetPhase ( double  afValue,
teDegOrRad  aeUnits,
teWaveform  aeAorB 
)

Configure AWG starting phase.

It is not recommended that this value be updated while the AWG is enabled.

Parameters:
[in]afValueThe initial phase, as double precision float.
[in]aeUnitsIndicates whether phase is in degrees (eeDegrees) or radians (eeRadians)
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
None.
void tcDspAwgDual::SetPhaseIncrement ( unsigned int  anPhaseInc,
teWaveform  aeAorB 
)

Set the AWG phase increment.

This is the number of counts that the 24-bit phase register is incremented each clock cycle. The waveform value output is linearly interpolated from the surrounding values in the sample table.

Parameters:
[in]anPhaseIncThe phase increment, as a 24-bit integer.
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
None.
void tcDspAwgDual::SetPhaseIncrement ( double  afValue,
teDegOrRad  aeUnits,
teWaveform  aeAorB 
)

Set the AWG phase increment.

This is the number of counts that the 24-bit phase register is incremented each clock cycle. The waveform value output is linearly interpolated from the surrounding values in the sample table.

Parameters:
[in]afValueThe phase increment, as a 24-bit integer.
[in]aeUnitsIndicates whether phase increment is in degrees (eeDegrees) or radians (eeRadians).
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
None.
int tcDspAwgDual::SetWaveformSamples ( unsigned short *  apValues,
int  anNumValues,
int  anStartIndex = 0,
bool  abImplementNow = true 
)

Update the working copy of the AWG waveform sample table.

This table consists of 512 16-bit amplitude samples uniformly distributed across 360-degrees of phase. The number of samples to be provided, and (optionally) the starting index in the sample table are provided. A boolean indicates whether or not the working table should be loaded to the FPGA following the update.

Note:
The application need only provide the 512 16-bit samples. Offsetting and repeating the values as required for the FPGA is handled internally.
For a discontinuous waveform, 513 samples may be provided. The last data point becomes the "next" sample for the 512th entry in the waveform table. Discontinuous waveforms cannot be defined in sections.
Parameters:
[in]apValuesPointer to an array of 16-bit sample values.
[in]anNumValuesNumber of values provided (0-512).
[in]anStartIndexStarting index in the sample table (0-511, default:0).
[in]abImplementNowIndicates whether or not working table should be copied to AWG (default: true).
Returns:
Number of samples actually written.
void tcDspAwgDual::SetWaveformSin ( unsigned short  anHalfAmplitude = 0x7FFF)

Configure AWG waveform memory for sin wave output.

The output is scaled to be centered at 1/2 the full scale output of the AWG.

Parameters:
[in]anHalfAmplitudeNumber of LSB's for 1/2 amplitude. Maximum value should be 0x7FFF.
Returns:
None.
bool tcDspAwgDual::IsEnabled ( teWaveform  aeAorB)

Check if AWG Core is enabled.

Parameters:
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
true if the core is enabled.
bool tcDspAwgDual::IsExtTriggered ( teWaveform  aeAorB)

Check if AWG Core is configured for external trigger operation.

Parameters:
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
true if the core triggering is from external source.
unsigned int tcDspAwgDual::GetPhase ( teWaveform  aeAorB)

Read back the current 24-bit phase value.

Parameters:
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
The 24-bit phase value.
unsigned int tcDspAwgDual::GetPhaseIncrement ( teWaveform  aeAorB)

Read back the current phase increment value.

Parameters:
[in]aeAorBeeA for the A waveform, eeB for the B waveform.
Returns:
The current 24-bit phase increment per clock.
void tcDspAwgDual::CopyWaveform ( void  )
protected

Internal routine to copy the working waveform table to the FPGA core.

Note:
Currently, no support for a partial table load. The working table may be loaded in pieces, but sending the working table to the FPGA is always done in its entirety.
Returns:
None.

Member Data Documentation

const int MityDSP::tcDspAwgDual::gnNumSamples = 512
static

Number of waveform samples supported.

const int MityDSP::tcDspAwgDual::gnPhaseAccumulatorSize = 0x01000000
static

Number of possible phase values.

SEM_Handle MityDSP::tcDspAwgDual::mhMutex
protected
volatile unsigned int* MityDSP::tcDspAwgDual::mpBaseAddr
protected

Mutex to serialize access.

tuSampleData MityDSP::tcDspAwgDual::maSamples[gnNumSamples]
protected

AWG Core base address.


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