diff options
author | mario tesi <mario.tesi@st.com> | 2017-05-25 11:06:30 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-13 16:40:10 +0000 |
commit | 35436903b5bc28e21802c4fe626bdd7f493d8367 (patch) | |
tree | 723d6208fbee54931f6421db303cfacf636868e3 /include | |
parent | 88d6812b514e21f6e7cba647ceafcbfc606d4b56 (diff) | |
download | chrome-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 'include')
-rw-r--r-- | include/config.h | 2 | ||||
-rw-r--r-- | include/ec_commands.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h index 0748c26206..9aaed68445 100644 --- a/include/config.h +++ b/include/config.h @@ -84,6 +84,7 @@ #undef CONFIG_ACCEL_LIS2DH #undef CONFIG_ACCEL_LNG2DM #undef CONFIG_ACCEL_LIS2D_COMMON +#undef CONFIG_ACCEL_LIS2DW12 #undef CONFIG_ACCELGYRO_BMI160 #undef CONFIG_ACCELGYRO_LSM6DS0 @@ -275,6 +276,7 @@ #undef CONFIG_ACCELGYRO_BMI160_INT_EVENT #undef CONFIG_ACCEL_LSM6DSM_INT_EVENT #undef CONFIG_ACCEL_LSM6DSO_INT_EVENT +#undef CONFIG_ACCEL_LIS2DW12_INT_EVENT #undef CONFIG_ALS_SI114X_INT_EVENT #undef CONFIG_ALS_TCS3400_INT_EVENT diff --git a/include/ec_commands.h b/include/ec_commands.h index 218fb04a00..7d8ccb8324 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2467,6 +2467,7 @@ enum motionsensor_chip { MOTIONSENSE_CHIP_LSM6DSO = 18, MOTIONSENSE_CHIP_LNG2DM = 19, MOTIONSENSE_CHIP_TCS3400 = 20, + MOTIONSENSE_CHIP_LIS2DW12 = 21, MOTIONSENSE_CHIP_MAX, }; |