Lines Matching +full:chip +full:- +full:id

1 /* lps22hb.c - Driver for LPS22HB pressure and temperature sensor */
6 * SPDX-License-Identifier: Apache-2.0
25 const struct lps22hb_config *config = dev->config; in lps22hb_set_odr_raw()
27 return i2c_reg_update_byte_dt(&config->i2c, LPS22HB_REG_CTRL_REG1, in lps22hb_set_odr_raw()
35 struct lps22hb_data *data = dev->data; in lps22hb_sample_fetch()
36 const struct lps22hb_config *config = dev->config; in lps22hb_sample_fetch()
41 if (i2c_burst_read_dt(&config->i2c, LPS22HB_REG_PRESS_OUT_XL, in lps22hb_sample_fetch()
44 return -EIO; in lps22hb_sample_fetch()
47 data->sample_press = (int32_t)((uint32_t)(out[0]) | in lps22hb_sample_fetch()
50 data->sample_temp = (int16_t)((uint16_t)(out[3]) | in lps22hb_sample_fetch()
61 val->val1 = (raw_val >> 12) / 10; in lps22hb_press_convert()
62 val->val2 = (raw_val >> 12) % 10 * 100000 + in lps22hb_press_convert()
70 val->val1 = raw_val / 100; in lps22hb_temp_convert()
71 val->val2 = ((int32_t)raw_val % 100) * 10000; in lps22hb_temp_convert()
78 struct lps22hb_data *data = dev->data; in lps22hb_channel_get()
81 lps22hb_press_convert(val, data->sample_press); in lps22hb_channel_get()
83 lps22hb_temp_convert(val, data->sample_temp); in lps22hb_channel_get()
85 return -ENOTSUP; in lps22hb_channel_get()
98 const struct lps22hb_config *config = dev->config; in lps22hb_init_chip()
101 if (i2c_reg_read_byte_dt(&config->i2c, LPS22HB_REG_WHO_AM_I, in lps22hb_init_chip()
103 LOG_DBG("Failed reading chip id"); in lps22hb_init_chip()
108 LOG_DBG("Invalid chip id 0x%x", chip_id); in lps22hb_init_chip()
117 if (i2c_reg_update_byte_dt(&config->i2c, LPS22HB_REG_CTRL_REG1, in lps22hb_init_chip()
127 return -EIO; in lps22hb_init_chip()
132 const struct lps22hb_config * const config = dev->config; in lps22hb_init()
134 if (!device_is_ready(config->i2c.bus)) { in lps22hb_init()
136 return -ENODEV; in lps22hb_init()
140 LOG_DBG("Failed to initialize chip"); in lps22hb_init()
141 return -EIO; in lps22hb_init()