zephyr/drivers/sensor/bmi160
Yuval Peress beaf0230ba drivers: sensors: bmi160: Fix issue with sample read
When testing the bmi160 I've come across an issue where the readings
didn't make sense to me. The issue comes from reading the
BMI160_SAMPLE_BURST_READ_ADDR which is 0x0C assuming both accelerometer
and gyroscope. At this point we would normally read 12 bytes
(2 bytes per sample * 3 axes * 2 sensors). This reading takes place in
bmi160_sample_fetch and begins writing to data->sample.raw

Without this change, the first byte written is actually to the dummy
byte which effectively gets tossed. The issue is that this is the
GYR_X<7:0>(LSB) according to the BMI160 data sheet. When we later call
either bmi160_gyr_channel_get or bmi160_acc_channel_get we're looking
at sample.gyr and sample.acc (which is effectively shiften by 1 byte).

This change gets rid of the dummy byte which re-alignes gyr with the
start of the raw buffer.

Signed-off-by: Yuval Peress <peress@chromium.org>
2020-12-01 17:58:06 -05:00
..
CMakeLists.txt
Kconfig
bmi160.c drivers: sensor: bmi160: Add support for I2C 2020-10-27 16:41:30 +01:00
bmi160.h drivers: sensors: bmi160: Fix issue with sample read 2020-12-01 17:58:06 -05:00
bmi160_trigger.c drivers: sensor: bmi160: Use 'data' for the data pointer 2020-10-27 16:41:30 +01:00