1Device Tree
2###########
3
4In the context of sensors device tree provides the initial hardware configuration
5for sensors on a per device level. Each device must specify a device tree binding
6in Zephyr, and ideally, a set of hardware configuration options for things such
7as channel power modes, data rates, filters, decimation, and scales. These can
8then be used in a boards devicetree to configure a sensor to its initial state.
9
10.. code-block:: dts
11
12   #include <zephyr/dt-bindings/icm42688.h>
13
14   &spi0 {
15       /* SPI bus options here, not shown */
16
17       accel_gyro0: icm42688p@0 {
18           compatible = "invensense,icm42688";
19           reg = <0>;
20           int-gpios = <&pioc 6 GPIO_ACTIVE_HIGH>; /* SoC specific pin to select for interrupt line */
21           spi-max-frequency = <DT_FREQ_M(24)>; /* Maximum SPI bus frequency */
22           accel-pwr-mode = <ICM42688_ACCEL_LN>; /* Low noise mode */
23           accel-odr = <ICM42688_ACCEL_ODR_2000>; /* 2000 Hz sampling */
24           accel-fs = <ICM42688_ACCEL_FS_16>; /* 16G scale */
25           gyro-pwr-mode = <ICM42688_GYRO_LN>; /* Low noise mode */
26           gyro-odr = <ICM42688_GYRO_ODR_2000>; /* 2000 Hz sampling */
27           gyro-fs = <ICM42688_GYRO_FS_16>; /* 16G scale */
28       };
29    };
30