Lines Matching +full:scaling +full:- +full:x +full:- +full:resolution

4  * SPDX-License-Identifier: Apache-2.0
72 /* The sensor device returns 10^-9 Teslas after scaling. in ak8963_convert_magn()
80 return -EOVERFLOW; in ak8963_convert_magn()
85 val->val1 = scaled_val / 1000000; in ak8963_convert_magn()
86 val->val2 = scaled_val % 1000000; in ak8963_convert_magn()
96 const struct mpu9250_config *cfg = dev->config; in ak8963_execute_rw()
106 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_execute_rw()
115 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_execute_rw()
124 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_execute_rw()
134 ret = i2c_reg_read_byte_dt(&cfg->i2c, in ak8963_execute_rw()
147 const struct mpu9250_config *cfg = dev->config; in ak8963_read_reg()
158 ret = i2c_reg_read_byte_dt(&cfg->i2c, in ak8963_read_reg()
170 const struct mpu9250_config *cfg = dev->config; in ak8963_write_reg()
174 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_write_reg()
215 * -> 0.1499 * 10^4 = 1499 in ak8963_calc_adj()
216 * So if we multiply with scaling with 1499 the unit is uG. in ak8963_calc_adj()
218 * Calculation from MPU-9250 Register Map and Descriptions in ak8963_calc_adj()
219 * adj = (((val-128)*0.5)/128)+1 in ak8963_calc_adj()
221 return ((AK9863_SCALE_TO_UG * (val - 128)) / 256) + AK9863_SCALE_TO_UG; in ak8963_calc_adj()
227 struct mpu9250_data *drv_data = dev->data; in ak8963_fetch_adj()
243 drv_data->magn_scale_x = ak8963_calc_adj(buf); in ak8963_fetch_adj()
250 drv_data->magn_scale_y = ak8963_calc_adj(buf); in ak8963_fetch_adj()
257 drv_data->magn_scale_z = ak8963_calc_adj(buf); in ak8963_fetch_adj()
266 LOG_DBG("Adjustment values %d %d %d", drv_data->magn_scale_x, in ak8963_fetch_adj()
267 drv_data->magn_scale_y, drv_data->magn_scale_z); in ak8963_fetch_adj()
276 /* Reset the chip -> reset all settings. */ in ak8963_reset()
292 const struct mpu9250_config *cfg = dev->config; in ak8963_init_master()
296 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_master()
305 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_master()
318 const struct mpu9250_config *cfg = dev->config; in ak8963_init_readout()
322 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_readout()
331 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_readout()
339 ret = i2c_reg_write_byte_dt(&cfg->i2c, in ak8963_init_readout()
375 LOG_ERR("Invalid AK8963 chip id (0x%X).", buf); in ak8963_init()
376 return -ENOTSUP; in ak8963_init()
386 /* Set AK sample rate and resolution */ in ak8963_init()