|
| 1 | +.. _x-nucleo-iks01a3-shub-sample: |
| 2 | + |
| 3 | +X-NUCLEO-IKS01A3: shield (Mode 2) sample |
| 4 | +######################################## |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | +This sample is provided as an example to test the X-NUCLEO-IKS01A3 shield |
| 9 | +configured in Sensor Hub mode (Mode 2). |
| 10 | +Please refer to :ref:`x-nucleo-iks01a3` for more info on this configuration. |
| 11 | + |
| 12 | +This sample enables LIS2DW12 and LSM6DSO sensors. Since all other shield |
| 13 | +devices are connected to LSM6DSO, the LSM6DSO driver is configured in sensorhub |
| 14 | +mode (CONFIG_LSM6DSO_SENSORHUB=y) with a selection of two maximum slaves |
| 15 | +among LPS22HH, HTS221 and LIS2MDL (default is LIS2MDL + LPS22HH). |
| 16 | + |
| 17 | +Then sensor data are displayed periodically |
| 18 | + |
| 19 | +- LIS2DW12 3-Axis acceleration |
| 20 | +- LSM6DSO 6-Axis acceleration and angular velocity |
| 21 | +- LSM6DSO (from LIS2MDL) 3-Axis magnetic field intensity |
| 22 | +- LSM6DSO (from LPS22HH) ambient temperature and atmospheric pressure |
| 23 | + |
| 24 | +Optionally HTS221 can substitute one between LIS2MDL and LPS22HH |
| 25 | + |
| 26 | +- LSM6DSO (from HTS221): ambient temperature and relative humidity |
| 27 | + |
| 28 | + |
| 29 | +Requirements |
| 30 | +************ |
| 31 | + |
| 32 | +This sample communicates over I2C with the X-NUCLEO-IKS01A3 shield |
| 33 | +stacked on a board with an Arduino connector. The board's I2C must be |
| 34 | +configured for the I2C Arduino connector (both for pin muxing |
| 35 | +and device tree). See for example the :ref:`nucleo_f401re_board` board |
| 36 | +source code: |
| 37 | + |
| 38 | +- :file:`$ZEPHYR_BASE/boards/arm/nucleo_f401re/nucleo_f401re.dts` |
| 39 | +- :file:`$ZEPHYR_BASE/boards/arm/nucleo_f401re/pinmux.c` |
| 40 | + |
| 41 | +Please note that this sample can't be used with boards already supporting |
| 42 | +one of the sensors available on the shield (such as disco_l475_iot1) |
| 43 | +as sensors multiple instances are not supported. |
| 44 | + |
| 45 | +References |
| 46 | +********** |
| 47 | + |
| 48 | +- X-NUCLEO-IKS01A3: http://www.st.com/en/ecosystems/x-nucleo-iks01a3.html |
| 49 | + |
| 50 | +Building and Running |
| 51 | +******************** |
| 52 | + |
| 53 | +This sample runs with X-NUCLEO-IKS01A3 stacked on any board with a matching |
| 54 | +Arduino connector. For this example, we use a :ref:`nucleo_f401re_board` board. |
| 55 | + |
| 56 | +.. zephyr-app-commands:: |
| 57 | + :zephyr-app: samples/shields/x_nucleo_iks01a3/sensorhub/ |
| 58 | + :host-os: unix |
| 59 | + :board: nucleo_f401re |
| 60 | + :goals: build |
| 61 | + :compact: |
| 62 | + |
| 63 | +Sample Output |
| 64 | +============= |
| 65 | + |
| 66 | + .. code-block:: console |
| 67 | +
|
| 68 | +
|
| 69 | + X-NUCLEO-IKS01A3 sensor dashboard |
| 70 | +
|
| 71 | + LIS2DW12: Accel (m.s-2): x: -0.077, y: 0.536, z: 9.648 |
| 72 | + LSM6DSO: Accel (m.s-2): x: -0.062, y: -0.028, z: 10.035 |
| 73 | + LSM6DSO: GYro (dps): x: -0.003, y: -0.001, z: 0.000 |
| 74 | + LSM6DSO: Magn (gauss): x: -0.052, y: -0.222, z: -0.059 |
| 75 | + LSM6DSO: Temperature: 27.9 C |
| 76 | + LSM6DSO: Pressure:100.590 kpa |
| 77 | + 1:: lsm6dso acc trig 208 |
| 78 | + 1:: lsm6dso gyr trig 208 |
| 79 | +
|
| 80 | + <updated endlessly every 2 seconds> |
0 commit comments