Lines Matching +full:conversion +full:- +full:rate
4 * SPDX-License-Identifier: Apache-2.0
22 const struct max44009_config *config = dev->config; in max44009_reg_read()
40 if (i2c_transfer_dt(&config->i2c, msgs, 2) != 0) { in max44009_reg_read()
41 return -EIO; in max44009_reg_read()
50 const struct max44009_config *config = dev->config; in max44009_reg_write()
53 return i2c_write_dt(&config->i2c, tx_buf, sizeof(tx_buf)); in max44009_reg_write()
63 return -EIO; in max44009_reg_update()
81 return -ENOTSUP; in max44009_attr_set()
86 /* convert rate to mHz */ in max44009_attr_set()
87 cr = val->val1 * 1000 + val->val2 / 1000; in max44009_attr_set()
89 /* the sensor supports 1.25Hz or continuous conversion */ in max44009_attr_set()
102 return -EIO; in max44009_attr_set()
108 return -ENOTSUP; in max44009_attr_set()
117 struct max44009_data *drv_data = dev->data; in max44009_sample_fetch()
122 drv_data->sample = 0U; in max44009_sample_fetch()
126 return -EIO; in max44009_sample_fetch()
131 return -EIO; in max44009_sample_fetch()
134 drv_data->sample = ((uint16_t)val_h) << 8; in max44009_sample_fetch()
135 drv_data->sample += val_l; in max44009_sample_fetch()
144 struct max44009_data *drv_data = dev->data; in max44009_channel_get()
148 return -ENOTSUP; in max44009_channel_get()
156 uval = drv_data->sample; in max44009_channel_get()
159 uval = uval << (drv_data->sample >> MAX44009_SAMPLE_EXPONENT_SHIFT); in max44009_channel_get()
162 val->val1 = (uval * 45U) / 1000; in max44009_channel_get()
163 val->val2 = ((uval * 45U) % 1000) * 1000U; in max44009_channel_get()
176 const struct max44009_config *config = dev->config; in max44009_init()
178 if (!device_is_ready(config->i2c.bus)) { in max44009_init()
180 return -ENODEV; in max44009_init()