Class for AD7390, a 12 bit SPI driven external DAC from Analog Devices.

Dependencies:   mbed

Datasheet - http://www.analog.com/static/imported-files/data_sheets/AD7390_7391.pdf

Committer:
cassar10
Date:
Sat Apr 05 20:45:08 2014 +0000
Revision:
1:19818c103c9c
Parent:
0:82cd70f9fc3f
Child:
3:37ec9ea72264
All compiles with write and writeL added.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cassar10 0:82cd70f9fc3f 1 #ifndef __AD7390_H__
cassar10 0:82cd70f9fc3f 2 #define __AD7390_H__
cassar10 0:82cd70f9fc3f 3
cassar10 0:82cd70f9fc3f 4 #include "mbed.h"
cassar10 0:82cd70f9fc3f 5
cassar10 0:82cd70f9fc3f 6 class AD7390 { //Create an AD7390 instance
cassar10 0:82cd70f9fc3f 7 public:
cassar10 1:19818c103c9c 8 AD7390(PinName data, PinName clock, PinName resetpin, PinName latchpin, float RefV, unsigned int feq); //RefV set up for user reference voltage
cassar10 0:82cd70f9fc3f 9 void Reset();
cassar10 0:82cd70f9fc3f 10 void Latch();
cassar10 1:19818c103c9c 11 void Write(float Volts);
cassar10 1:19818c103c9c 12 void WriteL(float volts);
cassar10 1:19818c103c9c 13 float RefV;
cassar10 1:19818c103c9c 14 unsigned int freq;
cassar10 0:82cd70f9fc3f 15 private:
cassar10 0:82cd70f9fc3f 16 DigitalOut reset, latch;
cassar10 0:82cd70f9fc3f 17 SPI spi;
cassar10 0:82cd70f9fc3f 18
cassar10 0:82cd70f9fc3f 19 };
cassar10 0:82cd70f9fc3f 20 #endif