PIDUINO
Loading...
Searching...
No Matches
mcp4725.h
1/* Copyright © 2018-2025 Pascal JEAN, All rights reserved.
2 This file is part of the Piduino Library.
3
4 The Piduino Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 3 of the License, or (at your option) any later version.
8
9 The Piduino Library 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 GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with the Piduino Library; if not, see <http://www.gnu.org/licenses/>.
16*/
17#pragma once
18
19#include <piduino/converter.h>
20#include <piduino/i2cdev.h>
21
22namespace Piduino {
23
39 class Mcp4725 : public Converter {
40
41 public:
42
43 static constexpr int DefaultAddress = 0x60;
44 static constexpr double DefaultFullScaleRange = 3.3;
45
56 Mcp4725 (int busId = I2cDev::Info::defaultBus().id(), int address = DefaultAddress);
57
64 virtual ~Mcp4725();
65
83 explicit Mcp4725 (const std::string &parameters);
84
96 static std::string registeredName() {
97 return "mcp4725";
98 }
99
138 protected:
146 class Private;
147
158
159 private:
168 };
169}
170
171/* ========================================================================== */
The Converter class provides an interface for analog-to-digital and digital-to-analog converters.
Definition converter.h:34
static Info defaultBus()
Gets information about the default I2C bus on the system.
Class for the MCP4725 series of digital-to-analog converters.
Definition mcp4725.h:39
static constexpr int DefaultAddress
Default I2C address for the MCP4725.
Definition mcp4725.h:43
Mcp4725(Private &dd)
Protected constructor for internal use with PIMPL pattern.
Mcp4725(const std::string &parameters)
Constructs a Mcp4725 object from a string of parameters.
virtual ~Mcp4725()
Virtual destructor for the Mcp4725 class.
static std::string registeredName()
Returns the name registered for this converter.
Definition mcp4725.h:96
Mcp4725(int busId=I2cDev::Info::defaultBus().id(), int address=DefaultAddress)
Constructs a Mcp4725 object with the specified I2C device and parameters.
static constexpr double DefaultFullScaleRange
Default full-scale range for the MCP4725.
Definition mcp4725.h:44
Internal implementation class for GpioDevice.
#define PIMP_DECLARE_PRIVATE(Class)
PIMP_DECLARE_PRIVATE.
Definition global.h:82
Global namespace for Piduino.
Definition board.h:28