Lines Matching +full:sample +full:- +full:point +full:- +full:data
4 * SPDX-License-Identifier: Apache-2.0
16 const struct tcn75a_config *config = dev->config; in tcn75a_sample_fetch()
17 struct tcn75a_data *data = dev->data; in tcn75a_sample_fetch() local
24 return -ENOTSUP; in tcn75a_sample_fetch()
27 if (config->oneshot_mode) { in tcn75a_sample_fetch()
30 ret = i2c_write_dt(&config->i2c_spec, adc_conf, 2); in tcn75a_sample_fetch()
36 /* Fetch a sample from the 2 byte ambient temperature register */ in tcn75a_sample_fetch()
37 ret = i2c_write_read_dt(&config->i2c_spec, &temp_reg, sizeof(temp_reg), in tcn75a_sample_fetch()
43 data->temp_sample = sys_get_be16(rx_buf); in tcn75a_sample_fetch()
44 LOG_DBG("Raw sample: 0x%04x", data->temp_sample); in tcn75a_sample_fetch()
52 struct tcn75a_data *data = dev->data; in tcn75a_channel_get() local
56 return -ENOTSUP; in tcn75a_channel_get()
59 /* Convert fixed point to sensor value */ in tcn75a_channel_get()
60 val->val1 = data->temp_sample >> TCN75A_TEMP_MSB_POS; in tcn75a_channel_get()
61 temp_lsb = (data->temp_sample & TCN75A_TEMP_LSB_MASK); in tcn75a_channel_get()
62 val->val2 = TCN75A_FIXED_PT_TO_SENSOR(temp_lsb); in tcn75a_channel_get()
78 const struct tcn75a_config *config = dev->config; in tcn75a_init()
81 if (!i2c_is_ready_dt(&config->i2c_spec)) { in tcn75a_init()
83 return -ENODEV; in tcn75a_init()
87 adc_conf[1] |= TCN75A_CONFIG_RES(config->resolution); in tcn75a_init()
89 if (config->oneshot_mode) { in tcn75a_init()
93 return -ENODEV; in tcn75a_init()
100 if (config->alert_gpios.port != NULL) { in tcn75a_init()
103 if (config->oneshot_mode) { in tcn75a_init()
105 return -ENODEV; in tcn75a_init()
115 return i2c_write_dt(&config->i2c_spec, adc_conf, 2); in tcn75a_init()