From 35436903b5bc28e21802c4fe626bdd7f493d8367 Mon Sep 17 00:00:00 2001 From: mario tesi Date: Thu, 25 May 2017 11:06:30 +0200 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/515302 Reviewed-by: Yuval Peress Reviewed-by: Paul Ma Tested-by: Paul Ma Commit-Queue: Tim Wawrzynczak --- util/ectool.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util') 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"); } -- cgit v1.2.1