ESPHome  2024.10.2
mcp4725.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 static const uint8_t MCP4725_ADDR = 0x60;
8 static const uint8_t MCP4725_RES = 12;
9 
10 namespace esphome {
11 namespace mcp4725 {
12 class MCP4725 : public Component, public output::FloatOutput, public i2c::I2CDevice {
13  public:
14  void setup() override;
15  void dump_config() override;
16  void write_state(float state) override;
17 
18  protected:
19  enum ErrorCode { NONE = 0, COMMUNICATION_FAILED } error_code_{NONE};
20 };
21 
22 } // namespace mcp4725
23 } // namespace esphome
void setup() override
Definition: mcp4725.cpp:9
Base class for all output components that can output a variable level, like PWM.
Definition: float_output.h:31
enum esphome::mcp4725::MCP4725::ErrorCode NONE
void write_state(float state) override
Definition: mcp4725.cpp:28
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133
void dump_config() override
Definition: mcp4725.cpp:19
bool state
Definition: fan.h:34