Lines Matching +full:2 +full:fs

42 			/* High Accuracy 2 */
72 static const uint16_t lsm6dsv16x_accel_fs_map[] = {2, 4, 8, 16};
89 static const uint16_t lsm6dsv16x_gyro_fs_sens[] = {1, 2, 4, 8, 16, 0, 0, 0, 0, 0, 0, 0, 32};
91 int lsm6dsv16x_calc_accel_gain(uint8_t fs) in lsm6dsv16x_calc_accel_gain() argument
93 return lsm6dsv16x_accel_fs_map[fs] * GAIN_UNIT_XL / 2; in lsm6dsv16x_calc_accel_gain()
96 int lsm6dsv16x_calc_gyro_gain(uint8_t fs) in lsm6dsv16x_calc_gyro_gain() argument
98 return lsm6dsv16x_gyro_fs_sens[fs] * GAIN_UNIT_G; in lsm6dsv16x_calc_gyro_gain()
114 static int lsm6dsv16x_accel_set_fs_raw(const struct device *dev, uint8_t fs) in lsm6dsv16x_accel_set_fs_raw() argument
121 switch (fs) { in lsm6dsv16x_accel_set_fs_raw()
128 case 2: in lsm6dsv16x_accel_set_fs_raw()
142 data->accel_fs = fs; in lsm6dsv16x_accel_set_fs_raw()
162 static int lsm6dsv16x_gyro_set_fs_raw(const struct device *dev, uint8_t fs) in lsm6dsv16x_gyro_set_fs_raw() argument
168 if (lsm6dsv16x_gy_full_scale_set(ctx, fs) < 0) { in lsm6dsv16x_gyro_set_fs_raw()
172 data->gyro_fs = fs; in lsm6dsv16x_gyro_set_fs_raw()
207 int fs; in lsm6dsv16x_accel_range_set() local
210 fs = lsm6dsv16x_accel_range_to_fs_val(range); in lsm6dsv16x_accel_range_set()
211 if (fs < 0) { in lsm6dsv16x_accel_range_set()
212 return fs; in lsm6dsv16x_accel_range_set()
215 if (lsm6dsv16x_accel_set_fs_raw(dev, fs) < 0) { in lsm6dsv16x_accel_range_set()
220 data->acc_gain = lsm6dsv16x_calc_accel_gain(fs); in lsm6dsv16x_accel_range_set()
249 case 4: /* Low Power 2 */ in lsm6dsv16x_accel_config()
297 int fs; in lsm6dsv16x_gyro_range_set() local
300 fs = lsm6dsv16x_gyro_range_to_fs_val(range); in lsm6dsv16x_gyro_range_set()
301 if (fs < 0) { in lsm6dsv16x_gyro_range_set()
302 return fs; in lsm6dsv16x_gyro_range_set()
305 if (lsm6dsv16x_gyro_set_fs_raw(dev, fs) < 0) { in lsm6dsv16x_gyro_range_set()
310 data->gyro_gain = lsm6dsv16x_calc_gyro_gain(fs); in lsm6dsv16x_gyro_range_set()
633 /* Convert to m/s^2 */ in lsm6dsv16x_accel_convert()
653 lsm6dsv16x_accel_convert(val, data->acc[2], sensitivity); in lsm6dsv16x_accel_get_channel()
700 lsm6dsv16x_gyro_convert(val, data->gyro[2], sensitivity); in lsm6dsv16x_gyro_get_channel()
764 sample[1] = (int16_t)(data->ext_data[idx][2] | in lsm6dsv16x_magn_get_channel()
766 sample[2] = (int16_t)(data->ext_data[idx][4] | in lsm6dsv16x_magn_get_channel()
777 lsm6dsv16x_magn_convert(val, sample[2], data->magn_gain); in lsm6dsv16x_magn_get_channel()
782 lsm6dsv16x_magn_convert(val + 2, sample[2], data->magn_gain); in lsm6dsv16x_magn_get_channel()
831 (data->ext_data[idx][2] << 16)); in lsm6dsv16x_press_convert()
952 uint8_t odr, fs; in lsm6dsv16x_init_chip() local
1011 fs = cfg->accel_range; in lsm6dsv16x_init_chip()
1012 LOG_DBG("accel range is %d", fs); in lsm6dsv16x_init_chip()
1013 if (lsm6dsv16x_accel_set_fs_raw(dev, fs) < 0) { in lsm6dsv16x_init_chip()
1014 LOG_ERR("failed to set accelerometer range %d", fs); in lsm6dsv16x_init_chip()
1017 lsm6dsv16x->acc_gain = lsm6dsv16x_calc_accel_gain(fs); in lsm6dsv16x_init_chip()
1026 fs = cfg->gyro_range; in lsm6dsv16x_init_chip()
1027 LOG_DBG("gyro range is %d", fs); in lsm6dsv16x_init_chip()
1028 if (lsm6dsv16x_gyro_set_fs_raw(dev, fs) < 0) { in lsm6dsv16x_init_chip()
1029 LOG_ERR("failed to set gyroscope range %d", fs); in lsm6dsv16x_init_chip()
1032 lsm6dsv16x->gyro_gain = lsm6dsv16x_calc_gyro_gain(fs); in lsm6dsv16x_init_chip()