• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

src/04-Jan-2025-253192

CMakeLists.txtD04-Jan-2025390 1511

README.rstD04-Jan-20252.3 KiB7553

prj.confD04-Jan-2025263 1110

sample.yamlD04-Jan-2025350 1716

README.rst

1.. zephyr:code-sample:: x-nucleo-iks02a1-shub
2   :name: X-NUCLEO-IKS02A1 shield - SensorHub (Mode 2)
3   :relevant-api: sensor_interface
4
5   Interact with all the sensors of an X-NUCLEO-IKS02A1 shield using Sensor Hub mode.
6
7Overview
8********
9This sample is provided as an example to test the X-NUCLEO-IKS02A1 shield
10configured in Sensor Hub mode (Mode 2).
11Please refer to :ref:`x-nucleo-iks02a1` for more info on this configuration.
12
13This sample enables IIS2DLPC and ISM330DHCX sensors. Since all other shield
14devices are connected to ISM330DHCX, the ISM330DHCX driver is configured in sensorhub
15mode (CONFIG_ISM330DHCX_SENSORHUB=y) with the IIS2MDC magnetometer as external
16slave.
17
18Then sensor data are displayed periodically
19
20- IIS2DLPC 3-Axis acceleration
21- ISM330DHCX 6-Axis acceleration and angular velocity
22- ISM330DHCX (from IIS2MDC) 3-Axis magnetic field intensity
23
24
25Requirements
26************
27
28This sample communicates over I2C with the X-NUCLEO-IKS02A1 shield
29stacked on a board with an Arduino connector. The board's I2C must be
30configured for the I2C Arduino connector (both for pin muxing
31and devicetree). See for example the :zephyr:board:`nucleo_f401re` board
32source code:
33
34- :zephyr_file:`boards/st/nucleo_f401re/nucleo_f401re.dts`
35
36Please note that this sample can't be used with boards already supporting
37one of the sensors available on the shield (such as disco_l475_iot1)
38as sensors multiple instances are not supported.
39
40References
41**********
42
43- X-NUCLEO-IKS02A1: https://www.st.com/en/ecosystems/x-nucleo-iks02a1.html
44
45Building and Running
46********************
47
48This sample runs with X-NUCLEO-IKS02A1 stacked on any board with a matching
49Arduino connector. For this example, we use a :zephyr:board:`nucleo_f401re` board.
50
51.. zephyr-app-commands::
52   :zephyr-app: samples/shields/x_nucleo_iks02a1/sensorhub/
53   :host-os: unix
54   :board: nucleo_f401re
55   :goals: build
56   :compact:
57
58Sample Output
59=============
60
61 .. code-block:: console
62
63
64    X-NUCLEO-IKS02A1 sensor Mode 2 dashboard
65
66    IIS2DLPC: Accel (m.s-2): x: 0.077, y: -0.766, z: 9.878
67    ISM330DHCX: Accel (m.s-2): x: 0.383, y: -0.234, z: 9.763
68    ISM330DHCX: GYro (dps): x: 0.004, y: 0.003, z: -0.005
69    ISM330DHCX: Magn (gauss): x: 0.171, y: 0.225, z: -0.363
70    7:: iis2dlpc trig 1215
71    7:: ism330dhcx acc trig 2494
72    7:: ism330dhcx gyr trig 2494
73
74    <updated endlessly every 2 seconds>
75