Lines Matching +full:sampling +full:- +full:frequencies
4 * SPDX-License-Identifier: Apache-2.0
29 * Values of the different sampling frequencies of the accelerometer, indexed by the raw odr
35 * Value of the different sampling frequencies of the gyroscope, indexed by the raw odr value
42 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_reboot()
43 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_reboot()
76 return -EINVAL; in lsm9ds1_accel_range_to_fs_val()
90 return -EINVAL; in lsm9ds1_gyro_range_to_fs_val()
109 return -EINVAL; in lsm9ds1_accel_freq_to_odr_val()
122 return -EINVAL; in lsm9ds1_gyro_freq_to_odr_val()
127 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_accel_set_odr_raw()
128 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_accel_set_odr_raw()
129 struct lsm9ds1_data *data = dev->data; in lsm9ds1_accel_set_odr_raw()
146 data->accel_odr = odr; in lsm9ds1_accel_set_odr_raw()
153 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_gyro_set_odr_raw()
154 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_gyro_set_odr_raw()
155 struct lsm9ds1_data *data = dev->data; in lsm9ds1_gyro_set_odr_raw()
172 data->gyro_odr = odr; in lsm9ds1_gyro_set_odr_raw()
178 struct lsm9ds1_data *data = dev->data; in lsm9ds1_gyro_odr_set()
184 if (odr == data->gyro_odr) { in lsm9ds1_gyro_odr_set()
192 LOG_DBG("failed to set gyroscope sampling rate"); in lsm9ds1_gyro_odr_set()
203 LOG_ERR("failed to set accelerometer sampling rate"); in lsm9ds1_gyro_odr_set()
212 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_accel_odr_set()
213 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_accel_odr_set()
214 struct lsm9ds1_data *data = dev->data; in lsm9ds1_accel_odr_set()
231 if (odr == data->gyro_odr) { in lsm9ds1_accel_odr_set()
239 LOG_DBG("failed to set accelerometer sampling rate"); in lsm9ds1_accel_odr_set()
245 LOG_ERR("failed to set gyroscope sampling rate"); in lsm9ds1_accel_odr_set()
254 if (odr == data->accel_odr) { in lsm9ds1_accel_odr_set()
264 LOG_DBG("failed to set accelerometer sampling rate"); in lsm9ds1_accel_odr_set()
274 struct lsm9ds1_data *data = dev->data; in lsm9ds1_accel_range_set()
275 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_accel_range_set()
276 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_accel_range_set()
287 LOG_DBG("failed to set accelerometer full-scale"); in lsm9ds1_accel_range_set()
291 data->acc_gain = lsm9ds1_accel_fs_val_to_gain(fs); in lsm9ds1_accel_range_set()
298 struct lsm9ds1_data *data = dev->data; in lsm9ds1_gyro_range_set()
299 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_gyro_range_set()
300 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_gyro_range_set()
310 LOG_DBG("failed to set gyroscope full-scale"); in lsm9ds1_gyro_range_set()
314 data->gyro_gain = (lsm9ds1_gyro_fs_sens[fs] * GAIN_UNIT_G); in lsm9ds1_gyro_range_set()
325 return lsm9ds1_accel_odr_set(dev, val->val1); in lsm9ds1_accel_config()
328 return -ENOTSUP; in lsm9ds1_accel_config()
341 return lsm9ds1_gyro_odr_set(dev, val->val1); in lsm9ds1_gyro_config()
344 return -ENOTSUP; in lsm9ds1_gyro_config()
360 return -ENOTSUP; in lsm9ds1_attr_set()
367 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_sample_fetch_accel()
368 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_sample_fetch_accel()
369 struct lsm9ds1_data *data = dev->data; in lsm9ds1_sample_fetch_accel()
372 ret = lsm9ds1_acceleration_raw_get(ctx, data->acc); in lsm9ds1_sample_fetch_accel()
383 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_sample_fetch_gyro()
384 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_sample_fetch_gyro()
385 struct lsm9ds1_data *data = dev->data; in lsm9ds1_sample_fetch_gyro()
388 ret = lsm9ds1_angular_rate_raw_get(ctx, data->gyro); in lsm9ds1_sample_fetch_gyro()
399 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_sample_fetch_temp()
400 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_sample_fetch_temp()
401 struct lsm9ds1_data *data = dev->data; in lsm9ds1_sample_fetch_temp()
404 ret = lsm9ds1_temperature_raw_get(ctx, &data->temp_sample); in lsm9ds1_sample_fetch_temp()
436 return -ENOTSUP; in lsm9ds1_sample_fetch()
456 lsm9ds1_accel_convert(val, data->acc[0], sensitivity); in lsm9ds1_accel_get_channel()
459 lsm9ds1_accel_convert(val, data->acc[1], sensitivity); in lsm9ds1_accel_get_channel()
462 lsm9ds1_accel_convert(val, data->acc[2], sensitivity); in lsm9ds1_accel_get_channel()
466 lsm9ds1_accel_convert(val++, data->acc[i], sensitivity); in lsm9ds1_accel_get_channel()
470 return -ENOTSUP; in lsm9ds1_accel_get_channel()
479 return lsm9ds1_accel_get_channel(chan, val, data, data->acc_gain); in lsm9ds1_accel_channel_get()
496 lsm9ds1_gyro_convert(val, data->gyro[0], sensitivity); in lsm9ds1_gyro_get_channel()
499 lsm9ds1_gyro_convert(val, data->gyro[1], sensitivity); in lsm9ds1_gyro_get_channel()
502 lsm9ds1_gyro_convert(val, data->gyro[2], sensitivity); in lsm9ds1_gyro_get_channel()
506 lsm9ds1_gyro_convert(val++, data->gyro[i], sensitivity); in lsm9ds1_gyro_get_channel()
510 return -ENOTSUP; in lsm9ds1_gyro_get_channel()
519 return lsm9ds1_gyro_get_channel(chan, val, data, data->gyro_gain); in lsm9ds1_gyro_channel_get()
525 val->val1 = data->temp_sample / TEMP_SENSITIVITY + TEMP_OFFSET; in lsm9ds1_temp_channel_get()
526 val->val2 = (data->temp_sample % TEMP_SENSITIVITY) * (1000000 / TEMP_SENSITIVITY); in lsm9ds1_temp_channel_get()
533 struct lsm9ds1_data *data = dev->data; in lsm9ds1_channel_get()
554 return -ENOTSUP; in lsm9ds1_channel_get()
568 const struct lsm9ds1_config *cfg = dev->config; in lsm9ds1_init()
569 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm9ds1_init()
570 struct lsm9ds1_data *lsm9ds1 = dev->data; in lsm9ds1_init()
588 return -EIO; in lsm9ds1_init()
592 LOG_DBG("output data rate is %d\n", cfg->imu_odr); in lsm9ds1_init()
593 ret = lsm9ds1_imu_data_rate_set(ctx, cfg->imu_odr); in lsm9ds1_init()
599 fs = cfg->accel_range; in lsm9ds1_init()
607 lsm9ds1->acc_gain = lsm9ds1_accel_fs_val_to_gain(fs); in lsm9ds1_init()
609 fs = cfg->gyro_range; in lsm9ds1_init()
616 lsm9ds1->gyro_gain = (lsm9ds1_gyro_fs_sens[fs] * GAIN_UNIT_G); in lsm9ds1_init()