ESPHome  2022.6.2
ina226.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace ina226 {
9 
11  public:
12  void setup() override;
13  void dump_config() override;
14  float get_setup_priority() const override;
15  void update() override;
16 
17  void set_shunt_resistance_ohm(float shunt_resistance_ohm) { shunt_resistance_ohm_ = shunt_resistance_ohm; }
18  void set_max_current_a(float max_current_a) { max_current_a_ = max_current_a; }
19  void set_bus_voltage_sensor(sensor::Sensor *bus_voltage_sensor) { bus_voltage_sensor_ = bus_voltage_sensor; }
20  void set_shunt_voltage_sensor(sensor::Sensor *shunt_voltage_sensor) { shunt_voltage_sensor_ = shunt_voltage_sensor; }
21  void set_current_sensor(sensor::Sensor *current_sensor) { current_sensor_ = current_sensor; }
22  void set_power_sensor(sensor::Sensor *power_sensor) { power_sensor_ = power_sensor; }
23 
24  protected:
27  uint32_t calibration_lsb_;
32 };
33 
34 } // namespace ina226
35 } // namespace esphome
sensor::Sensor * power_sensor_
Definition: ina226.h:31
This class simplifies creating components that periodically check a state.
Definition: component.h:266
void set_shunt_resistance_ohm(float shunt_resistance_ohm)
Definition: ina226.h:17
sensor::Sensor * bus_voltage_sensor_
Definition: ina226.h:28
sensor::Sensor * current_sensor_
Definition: ina226.h:30
float get_setup_priority() const override
Definition: ina226.cpp:95
void set_current_sensor(sensor::Sensor *current_sensor)
Definition: ina226.h:21
void set_shunt_voltage_sensor(sensor::Sensor *shunt_voltage_sensor)
Definition: ina226.h:20
void set_power_sensor(sensor::Sensor *power_sensor)
Definition: ina226.h:22
Definition: a4988.cpp:4
void set_max_current_a(float max_current_a)
Definition: ina226.h:18
void set_bus_voltage_sensor(sensor::Sensor *bus_voltage_sensor)
Definition: ina226.h:19
Base-class for all sensors.
Definition: sensor.h:47
void dump_config() override
Definition: ina226.cpp:79
sensor::Sensor * shunt_voltage_sensor_
Definition: ina226.h:29