18 uint8_t coef_data_raw[DPS310_NUM_COEF_REGS];
19 auto timer = DPS310_INIT_TIMEOUT;
22 if (!this->
write_byte(DPS310_REG_RESET, DPS310_CMD_RESET)) {
27 while (timer-- && (!(
reg & DPS310_BIT_SENSOR_RDY) || !(
reg & DPS310_BIT_COEF_RDY))) {
32 if (!(
reg & DPS310_BIT_SENSOR_RDY) || !(
reg & DPS310_BIT_COEF_RDY)) {
40 if (!this->
read_bytes(DPS310_REG_COEF, coef_data_raw, DPS310_NUM_COEF_REGS)) {
48 if (!this->
write_byte(DPS310_REG_PRS_CFG, DPS310_VAL_PRS_CFG)) {
51 if (!this->
write_byte(DPS310_REG_TMP_CFG, DPS310_VAL_TMP_CFG | (
reg & DPS310_BIT_TMP_COEF_SRC))) {
54 if (!this->
write_byte(DPS310_REG_CFG, DPS310_VAL_REG_CFG)) {
57 if (!this->
write_byte(DPS310_REG_MEAS_CFG, 0x07)) {
144 const float t_raw_sc = (float) raw_temperature / DPS310_SCALE_FACTOR;
145 const float p_raw_sc = (float) raw_pressure / DPS310_SCALE_FACTOR;
150 t_raw_sc * this->
c01_ + t_raw_sc * p_raw_sc * (this->
c11_ + p_raw_sc * this->
c21_)) /
153 PUBLISH_STATE(this->temperature_sensor_,
temperature);
154 PUBLISH_STATE(this->pressure_sensor_,
pressure);