diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2019-01-18 15:24:12 -0800 |
---|---|---|
committer | Justin TerAvest <teravest@chromium.org> | 2019-01-19 02:05:55 +0000 |
commit | ccede6a11f3d4287b0e7a49ca1acc25046c45123 (patch) | |
tree | 7ae6533522ab8d6889a2a374b00e944d7d0ca2f8 /board/fleex/board.c | |
parent | dc0744d83b7f1118bbb554e1800944d104dfacbd (diff) | |
download | chrome-ec-ccede6a11f3d4287b0e7a49ca1acc25046c45123.tar.gz |
drvier: lsm6dsm: Populate Gyroscope scale properly
Range of 250/1000/2000 dps is an approximation.
The Gyrscope uses a slighly higher range:
range | gain(udps/LSB) | actual value(dps)
250 | 8750 | 286.72
500 | 17500 | 573.44
1000 | 35000 | 1146.88
2000 | 70000 | 2293.76
Returns the actual value for a given range.
BUG=b:121279721
BRANCH=octopus
TEST=Check scale returns the correct value:
cd /sys/bus/iio/devices/...
for i in 250 500 1000 2000 ; do echo $i > scale ; V=$(cat scale) ; echo
-n "$i: " ; echo -n "$V: " ; echo $V | python -c 'import sys
for line in sys.stdin:
print float(line) * 32768 * 180 / 3.14159' ; done
250: 0.000152331: 285.996835182
500: 0.000305197: 572.998116648
1000: 0.000610395: 1145.99811077
2000: 0.001221325: 2293.00066781
Check CTS Verifier Gyroscope Measurement Test pass.
Change-Id: I76c977140321d01702af16f58a3dfb7036673014
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1423597
Reviewed-by: Enrico Granata <egranata@chromium.org>
Diffstat (limited to 'board/fleex/board.c')
-rw-r--r-- | board/fleex/board.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/board/fleex/board.c b/board/fleex/board.c index 879c4fc959..eba235f85b 100644 --- a/board/fleex/board.c +++ b/board/fleex/board.c @@ -192,7 +192,7 @@ struct motion_sensor_t motion_sensors[] = { .drv_data = &lsm6dsm_g_data, .port = I2C_PORT_SENSOR, .addr = LSM6DSM_ADDR0, - .default_range = 1000, /* dps */ + .default_range = 1000 | ROUND_UP_FLAG, /* dps */ .rot_standard_ref = &base_standard_ref, .min_frequency = LSM6DSM_ODR_MIN_VAL, .max_frequency = LSM6DSM_ODR_MAX_VAL, |