summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2019-10-03 11:47:04 -0600
committerCommit Bot <commit-bot@chromium.org>2021-10-08 09:14:16 +0000
commit739138c1e0e1fd2b191b56060933d1ebe4c1690c (patch)
treeb887735394bab237f34751776ac46cbdaed423b5
parent934240abc1f76ba809b94b3ccda957a4179e251b (diff)
downloadchrome-ec-739138c1e0e1fd2b191b56060933d1ebe4c1690c.tar.gz
common: accelgyro: Add read temperature function to driver
Add the read temperature function to the driver when an FPU is available. BUG=b:138303429,chromium:1023858 TEST=None BRANCH=None Change-Id: I29e596af202def07c296fa1b478c711d31517999 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859454 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2603087 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211320 Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>
-rw-r--r--include/accelgyro.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/accelgyro.h b/include/accelgyro.h
index 2f1131c9f5..237b139faf 100644
--- a/include/accelgyro.h
+++ b/include/accelgyro.h
@@ -7,6 +7,7 @@
#define __CROS_EC_ACCELGYRO_H
#include "motion_sense.h"
+#include "math_util.h"
/* Header file for accelerometer / gyro drivers. */
@@ -38,6 +39,15 @@ struct accelgyro_drv {
int (*read)(const struct motion_sensor_t *s, intv3_t v);
/**
+ * Read the sensor's current internal temperature.
+ *
+ * @param s Pointer to sensor data.
+ * @param temp Pointer to store temperature in degrees Kelvin.
+ * @return EC_SUCCESS if successful, non-zero if error.
+ */
+ int (*read_temp)(const struct motion_sensor_t *s, int *temp);
+
+ /**
* Setter and getter methods for the sensor range. The sensor range
* defines the maximum value that can be returned from read(). As the
* range increases, the resolution gets worse.