Lines Matching +full:chip +full:- +full:id
4 * SPDX-License-Identifier: Apache-2.0
34 struct hts221_data *data = dev->data; in hts221_channel_get()
42 conv_val = (int32_t)(data->t1_degc_x8 - data->t0_degc_x8) * in hts221_channel_get()
43 (data->t_sample - data->t0_out) / in hts221_channel_get()
44 (data->t1_out - data->t0_out) + in hts221_channel_get()
45 data->t0_degc_x8; in hts221_channel_get()
48 val->val1 = conv_val / 8; in hts221_channel_get()
49 val->val2 = (conv_val % 8) * (1000000 / 8); in hts221_channel_get()
51 conv_val = (int32_t)(data->h1_rh_x2 - data->h0_rh_x2) * in hts221_channel_get()
52 (data->rh_sample - data->h0_t0_out) / in hts221_channel_get()
53 (data->h1_t0_out - data->h0_t0_out) + in hts221_channel_get()
54 data->h0_rh_x2; in hts221_channel_get()
57 val->val1 = conv_val / 2; in hts221_channel_get()
58 val->val2 = (conv_val % 2) * 500000; in hts221_channel_get()
60 return -ENOTSUP; in hts221_channel_get()
69 struct hts221_data *data = dev->data; in hts221_sample_fetch()
70 const struct hts221_config *cfg = dev->config; in hts221_sample_fetch()
71 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in hts221_sample_fetch()
84 data->rh_sample = buf[0] | (buf[1] << 8); in hts221_sample_fetch()
85 data->t_sample = buf[2] | (buf[3] << 8); in hts221_sample_fetch()
92 struct hts221_data *data = dev->data; in hts221_read_conversion_data()
93 const struct hts221_config *cfg = dev->config; in hts221_read_conversion_data()
94 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in hts221_read_conversion_data()
105 data->h0_rh_x2 = buf[0]; in hts221_read_conversion_data()
106 data->h1_rh_x2 = buf[1]; in hts221_read_conversion_data()
107 data->t0_degc_x8 = buf[2] | ((buf[5] & 0x3) << 8); in hts221_read_conversion_data()
108 data->t1_degc_x8 = buf[3] | ((buf[5] & 0xC) << 6); in hts221_read_conversion_data()
109 data->h0_t0_out = buf[6] | (buf[7] << 8); in hts221_read_conversion_data()
110 data->h1_t0_out = buf[10] | (buf[11] << 8); in hts221_read_conversion_data()
111 data->t0_out = buf[12] | (buf[13] << 8); in hts221_read_conversion_data()
112 data->t1_out = buf[14] | (buf[15] << 8); in hts221_read_conversion_data()
127 const struct hts221_config *cfg = dev->config; in hts221_init()
128 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in hts221_init()
129 uint8_t id, idx; in hts221_init() local
132 /* check chip ID */ in hts221_init()
134 status = hts221_device_id_get(ctx, &id); in hts221_init()
136 LOG_ERR("Failed to read chip ID."); in hts221_init()
140 if (id != HTS221_ID) { in hts221_init()
141 LOG_ERR("Invalid chip ID."); in hts221_init()
142 return -EINVAL; in hts221_init()
154 return -EINVAL; in hts221_init()
263 * bus-specific macro at preprocessor time.