1# Copyright (c) 2024 TOKITA Hiroshi
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5  Generic LED strip matrix (LED strip arranged in a grid pattern)
6
7compatible: "led-strip-matrix"
8
9include: display-controller.yaml
10
11properties:
12  circulative:
13    type: boolean
14    description: |
15      Use a circulative layout that returns to the left edge of the next row
16      after reaching the right edge.
17      If not set, turn around and go left in a serpentine layout when it reaches
18      the right edge.
19
20      * circulative layout
21        [ 0][ 1][ 2][ 3]
22        [ 4][ 5][ 6][ 7]
23        [ 8][ 9][10][11]
24        [12][13][14][15]
25
26      * serpentine layout
27        [ 0][ 1][ 2][ 3]
28        [ 7][ 6][ 5][ 4]
29        [ 8][ 9][10][11]
30        [15][14][13][12]
31
32  start-from-right:
33    type: boolean
34    description: |
35      Specify if the first LED is at the right.
36
37      * Start from the right with a serpentine layout
38        [ 3][ 2][ 1][ 0]
39        [ 4][ 5][ 6][ 7]
40        [11][10][ 9][ 8]
41        [12][13][14][15]
42
43      * Start from the right with a circulative layout
44        [ 3][ 2][ 1][ 0]
45        [ 7][ 6][ 5][ 4]
46        [11][10][ 9][ 8]
47        [15][14][13][12]
48
49  start-from-bottom:
50    type: boolean
51    description: |
52      Specify if the first LED is at the bottom.
53
54      * Start from the bottom with a circulative layout
55        [12][13][14][15]
56        [ 8][ 9][10][11]
57        [ 4][ 5][ 6][ 7]
58        [ 0][ 1][ 2][ 3]
59
60      * Start from the bottom with a serpentine layout
61        [15][14][13][12]
62        [ 8][ 9][10][11]
63        [ 7][ 6][ 5][ 4]
64        [ 0][ 1][ 2][ 3]
65
66  width:
67    description: |
68      Specifies the overall width of the matrix.
69      If the matrix consists of multiple modules, it is the sum of their widths.
70
71  height:
72    description: |
73      Specifies the overall height of the matrix.
74      If the matrix consists of multiple modules, it is the sum of their heights.
75
76  horizontal-modules:
77    type: int
78    default: 1
79    description: |
80      If the display forms with multiple modules,
81      specify the horizontal number of modules.
82      The number must be able to divide the width value.
83      If not set, it controls a single matrix.
84
85      * 8x4 display with 2 serpentine layout modules
86        [ 0][ 1][ 2][ 3]  [16][17][18][19]
87        [ 7][ 6][ 5][ 4]  [23][22][21][20]
88        [ 8][ 9][10][11]  [24][25][26][27]
89        [15][14][13][12]  [31][30][29][28]
90
91  vertical-modules:
92    type: int
93    default: 1
94    description: |
95      If the display forms with multiple modules,
96      specify the vertical number of modules.
97      The number must be able to divide the height value.
98      If not set, it controls a single matrix.
99
100      * 4x8 display with 2 serpentine layout modules
101        [ 0][ 1][ 2][ 3]
102        [ 7][ 6][ 5][ 4]
103        [ 8][ 9][10][11]
104        [15][14][13][12]
105
106        [16][17][18][19]
107        [23][22][21][20]
108        [24][25][26][27]
109        [31][30][29][28]
110
111  modules-circulative:
112    type: boolean
113    description: |
114      Specifies that the order of the modules that make up the matrix is circulative.
115
116      * circulative module layout
117        [M0][M1][M2]
118        [M3][M4][M5]
119        [M6][M7][M8]
120
121      * serpentine module layout
122        [M0][M1][M2]
123        [M5][M4][M3]
124        [M6][M7][M8]
125
126  modules-start-from-right:
127    type: boolean
128    description: |
129      Specifies that modules are ordered from right to left.
130
131      * Start from the right with a module serpentine layout
132        [M2][M1][M0]
133        [M3][M4][M5]
134        [M8][M7][M6]
135
136      * Start from the right with a module circulative layout
137        [M2][M1][M0]
138        [M5][M4][M3]
139        [M8][M7][M6]
140
141  modules-start-from-bottom:
142    type: boolean
143    description: |
144      Specifies that modules are ordered from bottom to top.
145
146      * Start from the right with a module serpentine layout
147        [M6][M7][M8]
148        [M5][M4][M3]
149        [M0][M1][M2]
150
151      * Start from the right with a module circulative layout
152        [M6][M7][M8]
153        [M3][M4][M5]
154        [M0][M1][M2]
155
156  led-strips:
157    type: phandles
158    required: true
159    description: |
160      Specify the LED strip that is the substance of the matrix.
161      If multiple strips are specified, they are "flattened" and sequentialized.
162      For example, if `strip0` and `strip1` with 128 LEDs are specified,
163      the first LED of `strip1` will be treated as the 129th LED.
164      These LEDs are mapped to coordinates according to the layout rule in order.
165      The amount of LEDs must equal the [width * height] value.
166
167  chain-lengths:
168    type: array
169    description: |
170      Specify the number of LEDs for each strip.
171      It can omit the value if all strip nodes have a `chain-length` property.
172      Each value must be a multiple of the number of LEDs per module
173      [(width / horizontal-modules) * (height / vertical-modules)].
174
175  pixel-format:
176    type: int
177    default: 1
178    description: |
179      Initial Pixel format.
180      See dt-bindings/display/panel.h for a list.
181      This property only accepts PANEL_PIXEL_FORMAT_RGB_888 and PANEL_PIXEL_FORMAT_RRGB_8888.
182      If this property is not set, use PANEL_PIXEL_FORMAT_RGB_888 as a default.
183