ESPHome 2026.5.1
Loading...
Searching...
No Matches
mcp4728_output.h
Go to the documentation of this file.
1#pragma once
2
3#include "../mcp4728.h"
7
8namespace esphome::mcp4728 {
9
11 public:
13 MCP4728PwrDown pwrdown)
14 : parent_(parent), channel_(channel) {
15 // update VREF
16 parent->select_vref_(channel, vref);
17 // update PD
18 parent->select_power_down_(channel, pwrdown);
19 // update GAIN
20 parent->select_gain_(channel, gain);
21 }
22
23 protected:
24 void write_state(float state) override;
25
28};
29
30} // namespace esphome::mcp4728
MCP4728Channel(MCP4728Component *parent, MCP4728ChannelIdx channel, MCP4728Vref vref, MCP4728Gain gain, MCP4728PwrDown pwrdown)
void write_state(float state) override
MCP4728 float output component.
Definition mcp4728.h:41
void select_vref_(MCP4728ChannelIdx channel, MCP4728Vref vref)
Definition mcp4728.cpp:93
void select_gain_(MCP4728ChannelIdx channel, MCP4728Gain gain)
Definition mcp4728.cpp:105
void select_power_down_(MCP4728ChannelIdx channel, MCP4728PwrDown pd)
Definition mcp4728.cpp:99
Base class for all output components that can output a variable level, like PWM.
bool state
Definition fan.h:2
AlsGain501 gain