Analog Devices 16 channels, 1MSPS, 12bit ADC with SPI interface
Embed:
(wiki syntax)
Show/hide line numbers
AD7490.h
00001 // 00002 // AD7490 ... Analog Devices 16 channels, 1MSPS, 12bit ADC 00003 // 00004 // 2012.08.29 ... Originaly written by Yoji KURODA 00005 // 00006 #ifndef _AD7490_H 00007 #define _AD7490_H 00008 00009 class AD7490 { 00010 protected: 00011 enum CREG { 00012 CREG_WRITE = 0x800, 00013 CREG_SEQ = 0x400, 00014 CREG_ADD3 = 0x200, 00015 CREG_ADD2 = 0x100, 00016 CREG_ADD1 = 0x080, 00017 CREG_ADD0 = 0x040, 00018 CREG_PM1 = 0x020, 00019 CREG_PM0 = 0x010, 00020 CREG_SHADOW = 0x008, 00021 CREG_WEAK = 0x004, 00022 CREG_RANGE = 0x002, 00023 CREG_CODING = 0x001 00024 }; 00025 00026 SPI spi; 00027 DigitalOut cs; 00028 00029 unsigned short read(void); // dummy read for triggering at sequential mode 00030 00031 public: 00032 AD7490(SPI _spi, PinName _cs); 00033 virtual ~AD7490(){}; 00034 00035 unsigned short convert(int ch=0); // one shot conversion at channel [ch] 00036 void convert(short data[]); // convert all (16) channels with one short conv. 00037 00038 unsigned short sequential(int ch=15); // start sequential mode from channel [0] to [ch] 00039 void read(short data[]); // read [0] to [ch], and copy to user area 00040 }; 00041 00042 #endif // _AD7490_H
Generated on Thu Jul 21 2022 23:06:18 by 1.7.2