Lines Matching +full:conversion +full:- +full:rate
4 * SPDX-License-Identifier: Apache-2.0
80 ret = i2c_burst_read_dt(&cfg->bus, reg, (uint8_t *)val, sizeof(*val)); in max31875_reg_read()
94 return i2c_burst_write_dt(&cfg->bus, reg, (uint8_t *)&val_be, 2); in max31875_reg_write()
100 return (data->config_reg & ~mask) | (value & mask); in set_config_flags()
106 const struct max31875_config *cfg = dev->config; in max31875_update_config()
107 struct max31875_data *data = dev->data; in max31875_update_config()
114 data->config_reg = new_val; in max31875_update_config()
130 return -ENOTSUP; in max31875_attr_set()
135 /* the sensor supports two ranges -50 to 128 and -50 to 150 */ in max31875_attr_set()
137 if (val->val1 == 128) { in max31875_attr_set()
139 } else if (val->val1 == 150) { in max31875_attr_set()
142 return -ENOTSUP; in max31875_attr_set()
152 /* conversion rate in mHz */ in max31875_attr_set()
153 cr = val->val1 * 1000 + val->val2 / 1000; in max31875_attr_set()
156 /* conversion rate */ in max31875_attr_set()
175 return -ENOTSUP; in max31875_attr_set()
187 return -ENOTSUP; in max31875_attr_set()
196 struct max31875_data *data = dev->data; in max31875_sample_fetch()
197 const struct max31875_config *cfg = dev->config; in max31875_sample_fetch()
203 return -ENOTSUP; in max31875_sample_fetch()
211 if (data->config_reg & BIT(MAX31875_DATA_FORMAT_SHIFT)) { in max31875_sample_fetch()
212 data->sample = arithmetic_shift_right((int16_t)val, in max31875_sample_fetch()
215 data->sample = arithmetic_shift_right((int16_t)val, in max31875_sample_fetch()
226 struct max31875_data *data = dev->data; in max31875_channel_get()
230 return -ENOTSUP; in max31875_channel_get()
233 uval = data->sample * MAX31875_TEMP_SCALE; in max31875_channel_get()
234 val->val1 = uval / 1000000; in max31875_channel_get()
235 val->val2 = uval % 1000000; in max31875_channel_get()
248 const struct max31875_config *cfg = dev->config; in max31875_init()
249 struct max31875_data *data = dev->data; in max31875_init()
251 if (!device_is_ready(cfg->bus.bus)) { in max31875_init()
252 LOG_ERR("I2C dev %s not ready", cfg->bus.bus->name); in max31875_init()
253 return -ENODEV; in max31875_init()
256 data->config_reg = MAX31875_CONFIG(cfg->data_format, cfg->resolution, in max31875_init()
257 cfg->conversions_per_second); in max31875_init()