MityDSP Documentation Index
tcDspDac8534

Introduction

The tcDspDac8534 class is used to provide access to a TI DAC8534 digital-to-analog converter via the MityDSP generic SPI interface. An instance of the tcDspSpi class, and the address of the device on the bus are provided in the constructor.

Up to 4 devices may be placed on the same SPI. Therefore, serializing access to each device, and management of the SPI FIFO, must be provided at a higher (application) level.

The TI DAC8534 supports 4 output channels. These outputs are written individually. By default, the data written is loaded immediately. However options exist to suppress loading the data to the DAC at the time it is written. Similarly, a command exists to write data to the specified channel, and then load all DAC channels simultaneously.

See also:
MityDSP::tcDspSpi Class Reference
MityDSP::tcDspDac8534 Class Reference

Example

This is a simple example of tcDspDac8534 creation and usage:

{
int i;
unsigned int my_base_addr = 0xB0000200;
tcDspSpi *MyClass::mySpi;
tcDspDac8534 *MyClass::myDac;
// create access to the SPI
mySpi = new tcDspSpi((void *)my_base_addr);
// create access to DAC on SPI address 2
myDac = new tcDspDac8534(mySpi, 2);
// load DAC "data"
for (i=0; i<mySpi->GetTxFIFODepth(); i++)
{
unsigned int chan = i % tcDspDac8534::gnNUM_CHANNELS;
unsigned short data = (unsigned short)i;
// write channels 0-2, then implement all when chan 3 is written
myDac->update(chan, data,
((chan == 3) ? tcDspDac8534::eeLoadAll :
tcDspDac8534::eeLoadNone));
}
:
}

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