Skip to content

Commit

Permalink
doc: devicetree: overhaul bindings guide
Browse files Browse the repository at this point in the history
The binding-template.yaml file has grown organically into something
that's out of control.

It makes too many 'see above' and 'see below' references to be read
comfortably, and we can't cross reference from YAML.

There are also many example DTS and YAML fragments scattered about in
comments, which cannot be syntax highlighted properly.

Fix that by overhauling the documentation into bindings.rst in the DT
guide. This will let us link to individual sections when answering
questions, allows us to cross-reference and use '.. code-block::',
etc.

A couple of things need to go to other pages.

Signed-off-by: Martí Bolívar <[email protected]>
  • Loading branch information
mbolivar-nordic authored and carlescufi committed Apr 22, 2021
1 parent 43086d3 commit 4c2886c
Show file tree
Hide file tree
Showing 4 changed files with 909 additions and 472 deletions.
6 changes: 6 additions & 0 deletions doc/guides/dts/api-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ number 0 or 1 in the case of booleans. For example:
DT_PROP(I2C1, status) /* expands to the string literal "okay" */
.. note::

Don't use DT_NODE_HAS_PROP() for boolean properties. Use DT_PROP() instead
as shown above. It will expand to either 0 or 1 depending on if the property
is present or absent.

Properties with type ``array``, ``uint8-array``, and ``string-array`` work
similarly, except ``DT_PROP()`` expands to an array initializer in these cases.
Here is an example devicetree fragment:
Expand Down
Loading

0 comments on commit 4c2886c

Please sign in to comment.