ESPHome 2025.6.2
Loading...
Searching...
No Matches
lc709203f.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace lc709203f {
9
16
22
24 public:
25 void setup() override;
26 void update() override;
27 void dump_config() override;
28
29 void set_pack_size(uint16_t pack_size);
30 void set_thermistor_b_constant(uint16_t b_constant);
32 void set_voltage_sensor(sensor::Sensor *voltage_sensor) { voltage_sensor_ = voltage_sensor; }
33 void set_battery_remaining_sensor(sensor::Sensor *battery_remaining_sensor) {
34 battery_remaining_sensor_ = battery_remaining_sensor;
35 }
36 void set_temperature_sensor(sensor::Sensor *temperature_sensor) { temperature_sensor_ = temperature_sensor; }
37
38 private:
39 uint8_t get_register_(uint8_t register_to_read, uint16_t *register_value);
40 uint8_t set_register_(uint8_t register_to_set, uint16_t value_to_set);
41 uint8_t crc8_(uint8_t *byte_buffer, uint8_t length_of_crc);
42
43 protected:
47 uint16_t pack_size_;
48 uint16_t apa_;
49 uint16_t b_constant_;
51 uint16_t pack_voltage_;
52};
53
54} // namespace lc709203f
55} // namespace esphome
This class simplifies creating components that periodically check a state.
Definition component.h:331
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
sensor::Sensor * voltage_sensor_
Definition lc709203f.h:44
void set_pack_voltage(LC709203FBatteryVoltage pack_voltage)
void set_thermistor_b_constant(uint16_t b_constant)
sensor::Sensor * battery_remaining_sensor_
Definition lc709203f.h:45
void set_battery_remaining_sensor(sensor::Sensor *battery_remaining_sensor)
Definition lc709203f.h:33
void set_temperature_sensor(sensor::Sensor *temperature_sensor)
Definition lc709203f.h:36
void set_pack_size(uint16_t pack_size)
void set_voltage_sensor(sensor::Sensor *voltage_sensor)
Definition lc709203f.h:32
sensor::Sensor * temperature_sensor_
Definition lc709203f.h:46
Base-class for all sensors.
Definition sensor.h:62
LC709203FBatteryVoltage
Enum listing allowable voltage settings for the LC709203F.
Definition lc709203f.h:18
@ LC709203F_BATTERY_VOLTAGE_3_7
Definition lc709203f.h:20
@ LC709203F_BATTERY_VOLTAGE_3_8
Definition lc709203f.h:19
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7