Lines Matching +full:driver +full:- +full:bar
1 .. _dt-from-c:
8 :ref:`devicetree-intro` and :ref:`dt-bindings`. See :ref:`dt-reference` for
26 .. _dt-node-identifiers:
43 label <dt-node-labels>`. Node labels are often provided by SoC :file:`.dtsi`
50 :zephyr:code-sample:`blinky`, which uses the ``led0`` alias) that need to
72 .. _dt-node-main-ex:
77 .. literalinclude:: main-example.dts
79 :start-after: start-after-here
83 - ``DT_PATH(soc, i2c_40002000)``
84 - ``DT_NODELABEL(i2c1)``
85 - ``DT_ALIAS(sensor_controller)``
86 - ``DT_INST(x, vnd_soc_i2c)`` for some unknown number ``x``. See the
91 Non-alphanumeric characters like dash (``-``) and the at sign (``@``) in
95 .. _node-ids-are-not-values:
102 .. code-block:: c
112 .. code-block:: c
127 - :ref:`dt-checking-property-exists`
128 - :ref:`simple-properties`
129 - :ref:`reg-properties`
130 - :ref:`interrupts-properties`
131 - :ref:`phandle-properties`
133 .. _dt-checking-property-exists:
139 the :ref:`example devicetree <dt-node-main-ex>` above:
141 .. code-block:: c
146 .. _simple-properties:
154 For example, to read the ``clock-frequency`` property's value in the
155 :ref:`above example <dt-node-main-ex>`:
157 .. code-block:: c
165 The DTS property ``clock-frequency`` is spelled ``clock_frequency`` in C.
173 .. code-block:: c
185 Properties with type ``array``, ``uint8-array``, and ``string-array`` work
189 .. code-block:: devicetree
193 b = [aa bb cc dd]; /* uint8-array */
194 c = "bar", "baz"; /* string-array */
199 .. code-block:: c
205 char* c[] = DT_PROP(FOO, c); /* {"foo", "bar"} */
210 .. code-block:: c
219 .. _reg-properties:
224 See :ref:`dt-important-props` for an introduction to ``reg``.
233 - ``DT_REG_ADDR(node_id)``: the given node's register block address
234 - ``DT_REG_SIZE(node_id)``: its size
239 - ``DT_REG_ADDR_BY_IDX(node_id, idx)``: address of register block at index
241 - ``DT_REG_SIZE_BY_IDX(node_id, idx)``: size of block at index ``idx``
247 .. code-block:: c
255 .. _interrupts-properties:
260 See :ref:`dt-important-props` for a brief introduction to ``interrupts``.
268 .. code-block:: c
284 Here, "processed" reflects Zephyr's devicetree :ref:`dt-scripts`, which
285 change the ``irq`` number in :ref:`zephyr.dts <devicetree-in-out-files>` to
291 a device driver.
293 .. _phandle-properties:
300 See :ref:`dt-phandles` for a detailed guide to phandles.
302 Property values can refer to other nodes using the ``&another-node`` phandle
303 syntax introduced in :ref:`dt-writing-property-values`. Properties which
304 contain phandles have type ``phandle``, ``phandles``, or ``phandle-array`` in
312 the tree. In this case, you usually want to convert the devicetree-level
313 phandle to a Zephyr driver-level :ref:`struct device <device_model_api>`.
314 See :ref:`dt-get-device` for ways to do that.
318 There are also hardware-specific shorthands like :c:macro:`DT_GPIO_CTLR_BY_IDX`,
326 .. _other-devicetree-apis:
333 - :c:macro:`DT_CHOSEN`, :c:macro:`DT_HAS_CHOSEN`: for properties
335 - :c:macro:`DT_HAS_COMPAT_STATUS_OKAY`, :c:macro:`DT_NODE_HAS_COMPAT`: global- and
336 node-specific tests related to the ``compatible`` property
337 - :c:macro:`DT_BUS`: get a node's bus controller, if there is one
338 - :c:macro:`DT_ENUM_IDX`: for properties whose values are among a fixed list of
340 - :ref:`devicetree-flash-api`: APIs for managing fixed flash partitions.
341 Also see :ref:`flash_map_api`, which wraps this in a more user-friendly API.
343 Device driver conveniences
347 rely on :ref:`instance identifiers <dt-node-identifiers>`.
350 driver implements support for. This ``compat`` value is what you would pass to
356 .. code-block:: c
371 See :ref:`devicetree-inst-apis` for a generic API reference.
377 readability for hardware specific code. See :ref:`devicetree-hw-api` for
385 :ref:`devicetree_generated.h <dt-outputs>`. This file contains macros with
393 This section contains an Augmented Backus-Naur Form grammar for these