Lines Matching +full:i2c +full:- +full:command

4  * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/drivers/i2c.h>
32 const struct hs300x_config *cfg = dev->config; in hs300x_read_sample()
36 rc = i2c_read_dt(&cfg->bus, rx_buf, sizeof(rx_buf)); in hs300x_read_sample()
44 return -EIO; in hs300x_read_sample()
58 struct hs300x_data *data = dev->data; in hs300x_sample_fetch()
59 const struct hs300x_config *cfg = dev->config; in hs300x_sample_fetch()
65 return -ENOTSUP; in hs300x_sample_fetch()
69 * By default, the sensor should be factory-programmed to operate in Sleep Mode. in hs300x_sample_fetch()
70 * A Measurement Request (MR) command is required to exit the sensor in hs300x_sample_fetch()
71 * from its sleep state. An MR command should consist of the 7-bit address followed in hs300x_sample_fetch()
72 * by an eighth bit set to 0 (write). However, many I2C controllers cannot generate in hs300x_sample_fetch()
73 * merely the address byte with no data. To overcome this limitation the MR command in hs300x_sample_fetch()
76 rc = i2c_write_dt(&cfg->bus, (const uint8_t *)&df_dummy, 1); in hs300x_sample_fetch()
88 rc = hs300x_read_sample(dev, &data->t_sample, &data->rh_sample); in hs300x_sample_fetch()
105 micro_c = (((int64_t)raw * 165000000) / 16383) - 40000000; in hs300x_temp_convert()
107 val->val1 = micro_c / 1000000; in hs300x_temp_convert()
108 val->val2 = micro_c % 1000000; in hs300x_temp_convert()
121 val->val1 = micro_rh / 1000000; in hs300x_rh_convert()
122 val->val2 = micro_rh % 1000000; in hs300x_rh_convert()
128 const struct hs300x_data *data = dev->data; in hs300x_channel_get()
131 hs300x_temp_convert(val, data->t_sample); in hs300x_channel_get()
133 hs300x_rh_convert(val, data->rh_sample); in hs300x_channel_get()
135 return -ENOTSUP; in hs300x_channel_get()
143 const struct hs300x_config *cfg = dev->config; in hs300x_init()
145 if (!i2c_is_ready_dt(&cfg->bus)) { in hs300x_init()
146 LOG_ERR("I2C dev %s not ready", cfg->bus.bus->name); in hs300x_init()
147 return -ENODEV; in hs300x_init()