Lines Matching +full:2 +full:fs
52 static const uint16_t lsm6dso16is_accel_fs_map[] = {2, 16, 4, 8};
68 static const uint16_t lsm6dso16is_gyro_fs_sens[] = {2, 1, 4, 0, 8, 0, 16};
98 static int lsm6dso16is_accel_set_fs_raw(const struct device *dev, uint8_t fs) in lsm6dso16is_accel_set_fs_raw() argument
104 if (lsm6dso16is_xl_full_scale_set(ctx, fs) < 0) { in lsm6dso16is_accel_set_fs_raw()
108 data->accel_fs = fs; in lsm6dso16is_accel_set_fs_raw()
128 static int lsm6dso16is_gyro_set_fs_raw(const struct device *dev, uint8_t fs) in lsm6dso16is_gyro_set_fs_raw() argument
133 if (lsm6dso16is_gy_full_scale_set(ctx, fs) < 0) { in lsm6dso16is_gyro_set_fs_raw()
171 int fs; in lsm6dso16is_accel_range_set() local
174 fs = lsm6dso16is_accel_range_to_fs_val(range); in lsm6dso16is_accel_range_set()
175 if (fs < 0) { in lsm6dso16is_accel_range_set()
176 return fs; in lsm6dso16is_accel_range_set()
179 if (lsm6dso16is_accel_set_fs_raw(dev, fs) < 0) { in lsm6dso16is_accel_range_set()
184 data->acc_gain = lsm6dso16is_accel_fs_map[fs] * GAIN_UNIT_XL / 2; in lsm6dso16is_accel_range_set()
242 int fs; in lsm6dso16is_gyro_range_set() local
245 fs = lsm6dso16is_gyro_range_to_fs_val(range); in lsm6dso16is_gyro_range_set()
246 if (fs < 0) { in lsm6dso16is_gyro_range_set()
247 return fs; in lsm6dso16is_gyro_range_set()
250 if (lsm6dso16is_gyro_set_fs_raw(dev, fs) < 0) { in lsm6dso16is_gyro_range_set()
255 data->gyro_gain = (lsm6dso16is_gyro_fs_sens[fs] * GAIN_UNIT_G); in lsm6dso16is_gyro_range_set()
427 /* Convert to m/s^2 */ in lsm6dso16is_accel_convert()
448 lsm6dso16is_accel_convert(val, data->acc[2], sensitivity); in lsm6dso16is_accel_get_channel()
495 lsm6dso16is_gyro_convert(val, data->gyro[2], sensitivity); in lsm6dso16is_gyro_get_channel()
560 sample[1] = (int16_t)(data->ext_data[idx][2] | in lsm6dso16is_magn_get_channel()
562 sample[2] = (int16_t)(data->ext_data[idx][4] | in lsm6dso16is_magn_get_channel()
573 lsm6dso16is_magn_convert(val, sample[2], data->magn_gain); in lsm6dso16is_magn_get_channel()
578 lsm6dso16is_magn_convert(val + 2, sample[2], data->magn_gain); in lsm6dso16is_magn_get_channel()
627 (data->ext_data[idx][2] << 16)); in lsm6dso16is_press_convert()
743 uint8_t odr, fs; in lsm6dso16is_init_chip() local
772 fs = cfg->accel_range; in lsm6dso16is_init_chip()
773 LOG_DBG("accel range is %d", fs); in lsm6dso16is_init_chip()
774 if (lsm6dso16is_accel_set_fs_raw(dev, fs) < 0) { in lsm6dso16is_init_chip()
775 LOG_ERR("failed to set accelerometer range %d", fs); in lsm6dso16is_init_chip()
778 lsm6dso16is->acc_gain = lsm6dso16is_accel_fs_map[fs] * GAIN_UNIT_XL / 2; in lsm6dso16is_init_chip()
787 fs = cfg->gyro_range; in lsm6dso16is_init_chip()
788 LOG_DBG("gyro range is %d", fs); in lsm6dso16is_init_chip()
789 if (lsm6dso16is_gyro_set_fs_raw(dev, fs) < 0) { in lsm6dso16is_init_chip()
790 LOG_ERR("failed to set gyroscope range %d", fs); in lsm6dso16is_init_chip()
793 lsm6dso16is->gyro_gain = (lsm6dso16is_gyro_fs_sens[fs] * GAIN_UNIT_G); in lsm6dso16is_init_chip()