ESPHome 2025.5.0
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 {
9namespace mcp4728 {
10
12 public:
14 MCP4728PwrDown pwrdown)
15 : parent_(parent), channel_(channel) {
16 // update VREF
17 parent->select_vref_(channel, vref);
18 // update PD
19 parent->select_power_down_(channel, pwrdown);
20 // update GAIN
21 parent->select_gain_(channel, gain);
22 }
23
24 protected:
25 void write_state(float state) override;
26
29};
30
31} // namespace mcp4728
32} // namespace esphome
MCP4728Channel(MCP4728Component *parent, MCP4728ChannelIdx channel, MCP4728Vref vref, MCP4728Gain gain, MCP4728PwrDown pwrdown)
void write_state(float state) override
MCP4728 float output component.
Definition mcp4728.h:42
void select_vref_(MCP4728ChannelIdx channel, MCP4728Vref vref)
Definition mcp4728.cpp:95
void select_gain_(MCP4728ChannelIdx channel, MCP4728Gain gain)
Definition mcp4728.cpp:107
void select_power_down_(MCP4728ChannelIdx channel, MCP4728PwrDown pd)
Definition mcp4728.cpp:101
Base class for all output components that can output a variable level, like PWM.
bool state
Definition fan.h:0
AlsGain501 gain
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7