ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
bme680.cpp
Go to the documentation of this file.
1#include "bme680.h"
2#include "esphome/core/hal.h"
4#include "esphome/core/log.h"
5
6namespace esphome::bme680 {
7
8ESPHOME_LOG_TAG(TAG, "bme680.sensor");
9
10static constexpr uint32_t DATA_TIMEOUT_ID = 0;
11
12static const uint8_t BME680_REGISTER_COEFF1 = 0x89;
13static const uint8_t BME680_REGISTER_COEFF2 = 0xE1;
14
15static const uint8_t BME680_REGISTER_CONFIG = 0x75;
16static const uint8_t BME680_REGISTER_CONTROL_MEAS = 0x74;
17static const uint8_t BME680_REGISTER_CONTROL_HUMIDITY = 0x72;
18static const uint8_t BME680_REGISTER_CONTROL_GAS1 = 0x71;
19static const uint8_t BME680_REGISTER_CONTROL_GAS0 = 0x70;
20static const uint8_t BME680_REGISTER_HEATER_HEAT0 = 0x5A;
21static const uint8_t BME680_REGISTER_HEATER_WAIT0 = 0x64;
22
23static const uint8_t BME680_REGISTER_CHIPID = 0xD0;
24
25static const uint8_t BME680_REGISTER_FIELD0 = 0x1D;
26
27constexpr float BME680_GAS_LOOKUP_TABLE_1[16] PROGMEM = {0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, -0.8,
28 0.0, 0.0, -0.2, -0.5, 0.0, -1.0, 0.0, 0.0};
29
30constexpr float BME680_GAS_LOOKUP_TABLE_2[16] PROGMEM = {0.0, 0.0, 0.0, 0.0, 0.1, 0.7, 0.0, -0.8,
31 -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
32
33[[maybe_unused]] static const char *oversampling_to_str(BME680Oversampling oversampling) {
34 switch (oversampling) {
36 return "None";
38 return "1x";
40 return "2x";
42 return "4x";
44 return "8x";
46 return "16x";
47 default:
48 return "UNKNOWN";
49 }
50}
51
52[[maybe_unused]] static const char *iir_filter_to_str(BME680IIRFilter filter) {
53 switch (filter) {
55 return "OFF";
57 return "1x";
59 return "3x";
61 return "7x";
63 return "15x";
65 return "31x";
67 return "63x";
69 return "127x";
70 default:
71 return "UNKNOWN";
72 }
73}
74
76 if (!this->setup_registers_())
77 this->mark_failed(LOG_STR(ESP_LOG_MSG_COMM_FAIL));
78}
79
81 uint8_t chip_id;
82 if (!this->read_byte(BME680_REGISTER_CHIPID, &chip_id) || chip_id != 0x61) {
83 return false;
84 }
85
86 // Read calibration
87 uint8_t coeff1[25];
88 if (!this->read_bytes(BME680_REGISTER_COEFF1, coeff1, 25)) {
89 return false;
90 }
91 uint8_t coeff2[16];
92 if (!this->read_bytes(BME680_REGISTER_COEFF2, coeff2, 16)) {
93 return false;
94 }
95
96 this->calibration_.t1 = encode_value_le<uint16_t>(&coeff2[8]);
97 this->calibration_.t2 = encode_value_le<int16_t>(&coeff1[1]);
98 this->calibration_.t3 = coeff1[3];
99
100 this->calibration_.h1 = coeff2[2] << 4 | (coeff2[1] & 0x0F);
101 this->calibration_.h2 = coeff2[0] << 4 | coeff2[1] >> 4;
102 this->calibration_.h3 = coeff2[3];
103 this->calibration_.h4 = coeff2[4];
104 this->calibration_.h5 = coeff2[5];
105 this->calibration_.h6 = coeff2[6];
106 this->calibration_.h7 = coeff2[7];
107
108 this->calibration_.p1 = encode_value_le<uint16_t>(&coeff1[5]);
109 this->calibration_.p2 = encode_value_le<int16_t>(&coeff1[7]);
110 this->calibration_.p3 = coeff1[9];
111 this->calibration_.p4 = encode_value_le<int16_t>(&coeff1[11]);
112 this->calibration_.p5 = encode_value_le<int16_t>(&coeff1[13]);
113 this->calibration_.p6 = coeff1[16];
114 this->calibration_.p7 = coeff1[15];
115 this->calibration_.p8 = encode_value_le<int16_t>(&coeff1[19]);
116 this->calibration_.p9 = encode_value_le<int16_t>(&coeff1[21]);
117 this->calibration_.p10 = coeff1[23];
118
119 this->calibration_.gh1 = coeff2[14];
120 this->calibration_.gh2 = encode_value<int16_t>(&coeff2[12]);
121 this->calibration_.gh3 = coeff2[15];
122
123 uint8_t temp_var = 0;
124 if (!this->read_byte(0x02, &temp_var)) {
125 return false;
126 }
127 this->calibration_.res_heat_range = ((temp_var & 0x30) / 16);
128
129 if (!this->read_byte(0x00, &temp_var)) {
130 return false;
131 }
132 this->calibration_.res_heat_val = (int8_t) temp_var;
133
134 if (!this->read_byte(0x04, &temp_var)) {
135 return false;
136 }
137 this->calibration_.range_sw_err = ((int8_t) temp_var & (int8_t) 0xf0) / 16;
138
139 this->calibration_.ambient_temperature = 25; // prime ambient temperature
140
141 // Config register
142 uint8_t config_register;
143 if (!this->read_byte(BME680_REGISTER_CONFIG, &config_register)) {
144 return false;
145 }
146 config_register &= ~0b00011100;
147 config_register |= (this->iir_filter_ & 0b111) << 2;
148 if (!this->write_byte(BME680_REGISTER_CONFIG, config_register)) {
149 return false;
150 }
151
152 // Humidity control register
153 uint8_t hum_control;
154 if (!this->read_byte(BME680_REGISTER_CONTROL_HUMIDITY, &hum_control)) {
155 return false;
156 }
157 hum_control &= ~0b00000111;
158 hum_control |= this->humidity_oversampling_ & 0b111;
159 if (!this->write_byte(BME680_REGISTER_CONTROL_HUMIDITY, hum_control)) {
160 return false;
161 }
162
163 // Gas 1 control register
164 uint8_t gas1_control;
165 if (!this->read_byte(BME680_REGISTER_CONTROL_GAS1, &gas1_control)) {
166 return false;
167 }
168 gas1_control &= ~0b00011111;
169 gas1_control |= 1 << 4;
170 gas1_control |= 0; // profile 0
171 if (!this->write_byte(BME680_REGISTER_CONTROL_GAS1, gas1_control)) {
172 return false;
173 }
174
175 const bool heat_off = this->heater_temperature_ == 0 || this->heater_duration_ == 0;
176
177 // Gas 0 control register
178 uint8_t gas0_control;
179 if (!this->read_byte(BME680_REGISTER_CONTROL_GAS0, &gas0_control)) {
180 return false;
181 }
182 gas0_control &= ~0b00001000;
183 gas0_control |= heat_off << 3;
184 if (!this->write_byte(BME680_REGISTER_CONTROL_GAS0, gas0_control)) {
185 return false;
186 }
187
188 if (!heat_off) {
189 // Gas Heater Temperature
191 if (!this->write_byte(BME680_REGISTER_HEATER_HEAT0, temperature)) {
192 return false;
193 }
194
195 // Gas Heater Duration
196 uint8_t duration = this->calc_heater_duration_(this->heater_duration_);
197
198 if (!this->write_byte(BME680_REGISTER_HEATER_WAIT0, duration)) {
199 return false;
200 }
201 }
202 return true;
203}
204
206 ESP_LOGCONFIG(TAG, "BME680:");
207 LOG_I2C_DEVICE(this);
208 ESP_LOGCONFIG(TAG, " IIR Filter: %s", iir_filter_to_str(this->iir_filter_));
209 LOG_UPDATE_INTERVAL(this);
210
211 LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
212 ESP_LOGCONFIG(TAG, " Oversampling: %s", oversampling_to_str(this->temperature_oversampling_));
213 LOG_SENSOR(" ", "Pressure", this->pressure_sensor_);
214 ESP_LOGCONFIG(TAG, " Oversampling: %s", oversampling_to_str(this->pressure_oversampling_));
215 LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
216 ESP_LOGCONFIG(TAG, " Oversampling: %s", oversampling_to_str(this->humidity_oversampling_));
217 LOG_SENSOR(" ", "Gas Resistance", this->gas_resistance_sensor_);
218 if (this->heater_duration_ == 0 || this->heater_temperature_ == 0) {
219 ESP_LOGCONFIG(TAG, " Heater OFF");
220 } else {
221 ESP_LOGCONFIG(TAG, " Heater temperature=%u°C duration=%ums", this->heater_temperature_, this->heater_duration_);
222 }
223}
224
226 uint8_t meas_control = 0; // No need to fetch, we're setting all fields
227 meas_control |= (this->temperature_oversampling_ & 0b111) << 5;
228 meas_control |= (this->pressure_oversampling_ & 0b111) << 2;
229 meas_control |= 0b01; // forced mode
230 if (!this->write_byte(BME680_REGISTER_CONTROL_MEAS, meas_control)) {
231 this->status_set_warning();
232 return;
233 }
234
235 this->set_timeout(DATA_TIMEOUT_ID, this->calc_meas_duration_(), [this]() { this->read_data_(); });
236}
237
239 if (temperature < 200)
240 temperature = 200;
241 if (temperature > 400)
242 temperature = 400;
243
244 const int8_t ambient_temperature = this->calibration_.ambient_temperature;
245 const int8_t gh1 = this->calibration_.gh1;
246 const int16_t gh2 = this->calibration_.gh2;
247 const int8_t gh3 = this->calibration_.gh3;
248 const uint8_t res_heat_range = this->calibration_.res_heat_range;
249 const int8_t res_heat_val = this->calibration_.res_heat_val;
250
251 uint8_t heatr_res;
252 int32_t var1;
253 int32_t var2;
254 int32_t var3;
255 int32_t var4;
256 int32_t var5;
257 int32_t heatr_res_x100;
258
259 var1 = (((int32_t) ambient_temperature * gh3) / 1000) * 256;
260 var2 = (gh1 + 784) * (((((gh2 + 154009) * temperature * 5) / 100) + 3276800) / 10);
261 var3 = var1 + (var2 / 2);
262 var4 = (var3 / (res_heat_range + 4));
263 var5 = (131 * res_heat_val) + 65536;
264 heatr_res_x100 = (int32_t) (((var4 / var5) - 250) * 34);
265 heatr_res = (uint8_t) ((heatr_res_x100 + 50) / 100);
266
267 return heatr_res;
268}
270 uint8_t factor = 0;
271 uint8_t duration_value;
272
273 if (duration >= 0xfc0) {
274 duration_value = 0xff;
275 } else {
276 while (duration > 0x3F) {
277 duration /= 4;
278 factor += 1;
279 }
280 duration_value = duration + (factor * 64);
281 }
282
283 return duration_value;
284}
286 uint8_t data[15];
287 if (!this->status_comm_result(this->read_bytes(BME680_REGISTER_FIELD0, data, 15))) {
288 if (this->temperature_sensor_ != nullptr)
290 if (this->pressure_sensor_ != nullptr)
292 if (this->humidity_sensor_ != nullptr)
294 if (this->gas_resistance_sensor_ != nullptr)
296 ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL);
297 return;
298 }
299
300 uint32_t raw_temperature = (uint32_t(data[5]) << 12) | (uint32_t(data[6]) << 4) | (uint32_t(data[7]) >> 4);
301 uint32_t raw_pressure = (uint32_t(data[2]) << 12) | (uint32_t(data[3]) << 4) | (uint32_t(data[4]) >> 4);
302 uint32_t raw_humidity = (uint32_t(data[8]) << 8) | uint32_t(data[9]);
303 uint16_t raw_gas = (uint16_t) ((uint32_t) data[13] * 4 | (((uint32_t) data[14]) / 64));
304 uint8_t gas_range = data[14] & 0x0F;
305
306 float temperature = this->calc_temperature_(raw_temperature);
307 float pressure = this->calc_pressure_(raw_pressure);
308 float humidity = this->calc_humidity_(raw_humidity);
309 float gas_resistance = this->calc_gas_resistance_(raw_gas, gas_range);
310
311 bool gas_valid = (data[14] >> 5) & 1;
312 bool heat_stable = (data[14] >> 4) & 1;
313 if (this->heater_temperature_ == 0 || this->heater_duration_ == 0)
314 heat_stable = true; // Allow reporting gas resistance when heater is disabled
315
316 ESP_LOGD(TAG, "Got temperature=%.1f°C pressure=%.1fhPa humidity=%.1f%% gas_resistance=%.1fΩ", temperature, pressure,
317 humidity, gas_resistance);
318 if (!gas_valid) {
319 ESP_LOGW(TAG, "Gas measurement unsuccessful, reading invalid!");
320 }
321 if (!heat_stable) {
322 ESP_LOGW(TAG, "Heater unstable, reading invalid! (Normal for a few readings after a power cycle)");
323 }
324
325 if (this->temperature_sensor_ != nullptr)
326 this->temperature_sensor_->publish_state(temperature);
327 if (this->pressure_sensor_ != nullptr)
328 this->pressure_sensor_->publish_state(pressure);
329 if (this->humidity_sensor_ != nullptr)
330 this->humidity_sensor_->publish_state(humidity);
331 if (this->gas_resistance_sensor_ != nullptr) {
332 if (gas_valid && heat_stable) {
333 this->gas_resistance_sensor_->publish_state(gas_resistance);
334 } else {
335 this->status_set_warning();
337 }
338 }
339}
340
342 float var1 = 0;
343 float var2 = 0;
344 float var3 = 0;
345 float calc_temp = 0;
346 float temp_adc = raw_temperature;
347
348 const float t1 = this->calibration_.t1;
349 const float t2 = this->calibration_.t2;
350 const float t3 = this->calibration_.t3;
351
352 /* calculate var1 data */
353 var1 = ((temp_adc / 16384.0f) - (t1 / 1024.0f)) * t2;
354
355 /* calculate var2 data */
356 var3 = (temp_adc / 131072.0f) - (t1 / 8192.0f);
357 var2 = var3 * var3 * t3 * 16.0f;
358
359 /* t_fine value*/
360 this->calibration_.tfine = (var1 + var2);
361
362 /* compensated temperature data*/
363 calc_temp = ((this->calibration_.tfine) / 5120.0f);
364
365 return calc_temp;
366}
368 const float tfine = this->calibration_.tfine;
369 const float p1 = this->calibration_.p1;
370 const float p2 = this->calibration_.p2;
371 const float p3 = this->calibration_.p3;
372 const float p4 = this->calibration_.p4;
373 const float p5 = this->calibration_.p5;
374 const float p6 = this->calibration_.p6;
375 const float p7 = this->calibration_.p7;
376 const float p8 = this->calibration_.p8;
377 const float p9 = this->calibration_.p9;
378 const float p10 = this->calibration_.p10;
379
380 float var1 = 0;
381 float var2 = 0;
382 float var3 = 0;
383 float var4 = 0;
384 float calc_pres = 0;
385
386 var1 = (tfine / 2.0f) - 64000.0f;
387 var2 = var1 * var1 * (p6 / 131072.0f);
388 var2 = var2 + var1 * p5 * 2.0f;
389 var2 = (var2 / 4.0f) + (p4 * 65536.0f);
390 var1 = (((p3 * var1 * var1) / 16384.0f) + (p2 * var1)) / 524288.0f;
391 var1 = (1.0f + (var1 / 32768.0f)) * p1;
392 calc_pres = 1048576.0f - float(raw_pressure);
393
394 /* Avoid exception caused by division by zero */
395 if (int(var1) != 0) {
396 calc_pres = ((calc_pres - (var2 / 4096.0f)) * 6250.0f) / var1;
397 var1 = (p9 * calc_pres * calc_pres) / 2147483648.0f;
398 var2 = calc_pres * (p8 / 32768.0f);
399 var4 = calc_pres / 256.0f;
400 var3 = var4 * var4 * var4 * (p10 / 131072.0f);
401 calc_pres = calc_pres + (var1 + var2 + var3 + (p7 * 128.0f)) / 16.0f;
402 } else {
403 calc_pres = 0;
404 }
405
406 return calc_pres / 100.0f;
407}
408
409float BME680Component::calc_humidity_(uint16_t raw_humidity) {
410 const float tfine = this->calibration_.tfine;
411 const float h1 = this->calibration_.h1;
412 const float h2 = this->calibration_.h2;
413 const float h3 = this->calibration_.h3;
414 const float h4 = this->calibration_.h4;
415 const float h5 = this->calibration_.h5;
416 const float h6 = this->calibration_.h6;
417 const float h7 = this->calibration_.h7;
418
419 float calc_hum = 0;
420 float var1 = 0;
421 float var2 = 0;
422 float var3 = 0;
423 float var4 = 0;
424 float temp_comp;
425
426 /* compensated temperature data*/
427 temp_comp = tfine / 5120.0f;
428
429 var1 = float(raw_humidity) - (h1 * 16.0f + ((h3 / 2.0f) * temp_comp));
430 var2 = var1 *
431 (((h2 / 262144.0f) * (1.0f + ((h4 / 16384.0f) * temp_comp) + ((h5 / 1048576.0f) * temp_comp * temp_comp))));
432 var3 = h6 / 16384.0f;
433 var4 = h7 / 2097152.0f;
434
435 calc_hum = var2 + (var3 + var4 * temp_comp) * var2 * var2;
436
437 if (calc_hum > 100.0f) {
438 calc_hum = 100.0f;
439 } else if (calc_hum < 0.0f) {
440 calc_hum = 0.0f;
441 }
442
443 return calc_hum;
444}
445float BME680Component::calc_gas_resistance_(uint16_t raw_gas, uint8_t range) {
446 float calc_gas_res;
447 float var1 = 0;
448 float var2 = 0;
449 float var3 = 0;
450 float raw_gas_f = raw_gas;
451 float range_f = 1U << range;
452 const float range_sw_err = this->calibration_.range_sw_err;
453
454 var1 = 1340.0f + (5.0f * range_sw_err);
455 var2 = var1 * (1.0f + BME680_GAS_LOOKUP_TABLE_1[range] / 100.0f);
456 var3 = 1.0f + (BME680_GAS_LOOKUP_TABLE_2[range] / 100.0f);
457
458 calc_gas_res = 1.0f / (var3 * 0.000000125f * range_f * (((raw_gas_f - 512.0f) / var2) + 1.0f));
459
460 return calc_gas_res;
461}
463 uint32_t tph_dur; // Calculate in us
464 uint32_t meas_cycles;
465 const uint8_t os_to_meas_cycles[6] = {0, 1, 2, 4, 8, 16};
466
467 meas_cycles = os_to_meas_cycles[this->temperature_oversampling_];
468 meas_cycles += os_to_meas_cycles[this->pressure_oversampling_];
469 meas_cycles += os_to_meas_cycles[this->humidity_oversampling_];
470
471 /* TPH measurement duration */
472 tph_dur = meas_cycles * 1963u;
473 tph_dur += 477 * 4; // TPH switching duration
474 tph_dur += 477 * 5; // Gas measurement duration
475 tph_dur += 500; // Get it to the closest whole number.
476 tph_dur /= 1000; // Convert to ms
477
478 tph_dur += 1; // Wake up duration of 1ms
479
480 /* The remaining time should be used for heating */
481 tph_dur += this->heater_duration_;
482
483 return tph_dur;
484}
486 this->temperature_oversampling_ = temperature_oversampling;
487}
489 this->pressure_oversampling_ = pressure_oversampling;
490}
492 this->humidity_oversampling_ = humidity_oversampling;
493}
494void BME680Component::set_heater(uint16_t heater_temperature, uint16_t heater_duration) {
495 this->heater_temperature_ = heater_temperature;
496 this->heater_duration_ = heater_duration;
497}
498
499} // namespace esphome::bme680
void mark_failed()
Mark this component as failed.
bool status_comm_result(bool ok)
Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok.
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
Definition component.cpp:96
uint8_t calc_heater_duration_(uint16_t duration)
Calculate the heater duration value to send to the BME680 register.
Definition bme680.cpp:269
void read_data_()
Read data from the BME680 and publish results.
Definition bme680.cpp:285
sensor::Sensor * humidity_sensor_
Definition bme680.h:134
uint8_t calc_heater_resistance_(uint16_t temperature)
Calculate the heater resistance value to send to the BME680 register.
Definition bme680.cpp:238
float calc_humidity_(uint16_t raw_humidity)
Calculate the relative humidity in % using the provided raw ADC value.
Definition bme680.cpp:409
BME680Oversampling pressure_oversampling_
Definition bme680.h:126
bool setup_registers_()
Configure the sensor registers; false on an I2C failure.
Definition bme680.cpp:80
BME680CalibrationData calibration_
Definition bme680.h:124
void set_pressure_oversampling(BME680Oversampling pressure_oversampling)
Set the pressure oversampling value. Defaults to 16X.
Definition bme680.cpp:488
BME680Oversampling temperature_oversampling_
Definition bme680.h:125
BME680Oversampling humidity_oversampling_
Definition bme680.h:127
void set_temperature_oversampling(BME680Oversampling temperature_oversampling)
Set the temperature oversampling value. Defaults to 16X.
Definition bme680.cpp:485
sensor::Sensor * temperature_sensor_
Definition bme680.h:132
float calc_gas_resistance_(uint16_t raw_gas, uint8_t range)
Calculate the gas resistance in Ω using the provided raw ADC value.
Definition bme680.cpp:445
void set_heater(uint16_t heater_temperature, uint16_t heater_duration)
Set how the internal heater should operate.
Definition bme680.cpp:494
sensor::Sensor * pressure_sensor_
Definition bme680.h:133
uint32_t calc_meas_duration_()
Calculate how long the sensor will take until we can retrieve data.
Definition bme680.cpp:462
float calc_temperature_(uint32_t raw_temperature)
Calculate the temperature in °C using the provided raw ADC value.
Definition bme680.cpp:341
void set_humidity_oversampling(BME680Oversampling humidity_oversampling)
Set the humidity oversampling value. Defaults to 16X.
Definition bme680.cpp:491
float calc_pressure_(uint32_t raw_pressure)
Calculate the pressure in hPa using the provided raw ADC value.
Definition bme680.cpp:367
sensor::Sensor * gas_resistance_sensor_
Definition bme680.h:135
BME680IIRFilter iir_filter_
Definition bme680.h:128
bool write_byte(uint8_t a_register, uint8_t data) const
Definition i2c.h:312
bool read_byte(uint8_t a_register, uint8_t *data)
Definition i2c.h:272
bool read_bytes(uint8_t a_register, uint8_t *data, uint8_t len)
Compat APIs All methods below have been added for compatibility reasons.
Definition i2c.h:249
void publish_state(float state)
Publish a new state to the front-end.
Definition sensor.cpp:65
Range range
Definition msa3xx.h:0
uint8_t duration
Definition msa3xx.h:0
const char * iir_filter_to_str(BME280IIRFilter filter)
BME680IIRFilter
Enum listing all IIR Filter options for the BME680.
Definition bme680.h:10
@ BME680_IIR_FILTER_63X
Definition bme680.h:17
@ BME680_IIR_FILTER_15X
Definition bme680.h:15
@ BME680_IIR_FILTER_OFF
Definition bme680.h:11
@ BME680_IIR_FILTER_3X
Definition bme680.h:13
@ BME680_IIR_FILTER_31X
Definition bme680.h:16
@ BME680_IIR_FILTER_127X
Definition bme680.h:18
@ BME680_IIR_FILTER_7X
Definition bme680.h:14
@ BME680_IIR_FILTER_1X
Definition bme680.h:12
constexpr float BME680_GAS_LOOKUP_TABLE_1[16] PROGMEM
Definition bme680.cpp:27
BME680Oversampling
Enum listing all oversampling options for the BME680.
Definition bme680.h:22
@ BME680_OVERSAMPLING_2X
Definition bme680.h:25
@ BME680_OVERSAMPLING_4X
Definition bme680.h:26
@ BME680_OVERSAMPLING_16X
Definition bme680.h:28
@ BME680_OVERSAMPLING_NONE
Definition bme680.h:23
@ BME680_OVERSAMPLING_8X
Definition bme680.h:27
@ BME680_OVERSAMPLING_1X
Definition bme680.h:24
ESPHOME_LOG_TAG(TAG, "bme680.sensor")
constexpr T encode_value_le(const uint8_t *bytes)
Encode a value from its constituent bytes (from least to most significant) in an array with length si...
Definition helpers.h:1039
constexpr T encode_value(const uint8_t *bytes)
Encode a value from its constituent bytes (from most to least significant) in an array with length si...
Definition helpers.h:1019
static void uint32_t
uint16_t temperature
Definition sun_gtil2.cpp:12
uint8_t pressure
Definition tt21100.cpp:7