Modular Electronics  0.1
 All Classes Namespaces Functions Variables Pages
AD5764.h
1 // Class for a Analog Devices AD5764 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 AD5764_h_
18 #define AD5764_h_
19 
20 #include "dac.h"
21 // #include "board.h"
22 
30 class AD5764: public DacSpi {
31  private:
32  uint8_t slot_number_;
33  double full_scale_;
34  public:
43  AD5764(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);
49  uint8_t Initialize(void) {return 0;}
50  virtual double BytesToVoltage(spi_utils::Message message);
51  virtual spi_utils::Message SetVoltageMessage(uint8_t channel, double voltage);
53 };
54 #endif
virtual double BytesToVoltage(spi_utils::Message message)
Definition: AD5764.cpp:25
Definition: dac.h:35
uint8_t Initialize(void)
Definition: AD5764.h:49
Definition: utils.h:35
AD5764(uint8_t sync_pin, uint8_t spi_bus_config_pin, uint8_t ldac_pin, uint8_t slot_number=0, double full_scale=10.0)
Definition: AD5764.cpp:19
virtual spi_utils::Message InitializeMessage(void)
Definition: AD5764.h:52
Definition: AD5764.h:30
virtual spi_utils::Message SetVoltageMessage(uint8_t channel, double voltage)
Definition: AD5764.cpp:39