summaryrefslogtreecommitdiff
path: root/test/gyro_cal_init_for_test.h
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2020-10-23 12:05:48 -0600
committerCommit Bot <commit-bot@chromium.org>2020-12-08 19:06:07 +0000
commit6f0894886e4d15c60430b380001156b5292438cb (patch)
tree7b26a03738d1640fd610506fbfbb40004297d9f4 /test/gyro_cal_init_for_test.h
parent9760abbefee06a7ffa214dd477665b8c9476061e (diff)
downloadchrome-ec-6f0894886e4d15c60430b380001156b5292438cb.tar.gz
common:online_calibration: Spoof sensor data
This change allows the `accelspoof` ec command to also override the calibration data (bypassing the calibration module). This config flag should be used when testing layers above the EC (kernel and up)'s handling of the calibration values. BRANCH=none BUG=none TEST=Built on eve and added unit tests. TEST=make run-online_calibration_spoof -j Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I4735b9613c152af5559661a91565b05635d6495e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2494986
Diffstat (limited to 'test/gyro_cal_init_for_test.h')
-rw-r--r--test/gyro_cal_init_for_test.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/gyro_cal_init_for_test.h b/test/gyro_cal_init_for_test.h
new file mode 100644
index 0000000000..e32040bab9
--- /dev/null
+++ b/test/gyro_cal_init_for_test.h
@@ -0,0 +1,39 @@
+/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_EC_GYRO_CAL_INIT_FOR_TEST
+#define __CROS_EC_GYRO_CAL_INIT_FOR_TEST
+
+#include "gyro_cal.h"
+#include "gyro_still_det.h"
+
+/**
+ * Initialization function used for testing the gyroscope calibration.
+ * This function will initialize to the following values:
+ * - Gyrscope stillness detector
+ * - variance threshold: 5e-5
+ * - confidence delta: 1e-5
+ * - Accelerometer stillness detector
+ * - variance threshold: 8e-3
+ * - confidence delta: 1.6e-3
+ * - Magnetometer stillness detector
+ * - variance threshold: 1.4
+ * - confidence delta: 2.5e-1
+ * - Minimum stillness duration: 5 seconds
+ * - Maximum stillness duration: 6 seconds
+ * - Window duration: 1.5 seconds
+ * - Window timeout duration: 5 seconds
+ * - Stillness threshold: 0.95
+ * - Stillness mean delta limit: 50 millidegrees
+ * - Temperature delta limit: 1.5K
+ *
+ * Once all the values are set, this function will call init_gyro_cal()
+ * to finish initializing/resetting the struct data.
+ *
+ * @param gyro_cal Pointer to the calibration data structure to initialize.
+ */
+void gyro_cal_initialization_for_test(struct gyro_cal *gyro_cal);
+
+#endif /* __CROS_EC_GYRO_CAL_INIT_FOR_TEST */