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.
Diff: AD9850SPI.h
- Branch:
- switch-to-cmsis-bitops
- Revision:
- 4:c60c1caa2593
- Parent:
- 0:4aaced3b219c
--- a/AD9850SPI.h Thu Jan 09 17:30:19 2020 +0000 +++ b/AD9850SPI.h Fri Jan 10 10:24:30 2020 +0900 @@ -1,22 +1,22 @@ -/** - * Fast AD9850 serial interface over SPI - */ - -#include <mbed.h> - -class AD9850SPI { - -public: - AD9850SPI(SPI &spi, PinName fq_ud, PinName reset); - ~AD9850SPI(); - - void reset_spi(); - void reset(); - void setFrequency(int freq, int powerdown=0, int phase=0); - -private: - SPI &_spi; - DigitalOut _fq_ud; - DigitalOut _reset; -}; - +/** + * Fast AD9850 serial interface over SPI + */ + +#include <mbed.h> + +class AD9850SPI { + +public: + AD9850SPI(SPI &spi, PinName fq_ud, PinName reset); + ~AD9850SPI(); + + void reset_spi(); + void reset(); + void setFrequency(int freq, int powerdown=0, int phase=0); + +private: + SPI &_spi; + DigitalOut _fq_ud; + DigitalOut _reset; +}; +