Skip to content

Commit c0cc6c7

Browse files
mbolivar-nordiccarlescufi
authored andcommitted
dts: bindings: gpio-leds: improve description
This is the compatible which is used in the blinky sample, so it's worth trying to add a better example for what you can do with it in general in the main description. Signed-off-by: Martí Bolívar <[email protected]>
1 parent baf2e7f commit c0cc6c7

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

dts/bindings/gpio/gpio-leds.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
11
# Copyright (c) 2018, Linaro Limited
22
# SPDX-License-Identifier: Apache-2.0
33

4-
description: GPIO LEDs parent node
4+
description: |
5+
This allows you to define a group of LEDs. Each LED in the group is
6+
controlled by a GPIO. Each LED is defined in a child node of the
7+
gpio-leds node.
8+
9+
Here is an example which defines three LEDs in the node /leds:
10+
11+
/ {
12+
leds {
13+
compatible = "gpio-leds";
14+
led_0 {
15+
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
16+
};
17+
led_1 {
18+
gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
19+
};
20+
led_2 {
21+
gpios = <&gpio1 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
22+
};
23+
};
24+
};
25+
26+
Above:
27+
28+
- led_0 is pin 1 on gpio0. The LED is on when the pin is low,
29+
and off when the pin is high.
30+
- led_1 is pin 2 on gpio0. The LED is on when the pin is high,
31+
and off when it is low.
32+
- led_2 is pin 15 on gpio1. The LED is on when the pin is low,
33+
and the pin's internal pull-up resistor should be enabled.
534
635
compatible: "gpio-leds"
736

0 commit comments

Comments
 (0)