ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
xgzp68xx
xgzp6899dc.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
5
#include "
esphome/core/component.h
"
6
#include "
esphome/components/sensor/sensor.h
"
7
#include "
esphome/components/i2c/i2c.h
"
8
9
namespace
esphome::xgzp68xx
{
10
12
class
XGZP6899DCComponent
final :
public
PollingComponent
,
public
i2c::I2CDevice
{
13
public
:
15
explicit
XGZP6899DCComponent
(
float
pressure_span);
16
17
SUB_SENSOR
(
temperature
)
18
SUB_SENSOR
(
pressure
)
20
void
set_pressure_oversampling(uint8_t pressure_oversampling) {
21
this->
pressure_oversampling_
= pressure_oversampling;
22
}
23
24
void
update
()
override
;
25
void
setup
()
override
;
26
void
dump_config
()
override
;
27
28
protected
:
29
void
read_data_
();
30
31
// Pa per raw count
32
float
pressure_scale_
;
33
// Temperature = raw * temperature_scale_ + temperature_bias_, from the calibration registers
34
float
temperature_scale_
{0.0f};
35
float
temperature_bias_
{0.0f};
36
uint8_t
pressure_oversampling_
{UINT8_MAX};
37
};
38
39
}
// namespace esphome::xgzp68xx
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition
component.h:532
esphome::i2c::I2CDevice
This Class provides the methods to read/write bytes from/to an i2c device.
Definition
i2c.h:144
esphome::xgzp68xx::XGZP6899DCComponent
XGZP6899DC: the XGZP6899D revision at I2C address 0x58 (datasheet V3.2), with a new register map.
Definition
xgzp6899dc.h:12
esphome::xgzp68xx::XGZP6899DCComponent::dump_config
void dump_config() override
Definition
xgzp6899dc.cpp:87
esphome::xgzp68xx::XGZP6899DCComponent::pressure_scale_
float pressure_scale_
Definition
xgzp6899dc.h:32
esphome::xgzp68xx::XGZP6899DCComponent::update
void update() override
Definition
xgzp6899dc.cpp:66
esphome::xgzp68xx::XGZP6899DCComponent::pressure_oversampling_
uint8_t pressure_oversampling_
Definition
xgzp6899dc.h:36
esphome::xgzp68xx::XGZP6899DCComponent::SUB_SENSOR
SUB_SENSOR(temperature) SUB_SENSOR(pressure) void set_pressure_oversampling(uint8_t pressure_oversampling)
Set the CFG_OSR pressure oversampling code (0 = 256X ... 7 = 32768X). Unset keeps the factory value.
Definition
xgzp6899dc.h:17
esphome::xgzp68xx::XGZP6899DCComponent::temperature_scale_
float temperature_scale_
Definition
xgzp6899dc.h:34
esphome::xgzp68xx::XGZP6899DCComponent::setup
void setup() override
Definition
xgzp6899dc.cpp:35
esphome::xgzp68xx::XGZP6899DCComponent::XGZP6899DCComponent
XGZP6899DCComponent(float pressure_span)
Definition
xgzp6899dc.cpp:33
esphome::xgzp68xx::XGZP6899DCComponent::read_data_
void read_data_()
Definition
xgzp6899dc.cpp:72
esphome::xgzp68xx::XGZP6899DCComponent::temperature_bias_
float temperature_bias_
Definition
xgzp6899dc.h:35
component.h
i2c.h
esphome::xgzp68xx
Definition
xgzp6899dc.cpp:8
sensor.h
temperature
uint16_t temperature
Definition
sun_gtil2.cpp:12
pressure
uint8_t pressure
Definition
tt21100.cpp:7
Generated by
1.12.0