# デバイスツリーファイル

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

[デバイスツリー(英語)](https://elinux.org/Device_Tree_Usage)は、主にハードウェアを記述するために使用される階層データ構造です。

CLion は  `.dts`  /  `.dtsi`  ファイルを認識し、コーディング支援およびコード解析機能を提供します。

Procedure: ボードを構成する (Zephyr)

[Zephyr(英語)](https://www.zephyrproject.org) を使用している場合は、設定で使用しているボードを必ず選択してください。

1. `設定 | 言語 & フレームワーク | デバイスツリー`  に進みます。

2. 次のいずれかのオプションを使用します。

* CMake から Zephyr 設定を派生する CMake と同期する オプションはデフォルトで有効になっています。 ボード名を取得するには `find_package(Zephyr)` コマンドが必要であることに注意してください。

* Zephyr のインストールパスを指定し、ボードを選択する CMake と同期する チェックボックスをオフにします。 Zephyr インストールが自動的に検出されなかった場合は、そのパスを指定し、リストからボードを選択します。 ![ボードの選択](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_board_settings.png)

> **Tip:**
> [Zephyr のデバイスツリー(英語)](https://docs.zephyrproject.org/latest/build/dts/index.html)について詳しくは、こちらを参照してください。

Procedure: コード支援

以下に、デバイスツリーファイルで利用できるコーディング支援機能の例をいくつか示します。

* 構文のハイライトとコードのフォーマット:

![デバイスツリーの構文ハイライトとコードフォーマット](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_syntaxhighlight.png)

> **Tip:**
> カラースキームは  `設定 | エディター | カラースキームの切り替え | デバイスツリー`  で、コードスタイルは  `設定 | エディター | コードスタイル | デバイスツリー`  で設定できます。

* ノードのコードの折りたたみ:

![コード折りたたみガターアイコン](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_folding_unfold.png)

![折りたたまれたブロック](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_folding_fold.png)

> **Tip:**
> すべてのコードフラグメントを折りたたむには `Ctrl+Shift+NumPad -` (Windows), `⌘ ⇧ NumPad -` (macOS), `⌘ ⇧ NumPad -` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ Minus` (macOS System Shortcuts), `Ctrl+Shift+NumPad -` (XWin), `Ctrl+Shift+NumPad -` (GNOME), `Ctrl+Shift+NumPad -` (KDE), `Ctrl+Shift+NumPad -` (Emacs), `Ctrl+K, Ctrl+1` (Sublime Text), `⌘ K, ⌘ 1` (Sublime Text (macOS)), `⌘ ⇧ NumPad -` (Xcode), `Ctrl+M, A` (Visual Studio), `⌃ M, A` (Visual Studio (macOS)), `Ctrl+M, A` (ReSharper), `⌃ M, A` (ReSharper (macOS)), `Ctrl+Shift+NumPad -` (QtCreator), `⌘ ⇧ NumPad -` (QtCreator (macOS)), `Ctrl+Shift+NumPad -` (NetBeans), `Ctrl+Shift+NumPad /` (Eclipse), `⌘ ⇧ NumPad /` (Eclipse (macOS)) を押し、すべてのコードフラグメントを展開するには `Ctrl+Shift+NumPad +` (Windows), `⌘ ⇧ NumPad +` (macOS), `⌘ ⇧ NumPad +` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ Plus` (macOS System Shortcuts), `Ctrl+Shift+NumPad +` (XWin), `Ctrl+Shift+NumPad +` (GNOME), `Ctrl+Shift+NumPad +` (KDE), `Ctrl+Shift+NumPad +` (Emacs), `Ctrl+K, Ctrl+J` (Sublime Text), `⌘ K, ⌘ J` (Sublime Text (macOS)), `⌘ ⇧ NumPad +` (Xcode), `Ctrl+M, X` (Visual Studio), `⌃ M, X` (Visual Studio (macOS)), `Ctrl+M, X` (ReSharper), `⌃ M, X` (ReSharper (macOS)), `Ctrl+Shift+NumPad +` (QtCreator), `⌘ ⇧ NumPad +` (QtCreator (macOS)), `Ctrl+Shift+NumPad +` (NetBeans), `Ctrl+NumPad *` (Eclipse), `⌘ NumPad *` (Eclipse (macOS)) を押します。
>
>
>
> 詳細については、 [コードの折りたたみ](working-with-source-code.html#code_folding)を参照してください。

* デバイスツリー要素の簡単なドキュメント:

![デバイスツリー要素のクイックドキュメント](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_quickdoc.png)

> **Tip:**
> ドキュメントを表示する際、CLion は [Zephyr バインディング](https://docs.zephyrproject.org/latest/build/dts/bindings-syntax.html#property-entry-syntax)から追加情報を読み込みます。

デフォルトでは、マウスをホバーするとクイックドキュメントが表示されます。 これを変更する方法とこの機能に関する一般情報については、 [クイックドキュメント](viewing-inline-documentation.html)を参照してください。

* デバイスツリーファイルの構造ビュー:

![デバイスツリーの構造ビュー](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_structureview.png)

構造ビューを開くには、メインメニューの  `表示 | ツールウィンドウ | 構造`  に移動するか、 `Alt+7` (Windows), `⌘ 7` (macOS), `⌘ 7` (IntelliJ IDEA Classic (macOS)), `⌘ 7` (macOS System Shortcuts), `Alt+7` (XWin), `Alt+7` (GNOME), `Alt+7` (KDE), `Alt+7` (Emacs), `Alt+7` (Sublime Text), `⌘ 7` (Sublime Text (macOS)), `⌘ 3` (Xcode), `Ctrl+Alt+F` (Visual Studio), `⌃ ⌥ F` (Visual Studio (macOS)), `Ctrl+F11` (ReSharper), `⌃ F11` (ReSharper (macOS)), `Alt+7` (QtCreator), `⌘ 7` (QtCreator (macOS)), `Ctrl+7` (NetBeans), `Alt+7` (Eclipse), `⌘ 7` (Eclipse (macOS)) を押します。

* 標準プロパティ、  `/commands/`  、ラベル、そしてコード要素のコード補完:

![dts コマンドのコード強制](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_completion.png)

![dts 要素のコード補完](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_completion_watchdog.png)

* 上書きされたプロパティを示す線マーカー。 これを使って元のプロパティへ移動することもできます:

![上書きされたプロパティのハイライト](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_overriddenprop.png)

![上書きされたプロパティへの移動](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_overriddenprop_hover.png)

* 入力中に欠落しているセミコロン、一致する中括弧、引用符が自動的に挿入されます。

Procedure: デバイスツリーコードのクイックフィックスとインテンション

* CLion はデバイスツリーコードの一連のチェックを提供します。

`設定 | エディター | インスペクション`  内のインスペクションのリストを調べて調整できます。

![デバイスツリーインスペクション](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_inspections.png)

例えば、CLion はコード内の名前を検証します：

![名前の検証](https://resources.jetbrains.com/help/img/idea/2026.3/cl_dts_badcharacter.png)

## See also

### プロシージャ

[マルチスレッド RTOS デバッグ](rtos-debug.html)

