Lines Matching +full:measurement +full:- +full:mode

4  * SPDX-License-Identifier: Apache-2.0
61 /* ambient temperature measurement command for each mode.
62 * (Section 5.2 MEASUREMENT COMMANDS in the Datasheet)
68 /* pressure measurement command for each mode.
69 * (Section 5.2 MEASUREMENT COMMANDS in the Datasheet)
76 * (Section 5.2 MEASUREMENT COMMANDS in the Datasheet)
110 *C = (p_LUT[0] * p_LUT[1] * (p_Pa[0] - p_Pa[1]) + in icp10125_calculate_conversion_constants()
111 p_LUT[1] * p_LUT[2] * (p_Pa[1] - p_Pa[2]) + in icp10125_calculate_conversion_constants()
112 p_LUT[2] * p_LUT[0] * (p_Pa[2] - p_Pa[0])) / in icp10125_calculate_conversion_constants()
113 (p_LUT[2] * (p_Pa[0] - p_Pa[1]) + p_LUT[0] * (p_Pa[1] - p_Pa[2]) + in icp10125_calculate_conversion_constants()
114 p_LUT[1] * (p_Pa[2] - p_Pa[0])); in icp10125_calculate_conversion_constants()
115 *A = (p_Pa[0] * p_LUT[0] - p_Pa[1] * p_LUT[1] - (p_Pa[1] - p_Pa[0]) * (*C)) / in icp10125_calculate_conversion_constants()
116 (p_LUT[0] - p_LUT[1]); in icp10125_calculate_conversion_constants()
117 *B = (p_Pa[0] - (*A)) * (p_LUT[0] + (*C)); in icp10125_calculate_conversion_constants()
122 return -45.f + 175.f / 65536.f * data->raw_ambient_temp; in icp10125_calc_calibrated_ambient_temp()
135 t = data->raw_ambient_temp - 32768.f; in icp10125_calc_calibrated_press()
136 in[0] = LUT_lower + (data->sensor_constants[0] * t * t) * quadr_factor; in icp10125_calc_calibrated_press()
137 in[1] = offst_factor * data->sensor_constants[3] + in icp10125_calc_calibrated_press()
138 (data->sensor_constants[1] * t * t) * quadr_factor; in icp10125_calc_calibrated_press()
139 in[2] = LUT_upper + (data->sensor_constants[2] * t * t) * quadr_factor; in icp10125_calc_calibrated_press()
142 return A + B / (C + data->raw_press); in icp10125_calc_calibrated_press()
149 struct icp10125_data *data = dev->data; in icp10125_read_otp()
152 const struct icp10125_dev_config *cfg = dev->config; in icp10125_read_otp()
155 rc = i2c_write_dt(&cfg->i2c, (uint8_t *)&otp_read_setup, sizeof(otp_read_setup)); in icp10125_read_otp()
161 for (size_t i = 0; i < ARRAY_SIZE(data->sensor_constants); i++) { in icp10125_read_otp()
162 rc = i2c_write_dt(&cfg->i2c, (uint8_t *)&otp_read_request_cmd, in icp10125_read_otp()
169 rc = i2c_read_dt(&cfg->i2c, (uint8_t *)&sensor_data, sizeof(sensor_data)); in icp10125_read_otp()
175 data->sensor_constants[i] = sys_get_be16(sensor_data.data); in icp10125_read_otp()
192 const uint8_t mode, struct icp10125_sensor_data *sensor_data, in icp10125_measure() argument
197 rc = i2c_write_dt(i2c, (uint8_t *)&cmds[mode], sizeof(cmds[mode])); in icp10125_measure()
199 LOG_ERR("Failed to start measurement.\n"); in icp10125_measure()
207 k_sleep(K_USEC(conv_time_typ[mode])); in icp10125_measure()
209 k_sleep(K_USEC(conv_time_max[mode] - conv_time_typ[mode])); in icp10125_measure()
212 LOG_ERR("Failed to read measurement.\n"); in icp10125_measure()
222 return -EIO; in icp10125_measure()
232 struct icp10125_data *data = dev->data; in icp10125_sample_fetch()
233 const struct icp10125_dev_config *cfg = dev->config; in icp10125_sample_fetch()
240 return -ENOTSUP; in icp10125_sample_fetch()
244 rc = icp10125_measure(&cfg->i2c, ambient_temp_measurement_cmds, in icp10125_sample_fetch()
245 cfg->ambient_temp_mode, sensor_data, AMBIENT_TEMP_DATA_NUM); in icp10125_sample_fetch()
250 data->raw_ambient_temp = sys_get_be16(sensor_data[0].data); in icp10125_sample_fetch()
252 rc = icp10125_measure(&cfg->i2c, press_measurement_cmds, cfg->press_mode, in icp10125_sample_fetch()
261 data->raw_press = sys_get_be24(endian_conversion); in icp10125_sample_fetch()
262 data->raw_ambient_temp = sys_get_be16(sensor_data[2].data); in icp10125_sample_fetch()
282 struct icp10125_data *data = dev->data; in icp10125_channel_get()
289 return -ENOTSUP; in icp10125_channel_get()