ESPHome
2022.12.8
esphome
esphome
components
mcp4725
mcp4725.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/components/output/float_output.h
"
4
#include "
esphome/core/component.h
"
5
#include "
esphome/components/i2c/i2c.h
"
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
esphome::mcp4725::MCP4725::setup
void setup() override
Definition:
mcp4725.cpp:9
esphome::output::FloatOutput
Base class for all output components that can output a variable level, like PWM.
Definition:
float_output.h:31
esphome::Component
Definition:
component.h:67
esphome::mcp4725::MCP4725::NONE
enum esphome::mcp4725::MCP4725::ErrorCode NONE
float_output.h
esphome::mcp4725::MCP4725::write_state
void write_state(float state) override
Definition:
mcp4725.cpp:28
esphome::mcp4725::MCP4725::ErrorCode
ErrorCode
Definition:
mcp4725.h:19
esphome::mcp4725::MCP4725::COMMUNICATION_FAILED
Definition:
mcp4725.h:19
esphome::mcp4725::MCP4725
Definition:
mcp4725.h:12
esphome
Definition:
a4988.cpp:4
component.h
esphome::i2c::I2CDevice
Definition:
i2c.h:39
esphome::mcp4725::MCP4725::dump_config
void dump_config() override
Definition:
mcp4725.cpp:19
state
bool state
Definition:
fan.h:34
i2c.h
Generated by
1.8.13