ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
honeywellabp.h
Go to the documentation of this file.
1// for Honeywell ABP sensor
2// adapting code from https://github.com/vwls/Honeywell_pressure_sensors
3#pragma once
4
8
9namespace esphome::honeywellabp {
10
12 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
13 spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_200KHZ> {
14 SUB_SENSOR(pressure)
15 SUB_SENSOR(temperature)
16
17 public:
18 void setup() override;
19 void update() override;
20 float get_setup_priority() const override;
21 void dump_config() override;
22 void set_honeywellabp_min_pressure(float min_pressure);
23 void set_honeywellabp_max_pressure(float max_pressure);
24
25 protected:
28 uint8_t buf_[4]; // buffer to hold sensor data
29 uint8_t status_ = 0; // byte to hold status information.
30 int pressure_count_ = 0; // hold raw pressure data (14 - bit, 0 - 16384)
31 int temperature_count_ = 0; // hold raw temperature data (11 - bit, 0 - 2048)
32 uint8_t readsensor_();
33 uint8_t readstatus_();
34 int rawpressure_();
35 int rawtemperature_();
36 float countstopressure_(int counts, float min_pressure, float max_pressure);
37 float countstotemperatures_(int counts);
38 float read_pressure_();
39 float read_temperature_();
40};
41
42} // namespace esphome::honeywellabp
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
float countstopressure_(int counts, float min_pressure, float max_pressure)
The SPIDevice is what components using the SPI will create.
Definition spi.h:456
uint16_t temperature
Definition sun_gtil2.cpp:12
uint8_t pressure
Definition tt21100.cpp:7