Lines Matching +full:chip +full:- +full:id
1 /* lps25hb.c - Driver for LPS25HB pressure and temperature sensor */
6 * SPDX-License-Identifier: Apache-2.0
25 const struct lps25hb_config *config = dev->config; in lps25hb_power_ctrl()
27 return i2c_reg_update_byte_dt(&config->i2c, LPS25HB_REG_CTRL_REG1, in lps25hb_power_ctrl()
34 const struct lps25hb_config *config = dev->config; in lps25hb_set_odr_raw()
36 return i2c_reg_update_byte_dt(&config->i2c, LPS25HB_REG_CTRL_REG1, in lps25hb_set_odr_raw()
44 struct lps25hb_data *data = dev->data; in lps25hb_sample_fetch()
45 const struct lps25hb_config *config = dev->config; in lps25hb_sample_fetch()
52 if (i2c_reg_read_byte_dt(&config->i2c, in lps25hb_sample_fetch()
56 return -EIO; in lps25hb_sample_fetch()
60 data->sample_press = (int32_t)((uint32_t)(out[0]) | in lps25hb_sample_fetch()
63 data->sample_temp = (int16_t)((uint16_t)(out[3]) | in lps25hb_sample_fetch()
74 val->val1 = raw_val / 40960; in lps25hb_press_convert()
79 val->val2 = (raw_val % 40960) * 3125 / 128; in lps25hb_press_convert()
89 val->val1 = (raw_val * 10 / 480 + 425) / 10; in lps25hb_temp_convert()
90 val->val2 = uval % 1000000; in lps25hb_temp_convert()
97 struct lps25hb_data *data = dev->data; in lps25hb_channel_get()
100 lps25hb_press_convert(val, data->sample_press); in lps25hb_channel_get()
102 lps25hb_temp_convert(val, data->sample_temp); in lps25hb_channel_get()
104 return -ENOTSUP; in lps25hb_channel_get()
117 const struct lps25hb_config *config = dev->config; in lps25hb_init_chip()
125 return -EIO; in lps25hb_init_chip()
130 if (i2c_reg_read_byte_dt(&config->i2c, LPS25HB_REG_WHO_AM_I, in lps25hb_init_chip()
132 LOG_DBG("failed reading chip id"); in lps25hb_init_chip()
136 LOG_DBG("invalid chip id 0x%x", chip_id); in lps25hb_init_chip()
140 LOG_DBG("chip id 0x%x", chip_id); in lps25hb_init_chip()
148 if (i2c_reg_update_byte_dt(&config->i2c, LPS25HB_REG_CTRL_REG1, in lps25hb_init_chip()
159 return -EIO; in lps25hb_init_chip()
164 const struct lps25hb_config * const config = dev->config; in lps25hb_init()
166 if (!device_is_ready(config->i2c.bus)) { in lps25hb_init()
168 return -ENODEV; in lps25hb_init()
172 LOG_DBG("failed to initialize chip"); in lps25hb_init()
173 return -EIO; in lps25hb_init()