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:
Sun Apr 06 20:19:56 2014 +0000
Revision:
4:0c327b37ddc1
Parent:
3:37ec9ea72264
Child:
5:1ce3ec1e5f8b
Working, add SPI frequency to setup and class can be finished.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cassar10 0:82cd70f9fc3f 1 #include "mbed.h"
cassar10 2:8633e348822f 2 #include "AD7390.h"
cassar10 0:82cd70f9fc3f 3
cassar10 3:37ec9ea72264 4 SPI spi(p5,p6,p7);
cassar10 3:37ec9ea72264 5 AD7390 Test(spi,p10,p11);
cassar10 2:8633e348822f 6 DigitalOut Led(LED1);
cassar10 0:82cd70f9fc3f 7
cassar10 2:8633e348822f 8 int main(){
cassar10 3:37ec9ea72264 9 Test.Init();
cassar10 4:0c327b37ddc1 10 while (true){
cassar10 4:0c327b37ddc1 11 Test.Reset();
cassar10 4:0c327b37ddc1 12 Test.WriteL(2.5,3.3);
cassar10 2:8633e348822f 13 Led = 1;
cassar10 4:0c327b37ddc1 14 wait(5);
cassar10 4:0c327b37ddc1 15 Test.Reset();
cassar10 2:8633e348822f 16 Led = 0;
cassar10 4:0c327b37ddc1 17 Test.WriteL(1.5,3.3);
cassar10 2:8633e348822f 18 Led = 1;
cassar10 4:0c327b37ddc1 19 wait(5);
cassar10 2:8633e348822f 20 Led = 0;
cassar10 3:37ec9ea72264 21
cassar10 3:37ec9ea72264 22
cassar10 2:8633e348822f 23 }
cassar10 2:8633e348822f 24 }
cassar10 0:82cd70f9fc3f 25