mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 17:05:21 +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_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_FIELD0 = 0x1D;
|
||||
|
@ -120,6 +122,9 @@ void BME680Component::setup() {
|
|||
this->mark_failed();
|
||||
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)) {
|
||||
this->mark_failed();
|
||||
return;
|
||||
|
@ -128,6 +133,8 @@ void BME680Component::setup() {
|
|||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
&this->calibration_.range_sw_err &= BME680_RSERROR_MSK;
|
||||
&this->calibration_.range_sw_err /= 16;
|
||||
|
||||
this->calibration_.ambient_temperature = 25; // prime ambient temperature
|
||||
|
||||
|
|
Loading…
Reference in a new issue