summaryrefslogtreecommitdiff
path: root/driver/accelgyro_lsm6dsm.h
diff options
context:
space:
mode:
Diffstat (limited to 'driver/accelgyro_lsm6dsm.h')
-rw-r--r--driver/accelgyro_lsm6dsm.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/driver/accelgyro_lsm6dsm.h b/driver/accelgyro_lsm6dsm.h
index 3336326b90..fd7f59c3b3 100644
--- a/driver/accelgyro_lsm6dsm.h
+++ b/driver/accelgyro_lsm6dsm.h
@@ -267,9 +267,22 @@ struct lsm6dsm_data {
struct lsm6dsm_fifo_data config;
struct lsm6dsm_fifo_data current;
int next_in_patten;
+ /*
+ * After an ODR change, the sensor filters need settling time; discard
+ * initial samples with incorrect values
+ */
+ unsigned int samples_to_discard[FIFO_DEV_NUM];
#endif
};
+/*
+ * Note: The specific number of samples to discard depends on the filters
+ * configured for the chip, as well as the ODR being set. For most of our
+ * allowed ODRs, 4 should suffice.
+ * See: ST's LSM6DSM application notes (AN4987) Tables 17 and 19 for details
+ */
+#define LSM6DSM_DISCARD_SAMPLES 4
+
#define LSM6DSM_MAIN_SENSOR(_s) ((_s) - (_s)->type)
#ifdef CONFIG_ACCEL_FIFO