summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authormario tesi <mario.tesi@st.com>2017-05-25 11:06:30 +0200
committerCommit Bot <commit-bot@chromium.org>2019-08-13 16:40:10 +0000
commit35436903b5bc28e21802c4fe626bdd7f493d8367 (patch)
tree723d6208fbee54931f6421db303cfacf636868e3 /util
parent88d6812b514e21f6e7cba647ceafcbfc606d4b56 (diff)
downloadchrome-ec-35436903b5bc28e21802c4fe626bdd7f493d8367.tar.gz
driver: lis2dw12: Add driver support
Added ACC LIS2DW12 driver support. Features included in this driver are: - Basic Sensor Read acceleration data - ODR and FS runtime configuration - FIFO support with watermark interrupt events - Shared commons function with ST MEMs devices - Switch Low Power to High perf. mode in case of ODR > 200 Hz - Configure D-TAP event detection in Hardware BUG=b:73546254 BRANCH=master TEST=Tested on discovery_stmems target BOARD with LIS2DW12 connected to EC i2c master bus and motion sense task running. To build firmware for discovery_stmems target with LIS2DW12 sensor connected, simply uncomment CONFIG_ACCEL_LIS2DW12 define in board.h target file and make with target BOARD=discovery_stmems. Commands used to test LIS2DW12 device are: - accelinit 0 (to configure accel. device) All basic features tested, including changing in ODR: - accelrate 0 10000 (set ODR to 10 Hz) - accelrate 0 12500 (set ODR to 12.5 Hz) - accelrate 0 25000 (set ODR to 25 Hz) - accelrate 0 50000 (set ODR to 50 Hz) - accelrate 0 100000 (set ODR to 100 Hz) - accelrate 0 200000 (set ODR to 200 Hz) - accelrate 0 400000 (set ODR to 400 Hz) - accelrate 0 800000 (set ODR to 800 Hz) - accelrate 0 1600000 (set ODR to 1.6 kHz) Full Scale Range: - accelrange 0 2 (set Full Scale Range to 2g) - accelrange 0 4 (set Full Scale Range to 4g) - accelrange 0 8 (set Full Scale Range to 8g) - accelrange 0 16 (set Full Scale Range to 16g) FIFO features and interrupt management: - accelinfo on 1000 (motion info task with refresh rate 1 s) and polling data read: - accelread 0 (to read data from accelerometer) Change-Id: I0b9861a71e81052e7ee8eb235a1a5b2a57d4c6f5 Signed-off-by: mario tesi <mario.tesi@st.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/515302 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com> Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'util')
-rw-r--r--util/ectool.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/ectool.c b/util/ectool.c
index 59feee5f39..5cf43d0df3 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -4673,6 +4673,9 @@ static int cmd_motionsense(int argc, char **argv)
case MOTIONSENSE_CHIP_TCS3400:
printf("tcs3400\n");
break;
+ case MOTIONSENSE_CHIP_LIS2DW12:
+ printf("lis2dw12\n");
+ break;
default:
printf("unknown\n");
}