/* Scale and temperature compensate the raw pressure measurement value to Kilopascal. The formula is based on the Chapter 4.9.1 in the datasheet.  */
static void dps310_scale_pressure(const struct device *dev, int32_t tmp_raw, int32_t psr_raw)
/* Scale and temperature compensate the raw pressure measurement value to Kilopascal. The formula is based on the Chapter 4.9.1 in the datasheet.  */
static void dps310_scale_pressure(const struct device *dev, int32_t tmp_raw, int32_t psr_raw)
{
	struct dps310_data *data = dev->data;
	const struct dps310_cal_coeff *comp = &data->comp;
	float psr = ((float)psr_raw) / IFX_DPS310_SF_PSR;
	float tmp = ((float)tmp_raw) / IFX_DPS310_SF_TMP;
	float psr_final = comp->c00;
	psr_final += psr * (comp->c10 + psr * (comp->c20 + psr * comp->c30));
	psr_final += tmp * comp->c01;
	psr_final += tmp * psr * (comp->c11 + psr * comp->c21);
	psr_final /= 1000;
	data->psr_val1 = psr_final;
	data->psr_val2 = (psr_final - data->psr_val1) * 1000000;
}