ESPHome  2024.11.1
mpl3115a2.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace mpl3115a2 {
9 
10 // enums from https://github.com/adafruit/Adafruit_MPL3115A2_Library/
12 enum {
14 
18 
21 
23 
27 
30 
31  MPL3115A2_WHOAMI = (0x0C),
32 
35 };
36 
38 enum {
42 };
43 
45 enum {
50 };
51 
53 enum {
54 
60 };
61 
63 enum {
70 };
71 
73 enum {
82 };
83 
85  public:
89 
90  void setup() override;
91  void dump_config() override;
92  void update() override;
93 
94  float get_setup_priority() const override { return setup_priority::DATA; }
95 
96  protected:
100  enum ErrorCode {
101  NONE = 0,
104  } error_code_{NONE};
105 };
106 
107 } // namespace mpl3115a2
108 } // namespace esphome
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
enum esphome::mpl3115a2::MPL3115A2Component::ErrorCode NONE
float altitude
Definition: qmp6988.h:73
uint8_t pressure
Definition: tt21100.cpp:19
This class simplifies creating components that periodically check a state.
Definition: component.h:283
void set_temperature(sensor::Sensor *temperature)
Definition: mpl3115a2.h:86
void set_altitude(sensor::Sensor *altitude)
Definition: mpl3115a2.h:87
uint16_t temperature
Definition: sun_gtil2.cpp:26
float get_setup_priority() const override
Definition: mpl3115a2.h:94
void set_pressure(sensor::Sensor *pressure)
Definition: mpl3115a2.h:88
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133