summaryrefslogtreecommitdiff
path: root/include/motion_sense.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-05-12 07:45:33 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-12 23:35:51 +0000
commita9a9ae1abc4ddb6a89ee0d29b88fbdd1d2ef67b1 (patch)
tree26b9855187a83412b181009031878826faab8b97 /include/motion_sense.h
parent39bd18b890bb708e79e9ba50dd3b5bf3d35e9ff1 (diff)
downloadchrome-ec-a9a9ae1abc4ddb6a89ee0d29b88fbdd1d2ef67b1.tar.gz
driver: Use common data structure to store default accel values
Move structure used by lms6ds0 to motion_sense.h, so that bosh driver can use the same mechanism. Use code to avoid reading chip range when reading data. BUG=none BRANCH=none TEST=Check Bosh driver is working as expected. Change-Id: Id8b5bb8735e479a122ef32ab9a400fba189d7488 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/270453 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/motion_sense.h')
-rw-r--r--include/motion_sense.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/motion_sense.h b/include/motion_sense.h
index 9f971bb184..bdbd7b238c 100644
--- a/include/motion_sense.h
+++ b/include/motion_sense.h
@@ -26,6 +26,11 @@ enum sensor_state {
#define SENSOR_ACTIVE_S0_S3 (SENSOR_ACTIVE_S3 | SENSOR_ACTIVE_S0)
#define SENSOR_ACTIVE_S0_S3_S5 (SENSOR_ACTIVE_S0_S3 | SENSOR_ACTIVE_S5)
+struct motion_data_t {
+ int odr;
+ int range;
+};
+
struct motion_sensor_t {
/* RO fields */
uint32_t active_mask;
@@ -40,12 +45,10 @@ struct motion_sensor_t {
const matrix_3x3_t *rot_standard_ref;
/* Default configuration parameters, RO only */
- int default_odr;
- int default_range;
+ struct motion_data_t default_config;
/* Run-Time configuration parameters */
- int odr;
- int range;
+ struct motion_data_t runtime_config;
/* state parameters */
enum sensor_state state;