Skip to content

Commit e4be5a6

Browse files
committed
documentation: Add document about builtin-led-gpios
Add a description for `builtin-led-gpios` Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
1 parent 2cbc33b commit e4be5a6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

documentation/variants.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,34 @@ uses [the Arduino header definitions](https://github.com/zephyrproject-rtos/zeph
8484
};
8585
```
8686

87+
### Configure Builtin-LED
88+
89+
The `builtin-led-gpios` node defines the Builtin-LED.
90+
This node defines the `LED_BUILTIN` value by looking up the `digital-pin-gpios`
91+
array to find the index of the pin.
92+
93+
The node is phandle-array, which uses the format same as `digital-pin-gpios`.
94+
95+
It set the digital pin number to the `LED_BUILTIN` if found the pin
96+
that defined in `builtin-led-gpios` from `digital-pin-gpios`.
97+
98+
If the `builtin-led-gpios` is not defined, Use the node aliased as `led0`
99+
to define `LED_BUILTIN`.
100+
101+
The `LED_BUILTIN` does not define here if it has not found both nodes or
102+
defined `LED_BUILTIN` already.
103+
104+
For example, in the case of the 13th digital pins connected to the onboard LED,
105+
define `builtin-led-gpios` as follows.
106+
107+
```
108+
/ {
109+
zephyr,user {
110+
builtin-led-gpios = <&arduino_nano_header 13 0>;
111+
};
112+
};
113+
```
114+
87115
### Overlays from scratch
88116

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

0 commit comments

Comments
 (0)