Part 1
요약·해설
공식 build-flow PNG와 source·binding→generated header→devicetree.h 흐름, public·generated macro 구분을 보존했습니다.
Board hardware
Boot-time
C header
DT_ macro
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
C6C81D242DEDE7C9B7F1EDE5DBEE595D3E0C8E09E37E8AC35F27194AF94F080C
.. _devicetree-scope-purpose:
Scope and purpose
*****************
A *devicetree* is primarily a hierarchical data structure that describes
hardware. The `Devicetree specification`_ defines its source and binary
representations.
.. _Devicetree specification: https://www.devicetree.org/
Zephyr uses devicetree to describe:
- the hardware available on its :ref:`boards`
- that hardware's initial configuration
As such, devicetree is both a hardware description language and a configuration
language for Zephyr. See :ref:`dt_vs_kconfig` for some comparisons between
devicetree and Zephyr's other main configuration language, Kconfig.
There are two types of devicetree input files: *devicetree sources* and
*devicetree bindings*. The sources contain the devicetree itself. The bindings
describe its contents, including data types. The :ref:`build system
<build_overview>` uses devicetree sources and bindings to produce a generated C
header. The generated header's contents are abstracted by the ``devicetree.h``
API, which you can use to get information from your devicetree.
Here is a simplified view of the process:
.. figure:: ../../../../build/dts/zephyr_dt_build_flow.png
:figclass: align-center
Devicetree build flow
All Zephyr and application source code files can include and use
``devicetree.h``. This includes :ref:`device drivers <device_model_api>`,
:ref:`applications <application>`, :ref:`tests <testing>`, the kernel, etc.
The API itself is based on C macros. The macro names all start with ``DT_``. In
general, if you see a macro that starts with ``DT_`` in a Zephyr source file,
it's probably a ``devicetree.h`` macro. The generated C header contains macros
that start with ``DT_`` as well; you might see those in compiler error
messages. You always can tell a generated- from a non-generated macro:
generated macros have some lowercased letters, while the ``devicetree.h`` macro
names have all capital letters.
Part 3
한국어 전문 번역
범위와 목적
Devicetree는 주로 hardware를 설명하는 계층형 data structure이며 Devicetree Specification이 text source와 binary 표현을 정의합니다.
Zephyr는 board에서 사용할 수 있는 hardware와 그 hardware의 초기 configuration을 devicetree로 설명합니다. 따라서 Zephyr에서 devicetree는 hardware description language이면서 configuration language입니다. Software build option과의 경계는 Devicetree와 Kconfig 문서를 따릅니다.
입력은 크게 Devicetree source와 Devicetree binding 두 종류입니다. Source에는 실제 tree가 있고 binding은 data type을 포함해 내용을 해석합니다. Build system은 둘을 사용해 C header를 만들고 public devicetree.h API가 생성 header의 세부 형식을 감춥니다.

Driver, application, test, kernel을 포함한 모든 Zephyr와 application source가 devicetree.h를 include해 사용할 수 있습니다.
Public API는 C macro 기반이며 이름이 모두 DT_로 시작합니다. 생성 header의 내부 macro도 DT_로 시작해 compiler error에 나타날 수 있습니다. Public devicetree.h macro 이름은 모두 대문자이고, 생성 macro에는 소문자가 섞이므로 구분할 수 있습니다.
Source
출처
원문 파일의 단락, directive, 표, 코드, symbol, 경로는 영어 원문 영역에 그대로 보존했습니다.