summaryrefslogtreecommitdiff
path: root/include/motion_sense.h
diff options
context:
space:
mode:
authorNick Vaccaro <nvaccaro@chromium.org>2017-04-25 19:09:03 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-05-18 21:05:23 -0700
commit9a0d0aa70d483be79c71a459dfd5f5e89da2638d (patch)
tree5e61d14a77ec938ce1508dbc61a271e0dfb15ee0 /include/motion_sense.h
parentd7eefeffb927cfd311d40c00ce817937eab4cb61 (diff)
downloadchrome-ec-9a0d0aa70d483be79c71a459dfd5f5e89da2638d.tar.gz
common: sensors: add extra sensor attributes
Adds min_frequency and max_frequency to struct motion_sensor_t. New attributes min_frequency and max_frequency are now returned in ectool's MOTIONSENSE_CMD_INFO response. Incremented ectool's MOTIONSENSE_CMD_INFO version to version 3. Add constants for MIN_FREQUENCY and MAX_FREQUENCY to each sensor's header file. BRANCH=none BUG=chromium:615059 TEST=build/boot and verify MOTIONSENSE_CMD_INFO response on kevin, make buildall -j passes. Change-Id: I66db9715c122ef6bb4665ad5d086a9ecc9c7c93a Signed-off-by: Nick Vaccaro <nvaccaro@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/482703 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/motion_sense.h')
-rw-r--r--include/motion_sense.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/motion_sense.h b/include/motion_sense.h
index 0ca7443b98..c50faba9c1 100644
--- a/include/motion_sense.h
+++ b/include/motion_sense.h
@@ -45,6 +45,12 @@ enum sensor_config {
#define ROUND_UP_FLAG (1 << 31)
#define BASE_ODR(_odr) ((_odr) & ~ROUND_UP_FLAG)
+#ifdef CONFIG_ACCEL_FIFO
+#define MAX_FIFO_EVENT_COUNT CONFIG_ACCEL_FIFO
+#else
+#define MAX_FIFO_EVENT_COUNT 0
+#endif
+
struct motion_data_t {
/*
* data rate the sensor will measure, in mHz: 0 suspended.
@@ -141,6 +147,12 @@ struct motion_sensor_t {
* from sensor registers.
*/
uint32_t last_collection;
+
+ /* Minimum supported sampling frequency in miliHertz for this sensor */
+ uint32_t min_frequency;
+
+ /* Maximum supported sampling frequency in miliHertz for this sensor */
+ uint32_t max_frequency;
};
/* Defined at board level. */