File tree Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,13 @@ Devicetree Style Guidelines
17
17
definitions.
18
18
* Don't insert empty lines before a dedenting ``}; ``.
19
19
* Insert a single empty line to separate nodes at the same hierarchy level.
20
+ * When splitting long property values across multiple lines, specify the first
21
+ value on the same line as the opening bracket (``< `` or ``[ ``). Place the
22
+ closing bracket and semicolon (``>; `` or ``]; ``) on the same line after
23
+ the final value of the property.
24
+
25
+ Examples:
26
+
27
+ .. literalinclude :: style-example.dts
28
+ :language: devicetree
29
+ :start-after: start-after-here
Original file line number Diff line number Diff line change
1
+ /*
2
+ * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ *
6
+ * Demonstration of permitted and disallowed coding style for devicetree files.
7
+ */
8
+
9
+ /* start-after-here */
10
+
11
+ /dts-v1/;
12
+
13
+ / {
14
+ /* Node labels use the "_" separator, but node names use "-". */
15
+ psa_rng: psa-rng {
16
+ compatible = "zephyr,psa-crypto-rng";
17
+ status = "okay";
18
+ };
19
+
20
+ ramdisk0 {
21
+ compatible = "zephyr,ram-disk";
22
+ /* Property names use the "-" separator. */
23
+ disk-name = "RAM";
24
+ sector-size = <512>;
25
+ sector-count = <128>;
26
+ };
27
+
28
+ periph0 {
29
+ /* Wrap array values to conform with line lengths. Indent
30
+ * continuation so that values align.
31
+ */
32
+ pinctrl-0 = <&periph0_siga_px0_default &periph0_sigb_py7_default
33
+ &periph0_sigc_pz1_default>;
34
+ pinctrl-names = "default";
35
+ };
36
+
37
+ mipi-dbi {
38
+ compatible = "zephyr,mipi-dbi-spi";
39
+
40
+ lcd0: lcd@0 {
41
+ compatible = "sitronix,st7735r";
42
+ /* Split array values across multiple lines to help readability. */
43
+ gamctrp1 = [10 0E 02 03
44
+ 0E 07 02 07
45
+ 0A 12 27 37
46
+ 00 0D 0E 10];
47
+ gamctrn1 = [10 0E 03 03
48
+ 0F 06 02 08
49
+ 0A 13 26 36
50
+ 00 0D 0E 10];
51
+ };
52
+ };
53
+ };
You can’t perform that action at this time.
0 commit comments