Introduction
The tcDspDacAd420 class is used to provide access to an Analog Devices AD420 digital-to-current loop converter via the MityDSP generic SPI interface. An instance of the tcDspSpi class, and an optional output latch selector and ID are provided in the constructor.
The AD420 is a single-channel 16-bit device. Data written to the device is loaded immediately.
- See also:
- MityDSP::tcDspSpi Class Reference
-
MityDSP::tcDspDacAd420 Class Reference
Example
This is a simple example of tcDspDacAd420 creation and usage:
{
unsigned int my_spi_base_addr = 0xB0000200;
int myLatchID = 9;
tcDspOutputLatch MyClass::myOutputLatch;
tcDspSpi *MyClass::mySpi;
tcDspDacAd420 *MyClass::myDac;
mySpi = new tcDspSpi((void *)my_spi_base_addr);
myDac = new tcDspDacAd420(mySpi, myOutputLatch, myLatchID);
for (i=0; i<100; i++)
{
myDac->update((unsigned short)(600 * i));
TSK_sleep(10);
}
:
}