Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2079)

Unified Diff: device/generic_sensor/generic_sensor_consts.h

Issue 2492773002: [sensors][CrOS/Linux] Implementation of motion sensors for CrOS/Linux platforms (Closed)
Patch Set: rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/generic_sensor_consts.h
diff --git a/device/generic_sensor/generic_sensor_consts.h b/device/generic_sensor/generic_sensor_consts.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb02231db8e40df2f1fb624c806bceebcbe2fd33
--- /dev/null
+++ b/device/generic_sensor/generic_sensor_consts.h
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium 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 DEVICE_GENERIC_SENSOR_GENERIC_SENSOR_CONSTS_H_
+#define DEVICE_GENERIC_SENSOR_GENERIC_SENSOR_CONSTS_H_
+
+namespace device {
+
+// Required for conversion from G/s^2 to m/s^2
+constexpr double kMeanGravity = 9.80665;
+
+// Required for conversion from deg/s^2 to rad/s^2
+constexpr double kRadiansInDegreesPerSecond = M_PI / 180.0;
Reilly Grant (use Gerrit) 2016/11/10 16:53:17 Include the header M_PI is defined in.
maksims (do not use this acc) 2016/11/11 08:52:02 Done.
+
+// Required for conversion from Gauss to uT.
+constexpr double kMicroteslaInGauss = 100.0;
+
+// Default rate for returning value of the ambient light sensor.
+constexpr int kDefaultAmbientLightFrequencyHz = 5;
+
+// Default rate for returning value of the accelerometer sensor.
+constexpr int kDefaultAccelerometerFrequencyHz = 10;
+
+// Default rate for returning value of the gyroscope sensor.
+constexpr int kDefaultGyroscopeFrequencyHz = 10;
+
+// Default rate for returning value of the magnetometer sensor.
+constexpr int kDefaultMagnetometerFrequencyHz = 10;
+
+// ChromeOS kernel version, when axes were changed to XYZ. Before 3.18,
+// they were YXZ.
+const char kChangedAxisKernelVersion[] = "3.18.0";
Reilly Grant (use Gerrit) 2016/11/10 16:53:17 Constant string values should be declared in heade
maksims (do not use this acc) 2016/11/11 08:52:02 Oops. I've put this here by accident with other co
+
+} // namespace device
+
+#endif // DEVICE_GENERIC_SENSOR_GENERIC_SENSOR_CONSTS_H_

Powered by Google App Engine
This is Rietveld 408576698