Lines Matching +full:child +full:- +full:ref
1 .. _dt-binding-compat:
8 For a detailed syntax reference, see :ref:`dt-bindings-file-syntax`.
10 Devicetree nodes are matched to bindings using their :ref:`compatible
11 properties <dt-important-props>`.
13 During the :ref:`build_configuration_phase`, the build system tries to match
18 .. _dt-bindings-simple-example:
25 .. code-block:: devicetree
28 bar-device {
29 compatible = "foo-company,bar-device";
30 num-foos = <3>;
35 .. code-block:: yaml
39 compatible: "foo-company,bar-device"
42 num-foos:
46 The build system matches the ``bar-device`` node to its YAML binding because
53 the devicetree's contents into the generated :ref:`devicetree_generated.h
54 <dt-outputs>` header file.
57 required ``num-foos`` property is present in the ``bar-device`` node, and that
60 The build system will then generate a macro for the ``bar-device`` node's
61 ``num-foos`` property, which will expand to the integer literal ``3``. This
63 discussed later in this guide in :ref:`dt-from-c`.
66 has no ``num-foos`` property, and this property is marked required in the
69 .. code-block:: devicetree
71 bad-node {
72 compatible = "foo-company,bar-device";
84 .. code-block:: devicetree
86 baz-device {
87 compatible = "foo-company,baz-device", "generic-baz-device";
90 The ``baz-device`` node would get matched to a binding with a ``compatible:
91 "generic-baz-device"`` line if the build system can't find a binding with a
92 ``compatible: "foo-company,baz-device"`` line.
95 their parent nodes. These are called "child bindings". If a node describes
97 account when matching nodes to bindings. (See :ref:`dt-bindings-on-bus` for
100 See :ref:`dt-zephyr-user` for information about a special node that doesn't
103 .. _dt-where-bindings-are-located:
109 above example binding would be named :file:`foo-company,bar-device.yaml` by
115 - the zephyr repository
116 - your :ref:`application source directory <application>`
117 - your :ref:`board directory <board_porting_guide>`
118 - any :ref:`shield directories <shields>`
119 - any directories manually included in the :ref:`DTS_ROOT <dts_root>`
121 - any :ref:`module <modules>` that defines a ``dts_root`` in its
122 :ref:`modules_build_settings`
133 For example, if :file:`my-app` is your application directory, then you must
134 place application-specific bindings inside :file:`my-app/dts/bindings`. So
135 :file:`my-app/dts/bindings/serial/my-company,my-serial-port.yaml` would be
136 found, but :file:`my-app/my-company,my-serial-port.yaml` would be ignored.