1.. _lsm6dso_i2c_on_i3c:
2
3LSM6DSO: IMU Sensor Monitor (I2C on I3C bus)
4############################################
5
6Overview
7********
8This sample sets the date rate of LSM6DSO accelerometer and gyroscope to
912.5Hz and enables a trigger on data ready. It displays on the console
10the values for accelerometer and gyroscope.
11
12Requirements
13************
14
15This sample uses the LSM6DSO sensor controlled using the I2C interface
16exposed by the I3C controller. It has been tested using the LSM6DSO on
17the evaluation board STEVAL-MKI196V1 connected to the I3C header
18on :ref:`mimxrt685_evk`.
19
20References
21**********
22
23- LSM6DSO https://www.st.com/en/mems-and-sensors/lsm6dso.html
24
25Building and Running
26********************
27
28This project outputs sensor data to the console. It requires an LSM6DSO
29sensor (for example, the one on evaluation board STEVAL-MKI196V1).
30
31Building on mimxrt685_evk_cm33 board
32====================================
33
34.. zephyr-app-commands::
35   :zephyr-app: samples/sensor/lsm6dso_i2c_on_i3c
36   :host-os: unix
37   :board: mimxrt685_evk_cm33
38   :goals: build
39   :compact:
40
41Board Preparations
42==================
43
44mimxrt685_evk_cm33
45------------------
46
47On the board :ref:`mimxrt685_evk`, the I3C pins are exposed on the J18
48header, where:
49
50  * SCL is on pin 1
51  * SDA is on pin 2
52  * Internal pull-up is on pin 3 (which is connected to pin 2 already)
53  * Ground is on pin4
54
55LSM6DSO
56^^^^^^^
57
58A LSM6DSO sensor needs to be connected to this header. For example,
59the evaluation board STEVAL-MKI196V1 can be used. This needs to be
60prepared so that the LSM6DSO sensor has address 0x6B (i.e. 0xD6,
61left-shifed).
62
63Sample Output
64=============
65
66.. code-block:: console
67
68    Testing LSM6DSO sensor in trigger mode.
69
70    accel x:-0.650847 ms/2 y:-5.300102 ms/2 z:-8.163114 ms/2
71    gyro x:-0.167835 dps y:-0.063377 dps z:0.002367 dps
72    trig_cnt:1
73
74    accel x:0.341575 ms/2 y:5.209773 ms/2 z:-7.938787 ms/2
75    gyro x:-0.034284 dps y:-0.004428 dps z:-0.003512 dps
76    trig_cnt:2
77
78    <repeats endlessly>
79