Skip to content

Commit 87eff28

Browse files
soburiDhruvaG2000
authored andcommitted
documentation: Add document about builtin-led-gpios
Add a description for `builtin-led-gpios` Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent d37253c commit 87eff28

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

documentation/variants.md

+28
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,34 @@ The following example instantiates `Wire` and `Wire2` with each `i2c0` and `i2c1
129129
};
130130
```
131131

132+
### Configure Builtin-LED
133+
134+
The `builtin-led-gpios` node defines the Builtin-LED.
135+
This node defines the `LED_BUILTIN` value by looking up the `digital-pin-gpios`
136+
array to find the index of the pin.
137+
138+
The node is phandle-array, which uses the format same as `digital-pin-gpios`.
139+
140+
It set the digital pin number to the `LED_BUILTIN` if found the pin
141+
that defined in `builtin-led-gpios` from `digital-pin-gpios`.
142+
143+
If the `builtin-led-gpios` is not defined, Use the node aliased as `led0`
144+
to define `LED_BUILTIN`.
145+
146+
The `LED_BUILTIN` does not define here if it has not found both nodes or
147+
defined `LED_BUILTIN` already.
148+
149+
For example, in the case of the 13th digital pins connected to the onboard LED,
150+
define `builtin-led-gpios` as follows.
151+
152+
```
153+
/ {
154+
zephyr,user {
155+
builtin-led-gpios = <&arduino_nano_header 13 0>;
156+
};
157+
};
158+
```
159+
132160
### Overlays from scratch
133161

134162
You can see in the example above that there is no mapping for `LED0` in the

0 commit comments

Comments
 (0)