How to add GPIO for port 1 on ncs v2.4.0?

I see the leds node in C:\ncs\v2.4.0\zephyr\boards\arm\nrf5340dk_nrf5340\nrf5340_cpuapp_common.dts file.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
label = "Green LED 0";
};
led1: led_1 {
gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
label = "Green LED 1";
};
led2: led_2 {
gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
label = "Green LED 2";
};
led3: led_3 {
gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
label = "Green LED 3";
};
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

If I want to add led4 for port 1, pin 09, how can I add it?

Parents
  • Hello,

    See the nRF Connect SDK fundamentals on devicetree here.

    Also note that the nRF5340 DK has 4 LEDs (with node labels led0 - led3). If you want to use more LEDs you need custom hardware.

    Best regards,

    Maria

  • Thanks for your reply! I am using custom hardware. Is the following description correct for led4 using port 1, pin 09.

    Fullscreen
    1
    2
    3
    4
    led4: led_4 {
    gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
    label = "Green LED 4";
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Reply
  • Thanks for your reply! I am using custom hardware. Is the following description correct for led4 using port 1, pin 09.

    Fullscreen
    1
    2
    3
    4
    led4: led_4 {
    gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
    label = "Green LED 4";
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Children