Modular Electronics  0.1
 All Classes Namespaces Functions Variables Pages
AD7734.h
1 // Class for a Analog Devices AD7734 ADC
2 // Copyright (C) 2018 Carlos Kometter
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
16 
17 #ifndef AD7734_h_
18 #define AD7734_h_
19 
20 #include "adc.h"
21 // #include "board.h"
22 
30 class AD7734: public AdcSpi {
31  private:
32  uint8_t slot_number_;
33  const double full_scale_ = 10.0;
34  public:
35  AD7734(void) = default;
44  AD7734(uint8_t sync_pin, uint8_t spi_bus_config_pin,
45  uint8_t data_ready_pin, uint8_t slot_number=0,
46  uint8_t reset_pin=0);
47  protected:
48  virtual double BytesToVoltage(spi_utils::Message message);
49  virtual spi_utils::Message SingleConversionModeMessage(uint8_t channel);
50  virtual spi_utils::Message ReadDataRegisterMessage(uint8_t channel);
51 };
52 #endif
Definition: utils.h:35
virtual spi_utils::Message ReadDataRegisterMessage(uint8_t channel)
Definition: AD7734.cpp:43
Definition: AD7734.h:30
virtual spi_utils::Message SingleConversionModeMessage(uint8_t channel)
Definition: AD7734.cpp:34
Definition: adc.h:33
virtual double BytesToVoltage(spi_utils::Message message)
Definition: AD7734.cpp:27