zephyr/subsys/emul
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
..
i2c
spi emul: spi: bmi160: Move to top-level directory 2020-10-27 16:41:30 +01:00
CMakeLists.txt emul: spi: bmi160: Move to top-level directory 2020-10-27 16:41:30 +01:00
Kconfig emul: spi: bmi160: Move to top-level directory 2020-10-27 16:41:30 +01:00
emul.c emul: Add messages in emul_init_for_bus_from_list 2020-10-05 15:33:00 -04:00
emul_bmi160.c drivers: sensors: bmi160: Fix issue with sample read 2020-12-01 17:58:06 -05:00