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:07:38 2014 +0000
Revision:
3:37ec9ea72264
Parent:
2:8633e348822f
Child:
4:0c327b37ddc1
Appears to be working now!

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 2:8633e348822f 10 Led = 1;
cassar10 3:37ec9ea72264 11 wait(1);
cassar10 3:37ec9ea72264 12 Test.Latch();
cassar10 2:8633e348822f 13 Led = 0;
cassar10 3:37ec9ea72264 14 wait (1);
cassar10 3:37ec9ea72264 15 while (true){
cassar10 3:37ec9ea72264 16
cassar10 3:37ec9ea72264 17 Test.Init();
cassar10 2:8633e348822f 18 Led = 1;
cassar10 3:37ec9ea72264 19 wait(1);
cassar10 2:8633e348822f 20 Led = 0;
cassar10 3:37ec9ea72264 21 wait(1);
cassar10 3:37ec9ea72264 22
cassar10 3:37ec9ea72264 23
cassar10 2:8633e348822f 24 }
cassar10 2:8633e348822f 25 }
cassar10 0:82cd70f9fc3f 26