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.
AD9850SPI.h
- Committer:
- Taisuke Yamada
- Date:
- 2020-01-13
- Branch:
- switch-to-cmsis-bitops
- Revision:
- 6:8c15ffb18f88
- Parent:
- 4:c60c1caa2593
File content as of revision 6:8c15ffb18f88:
/** * 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; };