MityDSP Documentation Index

MityDSP::tcDspAd56x5 Class Reference

Instances of this class handle access to a Analog Devices Ad56x5 digital-to-analog converter via the generic I2c interface for the MityDSP. More...

#include <core/DspAd56x5.h>

List of all members.

Public Types

enum  teLoadCommand { eeLoadNone = 0, eeLoadSingle = 1, eeLoadAll = 2 }
 

The teLoadCommand enumeration defines various options for loading one or more 56x5 devices on the I2C bus.

More...

Public Member Functions

 tcDspAd56x5 (tcDspI2c *apI2c, unsigned int anI2cAddr)
 This constructor is used to initialize an AD56x5 over the I2C interface.
 ~tcDspAd56x5 ()
 Default Destructor.
void set_vref_internal (bool aVrefOn)
 Enable or disable the internal voltage reference.
bool update (unsigned int anChannel, unsigned short anData, teLoadCommand aeLoad=eeLoadSingle)
 Updates the specified DAC channel with the provided 12-bit data.

Static Public Attributes

static const int gnDAC_CHANNEL_A = 0
 Constants for each of the 4 available channels on this device.
static const int gnDAC_CHANNEL_B = 1
static const int gnDAC_CHANNEL_C = 2
static const int gnDAC_CHANNEL_D = 3
static const int gnNUM_CHANNELS = 4

Protected Attributes

tcDspI2cmpI2C
 Access to the I2C bus.
unsigned int mnI2CAddress
 Device address on I2C bus.
unsigned short mnLastData [gnNUM_CHANNELS]
 Last data written to DAC.
SEM_Handle mhMutex

Detailed Description

Instances of this class handle access to a Analog Devices Ad56x5 digital-to-analog converter via the generic I2c interface for the MityDSP.

See also:
tcDspAd56x5 Page

Member Enumeration Documentation

The teLoadCommand enumeration defines various options for loading one or more 56x5 devices on the I2C bus.

Enumerator:
eeLoadNone 

don't load value into DAC

eeLoadSingle 

load value into current channel

eeLoadAll 

load all channels with their current data


Constructor & Destructor Documentation

tcDspAd56x5::tcDspAd56x5 ( tcDspI2c apI2C,
unsigned int  anI2cAddr 
)

This constructor is used to initialize an AD56x5 over the I2C interface.

Parameters:
[in] apI2C The tcDspI2c object to use for communication.
[in] anI2cAddr The address of the AD56x5 on the I2C bus.
tcDspAd56x5::~tcDspAd56x5 (  ) 

Default Destructor.


Member Function Documentation

void tcDspAd56x5::set_vref_internal ( bool  aVrefOn  ) 

Enable or disable the internal voltage reference.

Parameters:
[in] aVrefOn True to enable internal VREF. False to disable. Power-up state is disabled.
bool tcDspAd56x5::update ( unsigned int  anChannel,
unsigned short  anData,
teLoadCommand  aeLoad = eeLoadSingle 
)

Updates the specified DAC channel with the provided 12-bit data.

By default, the data is loaded to the DAC output immediately. However, the data can also be written and not loaded, or the data can be written and all DAC channels loaded (this supports simultaneously changing the values on all 4 channels).

Parameters:
[in] anChannel DAC channel to write (0-3).
[in] anData 12-bit data to load to specified DAC channel.
[in] aeLoad Specifies if and when data is loaded (eeLoadNone, eeLoadSingle, eeLoadAll).
Returns:
true if successful
See also:
DspDac8534.h

Member Data Documentation

const int MityDSP::tcDspAd56x5::gnDAC_CHANNEL_A = 0 [static]

Constants for each of the 4 available channels on this device.

const int MityDSP::tcDspAd56x5::gnDAC_CHANNEL_B = 1 [static]
const int MityDSP::tcDspAd56x5::gnDAC_CHANNEL_C = 2 [static]
const int MityDSP::tcDspAd56x5::gnDAC_CHANNEL_D = 3 [static]
const int MityDSP::tcDspAd56x5::gnNUM_CHANNELS = 4 [static]

Access to the I2C bus.

unsigned int MityDSP::tcDspAd56x5::mnI2CAddress [protected]

Device address on I2C bus.

unsigned short MityDSP::tcDspAd56x5::mnLastData[gnNUM_CHANNELS] [protected]

Last data written to DAC.

SEM_Handle MityDSP::tcDspAd56x5::mhMutex [protected]

  
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.