Modular Electronics  0.1
 All Classes Namespaces Functions Variables Pages
AD5791.h
1 // Class for a Analog Devices AD5791 DAC
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 AD5791_h_
18 #define AD5791_h_
19 
20 #include "dac.h"
21 
29 class AD5791: public DacSpi {
30  private:
31  uint8_t slot_number_;
32  double full_scale_;
33  public:
34  AD5791(void) = default;
43  AD5791(uint8_t sync_pin, uint8_t spi_bus_config_pin,
44  uint8_t ldac_pin, uint8_t slot_number=0, double full_scale=10.0);
45  virtual double BytesToVoltage(spi_utils::Message message);
46  virtual spi_utils::Message SetVoltageMessage(uint8_t channel, double voltage);
48 };
49 #endif
Definition: dac.h:35
Definition: utils.h:35
virtual double BytesToVoltage(spi_utils::Message message)
Definition: AD5791.cpp:25
virtual spi_utils::Message InitializeMessage(void)
Definition: AD5791.cpp:58
virtual spi_utils::Message SetVoltageMessage(uint8_t channel, double voltage)
Definition: AD5791.cpp:40
Definition: AD5791.h:29