hardware/peripherals/sensor/device_tree.html · hardware/peripherals/sensor/device_tree.rst 공식 원문 ↗

Zephyr 3.7.0 · Hardware · Peripherals · Sensor · Device Tree

Device Tree

Binding과 board devicetree로 power mode·rate·filter·scale의 초기 상태를 정합니다.

Official pathhardware/peripherals/sensor/device_tree.html
Source filehardware/peripherals/sensor/device_tree.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

ICM42688 accelerometer·gyroscope 구성 예제를 보존합니다.

Initial state

binding · board devicetree

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 23064BE99BE516D59C3F631E52183B6334D6C072589DDEA5BFAEA255D81D1EB6
Device Tree
###########

In the context of sensors device tree provides the initial hardware configuration
for sensors on a per device level. Each device must specify a device tree binding
in Zephyr, and ideally, a set of hardware configuration options for things such
as channel power modes, data rates, filters, decimation, and scales. These can
then be used in a boards devicetree to configure a sensor to its initial state.

.. code-block:: dts

   #include <zephyr/dt-bindings/icm42688.h>

   &spi0 {
       /* SPI bus options here, not shown */

       accel_gyro0: icm42688p@0 {
           compatible = "invensense,icm42688";
           reg = <0>;
           int-gpios = <&pioc 6 GPIO_ACTIVE_HIGH>; /* SoC specific pin to select for interrupt line */
           spi-max-frequency = <DT_FREQ_M(24)>; /* Maximum SPI bus frequency */
           accel-pwr-mode = <ICM42688_ACCEL_LN>; /* Low noise mode */
           accel-odr = <ICM42688_ACCEL_ODR_2000>; /* 2000 Hz sampling */
           accel-fs = <ICM42688_ACCEL_FS_16>; /* 16G scale */
           gyro-pwr-mode = <ICM42688_GYRO_LN>; /* Low noise mode */
           gyro-odr = <ICM42688_GYRO_ODR_2000>; /* 2000 Hz sampling */
           gyro-fs = <ICM42688_GYRO_FS_16>; /* 16G scale */
       };
    };

Part 3

한국어 전문 번역

Sensor에서 devicetree는 device별 initial hardware configuration을 제공합니다. 각 device는 Zephyr devicetree binding을 지정해야 하며, 이상적으로 channel power mode, data rate, filter, decimation, scale 같은 hardware configuration option 집합도 제공해야 합니다.

Board devicetree는 이 option을 사용해 sensor의 initial state를 구성할 수 있습니다.

#include <zephyr/dt-bindings/icm42688.h>

&spi0 {
    /* SPI bus options here, not shown */

    accel_gyro0: icm42688p@0 {
        compatible = "invensense,icm42688";
        reg = <0>;
        int-gpios = <&pioc 6 GPIO_ACTIVE_HIGH>; /* SoC specific pin to select for interrupt line */
        spi-max-frequency = <DT_FREQ_M(24)>; /* Maximum SPI bus frequency */
        accel-pwr-mode = <ICM42688_ACCEL_LN>; /* Low noise mode */
        accel-odr = <ICM42688_ACCEL_ODR_2000>; /* 2000 Hz sampling */
        accel-fs = <ICM42688_ACCEL_FS_16>; /* 16G scale */
        gyro-pwr-mode = <ICM42688_GYRO_LN>; /* Low noise mode */
        gyro-odr = <ICM42688_GYRO_ODR_2000>; /* 2000 Hz sampling */
        gyro-fs = <ICM42688_GYRO_FS_16>; /* 16G scale */
    };
 };

Source

출처

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