ESPHome  2024.4.1
mlx90614.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace mlx90614 {
9 
11  public:
12  void setup() override;
13  void dump_config() override;
14  void update() override;
15  float get_setup_priority() const override;
16 
17  void set_ambient_sensor(sensor::Sensor *ambient_sensor) { ambient_sensor_ = ambient_sensor; }
18  void set_object_sensor(sensor::Sensor *object_sensor) { object_sensor_ = object_sensor; }
19 
20  void set_emissivity(float emissivity) { emissivity_ = emissivity; }
21 
22  protected:
23  bool write_emissivity_();
24 
25  uint8_t crc8_pec_(const uint8_t *data, uint8_t len);
26  bool write_bytes_(uint8_t reg, uint16_t data);
27 
30 
31  float emissivity_{NAN};
32 };
33 } // namespace mlx90614
34 } // namespace esphome
sensor::Sensor * ambient_sensor_
Definition: mlx90614.h:28
I2CRegister reg(uint8_t a_register)
calls the I2CRegister constructor
Definition: i2c.h:149
float get_setup_priority() const override
Definition: mlx90614.cpp:89
void set_ambient_sensor(sensor::Sensor *ambient_sensor)
Definition: mlx90614.h:17
This class simplifies creating components that periodically check a state.
Definition: component.h:283
uint8_t crc8_pec_(const uint8_t *data, uint8_t len)
Definition: mlx90614.cpp:53
bool write_bytes_(uint8_t reg, uint16_t data)
Definition: mlx90614.cpp:68
std::string size_t len
Definition: helpers.h:292
void set_emissivity(float emissivity)
Definition: mlx90614.h:20
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
void set_object_sensor(sensor::Sensor *object_sensor)
Definition: mlx90614.h:18
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133