Dependencies: DMSupport DMemWin
embedded/ADC.h@0:08606a13a816, 2016-06-02 (annotated)
- Committer:
- destinyXfate
- Date:
- Thu Jun 02 05:04:57 2016 +0000
- Revision:
- 0:08606a13a816
;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
destinyXfate | 0:08606a13a816 | 1 | #ifndef ADC_H_ |
destinyXfate | 0:08606a13a816 | 2 | #define ADC_H_ |
destinyXfate | 0:08606a13a816 | 3 | |
destinyXfate | 0:08606a13a816 | 4 | #include "mbed.h" |
destinyXfate | 0:08606a13a816 | 5 | |
destinyXfate | 0:08606a13a816 | 6 | |
destinyXfate | 0:08606a13a816 | 7 | class ADS8556 { |
destinyXfate | 0:08606a13a816 | 8 | |
destinyXfate | 0:08606a13a816 | 9 | public: |
destinyXfate | 0:08606a13a816 | 10 | |
destinyXfate | 0:08606a13a816 | 11 | typedef struct { |
destinyXfate | 0:08606a13a816 | 12 | double value[6]; |
destinyXfate | 0:08606a13a816 | 13 | } ADCData; |
destinyXfate | 0:08606a13a816 | 14 | |
destinyXfate | 0:08606a13a816 | 15 | ADS8556(SPI *spi, PinName cs, PinName reset, PinName convst, PinName busy); |
destinyXfate | 0:08606a13a816 | 16 | |
destinyXfate | 0:08606a13a816 | 17 | void adc(int16_t* data); |
destinyXfate | 0:08606a13a816 | 18 | double get(int16_t* data, uint16_t channel, uint16_t num); |
destinyXfate | 0:08606a13a816 | 19 | double get2(int16_t* data, uint16_t channel, uint16_t num); |
destinyXfate | 0:08606a13a816 | 20 | |
destinyXfate | 0:08606a13a816 | 21 | private: |
destinyXfate | 0:08606a13a816 | 22 | SPI *_spi; |
destinyXfate | 0:08606a13a816 | 23 | DigitalOut _cs; |
destinyXfate | 0:08606a13a816 | 24 | DigitalOut _reset; |
destinyXfate | 0:08606a13a816 | 25 | DigitalOut _convst; |
destinyXfate | 0:08606a13a816 | 26 | DigitalIn _busy; |
destinyXfate | 0:08606a13a816 | 27 | |
destinyXfate | 0:08606a13a816 | 28 | }; |
destinyXfate | 0:08606a13a816 | 29 | |
destinyXfate | 0:08606a13a816 | 30 | #endif |
destinyXfate | 0:08606a13a816 | 31 |