Lines Matching +full:channel +full:- +full:sens
4 * SPDX-License-Identifier: Apache-2.0
27 int64_t SENS; in ms5607_compensate() local
34 * (https://www.te.com/usa-en/product-CAT-BLPS0035.html) section in ms5607_compensate()
38 dT = adc_temperature - ((int32_t)(data->t_ref) << 8); in ms5607_compensate()
39 data->temperature = 2000 + (dT * data->tempsens) / (1ll << 23); in ms5607_compensate()
40 OFF = ((int64_t)(data->off_t1) << 17) + (dT * data->tco) / (1ll << 6); in ms5607_compensate()
41 SENS = ((int64_t)(data->sens_t1) << 16) + (dT * data->tcs) / (1ll << 7); in ms5607_compensate()
44 * (https://www.te.com/usa-en/product-CAT-BLPS0035.html) section in ms5607_compensate()
48 temp_sq = (int64_t)(data->temperature - 2000) * in ms5607_compensate()
49 (int64_t)(data->temperature - 2000); in ms5607_compensate()
50 if (data->temperature < 2000) { in ms5607_compensate()
54 if (data->temperature < -1500) { in ms5607_compensate()
55 temp_sq = (int64_t)(data->temperature + 1500) * in ms5607_compensate()
56 (int64_t)(data->temperature + 1500); in ms5607_compensate()
66 OFF -= OFFi; in ms5607_compensate()
67 SENS -= SENSi; in ms5607_compensate()
69 data->temperature -= Ti; in ms5607_compensate()
70 data->pressure = (SENS * (int64_t)adc_pressure / (1ll << 21) - OFF) / in ms5607_compensate()
79 err = config->tf->read_prom(config, cmd, val); in ms5607_read_prom()
97 err = config->tf->start_conversion(config, cmd); in ms5607_get_measurement()
104 err = config->tf->read_adc(config, val); in ms5607_get_measurement()
113 enum sensor_channel channel) in ms5607_sample_fetch() argument
115 const struct ms5607_config *config = dev->config; in ms5607_sample_fetch()
116 struct ms5607_data *data = dev->data; in ms5607_sample_fetch()
120 __ASSERT_NO_MSG(channel == SENSOR_CHAN_ALL); in ms5607_sample_fetch()
124 data->pressure_conv_cmd, in ms5607_sample_fetch()
125 data->pressure_conv_delay); in ms5607_sample_fetch()
132 data->temperature_conv_cmd, in ms5607_sample_fetch()
133 data->temperature_conv_delay); in ms5607_sample_fetch()
146 const struct ms5607_data *data = dev->data; in ms5607_channel_get()
150 val->val1 = data->temperature / 100; in ms5607_channel_get()
151 val->val2 = data->temperature % 100 * 10000; in ms5607_channel_get()
154 val->val1 = data->pressure / 100; in ms5607_channel_get()
155 val->val2 = data->pressure % 100 * 10000; in ms5607_channel_get()
158 return -ENOTSUP; in ms5607_channel_get()
168 struct ms5607_data *data = dev->data; in ms5607_attr_set()
172 return -ENOTSUP; in ms5607_attr_set()
175 switch (val->val1) { in ms5607_attr_set()
202 LOG_ERR("invalid oversampling rate %d", val->val1); in ms5607_attr_set()
203 return -EINVAL; in ms5607_attr_set()
208 data->pressure_conv_cmd = p_conv_cmd; in ms5607_attr_set()
209 data->temperature_conv_cmd = t_conv_cmd; in ms5607_attr_set()
210 data->temperature_conv_delay = conv_delay; in ms5607_attr_set()
211 data->pressure_conv_delay = conv_delay; in ms5607_attr_set()
214 data->pressure_conv_cmd = p_conv_cmd; in ms5607_attr_set()
215 data->pressure_conv_delay = conv_delay; in ms5607_attr_set()
218 data->temperature_conv_cmd = t_conv_cmd; in ms5607_attr_set()
219 data->temperature_conv_delay = conv_delay; in ms5607_attr_set()
222 return -ENOTSUP; in ms5607_attr_set()
230 const struct ms5607_config *const config = dev->config; in ms5607_init()
231 struct ms5607_data *data = dev->data; in ms5607_init()
235 err = config->tf->bus_check(config); in ms5607_init()
240 data->pressure = 0; in ms5607_init()
241 data->temperature = 0; in ms5607_init()
258 err = config->tf->reset(config); in ms5607_init()
266 &data->off_t1); in ms5607_init()
271 LOG_DBG("OFF_T1: %d", data->off_t1); in ms5607_init()
274 &data->sens_t1); in ms5607_init()
279 LOG_DBG("SENSE_T1: %d", data->sens_t1); in ms5607_init()
281 err = ms5607_read_prom(config, MS5607_CMD_CONV_READ_T_REF, &data->t_ref); in ms5607_init()
286 LOG_DBG("T_REF: %d", data->t_ref); in ms5607_init()
288 err = ms5607_read_prom(config, MS5607_CMD_CONV_READ_TCO, &data->tco); in ms5607_init()
293 LOG_DBG("TCO: %d", data->tco); in ms5607_init()
295 err = ms5607_read_prom(config, MS5607_CMD_CONV_READ_TCS, &data->tcs); in ms5607_init()
300 LOG_DBG("TCS: %d", data->tcs); in ms5607_init()
303 &data->tempsens); in ms5607_init()
308 LOG_DBG("TEMPSENS: %d", data->tempsens); in ms5607_init()
339 * Main instantiation macro, which selects the correct bus-specific