Fast SPI-based serial interface to AD9850 clock generator. Has same interface as (bit-banging based) AD9850 library, but more than x100 faster in frequency update speed. Can sweep 1KHz to 30MHz in 1KHz step in a few seconds.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AD9850SPI.h Source File

AD9850SPI.h

00001 /**
00002  * Fast AD9850 serial interface over SPI
00003  */
00004 
00005 #include <mbed.h>
00006 
00007 class AD9850SPI {
00008 
00009 public:
00010     AD9850SPI(SPI &spi, PinName fq_ud, PinName reset);
00011     ~AD9850SPI();
00012 
00013     void reset_spi();
00014     void reset();
00015     void setFrequency(int freq, int powerdown=0, int phase=0);
00016 
00017 private:
00018     SPI &_spi;
00019     DigitalOut _fq_ud;
00020     DigitalOut _reset;
00021 };
00022