AD7680 Library
ad7680.h@0:91b4ea0c12f8, 2017-04-19 (annotated)
- Committer:
- wacomg
- Date:
- Wed Apr 19 09:58:17 2017 +0000
- Revision:
- 0:91b4ea0c12f8
AD7680 library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wacomg | 0:91b4ea0c12f8 | 1 | /*************************************************************************** |
wacomg | 0:91b4ea0c12f8 | 2 | * @author Wacomg |
wacomg | 0:91b4ea0c12f8 | 3 | * |
wacomg | 0:91b4ea0c12f8 | 4 | * @section LICENSE |
wacomg | 0:91b4ea0c12f8 | 5 | * |
wacomg | 0:91b4ea0c12f8 | 6 | * Copyright (c) 2017 Wacomg |
wacomg | 0:91b4ea0c12f8 | 7 | * |
wacomg | 0:91b4ea0c12f8 | 8 | * @section DESCRIPTION |
wacomg | 0:91b4ea0c12f8 | 9 | * |
wacomg | 0:91b4ea0c12f8 | 10 | * AD7680.H |
wacomg | 0:91b4ea0c12f8 | 11 | * Header file for AD7680 class library |
wacomg | 0:91b4ea0c12f8 | 12 | * The AD7680 is a 16-bits, 1-channels, SPI-interfaced ADC from Analog Devices |
wacomg | 0:91b4ea0c12f8 | 13 | * |
wacomg | 0:91b4ea0c12f8 | 14 | *****************************************************************************/ |
wacomg | 0:91b4ea0c12f8 | 15 | #ifndef AD7680_H |
wacomg | 0:91b4ea0c12f8 | 16 | #define AD7680_H |
wacomg | 0:91b4ea0c12f8 | 17 | |
wacomg | 0:91b4ea0c12f8 | 18 | #include "mbed.h" |
wacomg | 0:91b4ea0c12f8 | 19 | |
wacomg | 0:91b4ea0c12f8 | 20 | class AD7680 { |
wacomg | 0:91b4ea0c12f8 | 21 | private: |
wacomg | 0:91b4ea0c12f8 | 22 | SPI _spi; |
wacomg | 0:91b4ea0c12f8 | 23 | DigitalOut _cs; |
wacomg | 0:91b4ea0c12f8 | 24 | double _q; |
wacomg | 0:91b4ea0c12f8 | 25 | |
wacomg | 0:91b4ea0c12f8 | 26 | public: |
wacomg | 0:91b4ea0c12f8 | 27 | AD7680(PinName MISO, PinName SCLK, PinName CS, int frequency); // Constructor |
wacomg | 0:91b4ea0c12f8 | 28 | void readRAW(int16_t *); // Read raw values from ADC |
wacomg | 0:91b4ea0c12f8 | 29 | void readAnalog(double *); // Read analog values |
wacomg | 0:91b4ea0c12f8 | 30 | }; |
wacomg | 0:91b4ea0c12f8 | 31 | |
wacomg | 0:91b4ea0c12f8 | 32 | #endif |