diff options
author | Mario Tesi <mario.tesi@st.com> | 2017-04-04 11:00:55 +0200 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-04-05 18:41:12 -0700 |
commit | 87e769a87e43c17eea69cbe6d04c3dc072f79a91 (patch) | |
tree | 8c85e81a3af64d876afb5717944882b347dd6a35 /driver/stm_mems_common.c | |
parent | 75e0015cc16d287724ef353c5d7f50c1287db2cb (diff) | |
download | chrome-ec-87e769a87e43c17eea69cbe6d04c3dc072f79a91.tar.gz |
driver: lsm6dsm/lsm6dsl: Add FIFO support
Added FIFO support to Acc and Gyro with
watermark interrupt management.
Watermark is configurable setting macro
CONFIG_ACCEL_FIFO_THRES properly (board.h)
BUG=b:73546254
BRANCH=master
TEST=Pass CTS test cheets_CTS_N.7.1_r15.x86.CtsHardwareTestCases
on meowth.
TEST=Tested on discovery (target stmems) BOARD with LSM6DSM
connected to EC i2c master bus.
Using motion sense console commands is possible to:
- enable sensor (accelinit 0, accelinit 1 for acc and gyro)
- set ODR (accelrate 0 x, accelrate 1 y where x, y are mHz)
- show sensor data (accelinfo on <time> where time is in ms)
Using this procedure is possible to see Green Led of Discovery Board
Blinking each time an interrupt from FIFO arrives. To be sure to
generate interrupt is better to use high ODR and low time in accelinfo.
Change-Id: Icf95b0e889dc806206b8ca50e74636e6a2441a18
Signed-off-by: Mario Tesi <mario.tesi@st.com>
Reviewed-on: https://chromium-review.googlesource.com/467326
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'driver/stm_mems_common.c')
-rw-r--r-- | driver/stm_mems_common.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/driver/stm_mems_common.c b/driver/stm_mems_common.c index c2939ae714..4af0cb4a34 100644 --- a/driver/stm_mems_common.c +++ b/driver/stm_mems_common.c @@ -163,10 +163,5 @@ void st_normalize(const struct motion_sensor_t *s, vector_3_t v, uint8_t *data) /* apply offset in the device coordinates */ range = s->drv->get_range(s); for (i = X; i <= Z; i++) - /* - * TODO(gwendal): only work for accel: - * offsest is in 1/1024th g/LSB, so shift left and divide by - * range to normalize the value. - */ v[i] += (drvdata->offset[i] << 5) / range; } |