samples/subsys/sensing/simple/README.html · samples/subsys/sensing/simple/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Sensing · Simple

Sensing subsystem

DTS 정의부터 callback과 sample interval까지 Sensing API 수명주기를 실행합니다.

Official pathsamples/subsys/sensing/simple/README.html
Source filesamples/subsys/sensing/simple/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

Sensor open·callback·interval·continuous data flow를 설명합니다.

Device

BMI160 emulator

Sensors

2

Target

native_sim

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 F412C61EA8C4624B2F59AC0ABCF5C049CE34DC0108081C32490006500AEF665A
.. zephyr:code-sample:: sensing
   :name: Sensing subsystem
   :relevant-api: sensing_api

   Get high-level sensor data in defined intervals.

Overview
********

A simple sample that shows how to use the sensors with sensing subsystem APIs. It defines
two sensors, with the underlying device bmi160 emulator, and gets the sensor
data in defined interval.

The program runs in the following sequence:

#. Define the sensor in the dts

#. Open the sensor

#. Register call back.

#. Set sample interval

#. Run forever and get the sensor data.

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

This application can be built and executed on :ref:`native_sim <native_sim>` as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/sensing/simple
   :host-os: unix
   :board: native_sim
   :goals: run
   :compact:

To build for another board, change "native_sim" above to that board's name.
At the current stage, it only support native sim.

Part 3

한국어 전문 번역

개요

Sensing subsystem API로 sensor를 사용하는 방법을 보여 주는 간단한 sample입니다. BMI160 emulator를 underlying device로 사용하는 sensor 두 개를 정의하고 정해진 interval마다 sensor data를 가져옵니다.

Program은 다음 순서로 계속 실행됩니다.

  1. Devicetree(DTS)에 sensor를 정의합니다.
  2. Sensor를 엽니다.
  3. Callback을 등록합니다.
  4. Sample interval을 설정합니다.
  5. 무한히 실행하면서 sensor data를 받습니다.

빌드 및 실행

다음 command로 native_sim에서 application을 build하고 실행합니다.

west build -b native_sim samples/subsys/sensing/simple
west build -t run

다른 board를 대상으로 하려면 command의 native_sim을 해당 board 이름으로 바꿉니다. 다만 이 문서가 작성된 단계에서는 native simulator만 지원합니다.

Source

출처

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