ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
max9611.h
Go to the documentation of this file.
1#pragma once
2
6#include "esphome/core/hal.h"
7
8namespace esphome::max9611 {
9
20
35
36class MAX9611Component final : public PollingComponent, public i2c::I2CDevice {
37 SUB_SENSOR(voltage)
38 SUB_SENSOR(current)
39 SUB_SENSOR(watt)
40 SUB_SENSOR(temp)
41
42 public:
43 void setup() override;
44 void dump_config() override;
45 void update() override;
46
47 void set_current_resistor(float r) { current_resistor_ = r; }
48 void set_gain(MAX9611Multiplexer g) { gain_ = g; }
49
50 protected:
52 uint8_t register_map_[0x0C];
54};
55
56} // namespace esphome::max9611
int24_le_t watt
Definition bl0940.h:6
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:84
This class simplifies creating components that periodically check a state.
Definition component.h:532
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
@ CONTROL_REGISTER_2_ADRR
Definition max9611.h:33
@ SET_DATA_BYTE_MSB_ADRR
Definition max9611.h:28
@ TEMP_DATA_BYTE_LSB_ADRR
Definition max9611.h:31
@ CONTROL_REGISTER_1_ADRR
Definition max9611.h:32
@ RS_DATA_BYTE_MSB_ADRR
Definition max9611.h:24
@ OUT_DATA_BYTE_MSB_ADRR
Definition max9611.h:26
@ CSA_DATA_BYTE_MSB_ADRR
Definition max9611.h:22
@ OUT_DATA_BYTE_LSB_ADRR
Definition max9611.h:27
@ RS_DATA_BYTE_LSB_ADRR
Definition max9611.h:25
@ CSA_DATA_BYTE_LSB_ADRR
Definition max9611.h:23
@ TEMP_DATA_BYTE_MSB_ADRR
Definition max9611.h:30
@ SET_DATA_BYTE_LSB_ADRR
Definition max9611.h:29
@ MAX9611_MULTIPLEXER_TEMP
Definition max9611.h:17
@ MAX9611_MULTIPLEXER_CSA_GAIN4
Definition max9611.h:12
@ MAX9611_MULTIPLEXER_SET
Definition max9611.h:16
@ MAX9611_MULTIPLEXER_OUT
Definition max9611.h:15
@ MAX9611_MULTIPLEXER_CSA_GAIN1
Definition max9611.h:11
@ MAX9611_MULTIPLEXER_FAST_MODE
Definition max9611.h:18
@ MAX9611_MULTIPLEXER_CSA_GAIN8
Definition max9611.h:13
@ MAX9611_MULTIPLEXER_RS
Definition max9611.h:14