samples/shields/x_nucleo_iks01a3/sensorhub/README.html · samples/shields/x_nucleo_iks01a3/sensorhub/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Shields · Sensor Hub

X-NUCLEO-IKS01A3 Sensor Hub Mode 2

LSM6DSO가 LIS2MDL·LPS22HH를 기본 slave로 묶고 HTS221 대체도 지원합니다.

Official pathsamples/shields/x_nucleo_iks01a3/sensorhub/README.html
Source filesamples/shields/x_nucleo_iks01a3/sensorhub/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

LIS2DW12 direct path와 LSM6DSO hub path, default·optional slave 조합을 구분합니다.

Hub

LSM6DSO

Default

LIS2MDL + LPS22HH

Optional

HTS221

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 48687B4591E3CC8BBF28E4F0AC803500A4F83D748622995AA7341D3C3422DCE1
.. zephyr:code-sample:: x-nucleo-iks01a3-shub
   :name: X-NUCLEO-IKS01A3 shield - SensorHub (Mode 2)
   :relevant-api: sensor_interface

   Interact with all the sensors of an X-NUCLEO-IKS01A3 shield using Sensor Hub mode.

Overview
********
This sample is provided as an example to test the X-NUCLEO-IKS01A3 shield
configured in Sensor Hub mode (Mode 2).
Please refer to :ref:`x-nucleo-iks01a3` for more info on this configuration.

This sample enables LIS2DW12 and LSM6DSO sensors. Since all other shield
devices are connected to LSM6DSO, the LSM6DSO driver is configured in sensorhub
mode (CONFIG_LSM6DSO_SENSORHUB=y) with a selection of two maximum slaves
among LPS22HH, HTS221 and LIS2MDL (default is LIS2MDL + LPS22HH).

Then sensor data are displayed periodically

- LIS2DW12 3-Axis acceleration
- LSM6DSO 6-Axis acceleration and angular velocity
- LSM6DSO (from LIS2MDL) 3-Axis magnetic field intensity
- LSM6DSO (from LPS22HH) ambient temperature and atmospheric pressure

Optionally HTS221 can substitute one between LIS2MDL and LPS22HH

- LSM6DSO (from HTS221): ambient temperature and relative humidity


Requirements
************

This sample communicates over I2C with the X-NUCLEO-IKS01A3 shield
stacked on a board with an Arduino connector. The board's I2C must be
configured for the I2C Arduino connector (both for pin muxing
and devicetree). See for example the :ref:`nucleo_f401re_board` board
source code:

- :file:`$ZEPHYR_BASE/boards/arm/nucleo_f401re/nucleo_f401re.dts`
- :file:`$ZEPHYR_BASE/boards/arm/nucleo_f401re/pinmux.c`

Please note that this sample can't be used with boards already supporting
one of the sensors available on the shield (such as disco_l475_iot1)
as sensors multiple instances are not supported.

References
**********

- X-NUCLEO-IKS01A3: https://www.st.com/en/ecosystems/x-nucleo-iks01a3.html

Building and Running
********************

This sample runs with X-NUCLEO-IKS01A3 stacked on any board with a matching
Arduino connector. For this example, we use a :ref:`nucleo_f401re_board` board.

.. zephyr-app-commands::
   :zephyr-app: samples/shields/x_nucleo_iks01a3/sensorhub/
   :host-os: unix
   :board: nucleo_f401re
   :goals: build
   :compact:

Sample Output
=============

 .. code-block:: console


    X-NUCLEO-IKS01A3 sensor dashboard

    LIS2DW12: Accel (m.s-2): x: -0.077, y: 0.536, z: 9.648
    LSM6DSO: Accel (m.s-2): x: -0.062, y: -0.028, z: 10.035
    LSM6DSO: GYro (dps): x: -0.003, y: -0.001, z: 0.000
    LSM6DSO: Magn (gauss): x: -0.052, y: -0.222, z: -0.059
    LSM6DSO: Temperature: 27.9 C
    LSM6DSO: Pressure:100.590 kpa
    1:: lsm6dso acc trig 208
    1:: lsm6dso gyr trig 208

    <updated endlessly every 2 seconds>

Part 3

한국어 전문 번역

개요

X-NUCLEO-IKS01A3 shield를 Sensor Hub mode(Mode 2)로 구성해 시험하는 sample입니다. Mode 2의 배선과 jumper configuration은 X-NUCLEO-IKS01A3 shield 문서를 참조합니다.

Sample은 LIS2DW12와 LSM6DSO를 활성화합니다. 다른 shield device는 LSM6DSO에 연결되므로 driver를 CONFIG_LSM6DSO_SENSORHUB=y로 구성하고 LPS22HH, HTS221, LIS2MDL 가운데 slave를 최대 두 개 선택합니다. Default 조합은 LIS2MDL + LPS22HH입니다.

주기적으로 표시하는 data 경로는 다음과 같습니다.

  • LIS2DW12의 3-axis acceleration
  • LSM6DSO 자체의 6-axis acceleration과 angular velocity
  • LIS2MDL에서 LSM6DSO를 거쳐 읽는 3-axis magnetic field intensity
  • LPS22HH에서 LSM6DSO를 거쳐 읽는 ambient temperature와 atmospheric pressure

선택적으로 HTS221이 LIS2MDL 또는 LPS22HH 중 하나를 대체할 수 있습니다. 이때 LSM6DSO sensor hub를 통해 HTS221의 ambient temperature와 relative humidity를 읽습니다.

요구 사항

Arduino connector가 있는 board에 shield를 쌓고 I2C로 통신합니다. Arduino I2C용 pin muxing과 devicetree를 모두 구성해야 합니다. 원문이 제시한 예제 source path는 $ZEPHYR_BASE/boards/arm/nucleo_f401re/nucleo_f401re.dts와 $ZEPHYR_BASE/boards/arm/nucleo_f401re/pinmux.c입니다.

Sensor multiple instance가 지원되지 않으므로 disco_l475_iot1처럼 shield sensor 중 하나를 이미 지원하는 board에서는 사용할 수 없습니다.

참고 자료

빌드 및 실행

Matching Arduino connector가 있는 board에서 실행할 수 있으며, 다음은 Unix host에서 nucleo_f401re용으로 build하는 공식 command입니다.

west build -b nucleo_f401re samples/shields/x_nucleo_iks01a3/sensorhub/

출력 예

X-NUCLEO-IKS01A3 sensor dashboard

LIS2DW12: Accel (m.s-2): x: -0.077, y: 0.536, z: 9.648
LSM6DSO: Accel (m.s-2): x: -0.062, y: -0.028, z: 10.035
LSM6DSO: GYro (dps): x: -0.003, y: -0.001, z: 0.000
LSM6DSO: Magn (gauss): x: -0.052, y: -0.222, z: -0.059
LSM6DSO: Temperature: 27.9 C
LSM6DSO: Pressure:100.590 kpa
1:: lsm6dso acc trig 208
1:: lsm6dso gyr trig 208

<updated endlessly every 2 seconds>

Default slave 조합 때문에 LIS2MDL magnetic field와 LPS22HH temperature·pressure가 함께 표시됩니다. LSM6DSO acceleration·gyroscope trigger count도 출력되며 2초마다 갱신됩니다. 원문 output의 GYro 대소문자는 그대로 보존했습니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.