mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 23:18:10 +01:00
Add heater bit masks
This commit is contained in:
parent
797aadaf26
commit
c7629f106c
1 changed files with 7 additions and 0 deletions
|
@ -17,6 +17,8 @@ static const uint8_t BME680_REGISTER_CONTROL_GAS0 = 0x70;
|
||||||
static const uint8_t BME680_REGISTER_HEATER_HEAT0 = 0x5A;
|
static const uint8_t BME680_REGISTER_HEATER_HEAT0 = 0x5A;
|
||||||
static const uint8_t BME680_REGISTER_HEATER_WAIT0 = 0x64;
|
static const uint8_t BME680_REGISTER_HEATER_WAIT0 = 0x64;
|
||||||
|
|
||||||
|
static const uint8_t BME680_RHRANGE_MSK = 0x30;
|
||||||
|
static const uint8_t BME680_RSERROR_MSK = 0xf0;
|
||||||
static const uint8_t BME680_REGISTER_CHIPID = 0xD0;
|
static const uint8_t BME680_REGISTER_CHIPID = 0xD0;
|
||||||
|
|
||||||
static const uint8_t BME680_REGISTER_FIELD0 = 0x1D;
|
static const uint8_t BME680_REGISTER_FIELD0 = 0x1D;
|
||||||
|
@ -120,6 +122,9 @@ void BME680Component::setup() {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
&this->calibration_res_heat_range &= BME680_RHRANGE_MSK;
|
||||||
|
&this->calibration_res_heat_range /= 16;
|
||||||
|
|
||||||
if (!this->read_byte(0x00, &this->calibration_.res_heat_val)) {
|
if (!this->read_byte(0x00, &this->calibration_.res_heat_val)) {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
|
@ -128,6 +133,8 @@ void BME680Component::setup() {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
&this->calibration_.range_sw_err &= BME680_RSERROR_MSK;
|
||||||
|
&this->calibration_.range_sw_err /= 16;
|
||||||
|
|
||||||
this->calibration_.ambient_temperature = 25; // prime ambient temperature
|
this->calibration_.ambient_temperature = 25; // prime ambient temperature
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue