Skip to content

Commit

Permalink
boards: nordic: nrf54h20dk: add pwm_led on cpuppr
Browse files Browse the repository at this point in the history
Added pwmleds node to cpuppr board devicetree and
nordic-ppr snippet to allow running pwm samples.

Signed-off-by: Michał Stasiak <[email protected]>
  • Loading branch information
mstasiaknordic committed Nov 25, 2024
1 parent c36b3c0 commit 054f89f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
47 changes: 47 additions & 0 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,46 @@
zephyr,sram = &cpuppr_code_data;
zephyr,shell-uart = &uart135;
};

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
label = "Green LED 0";
};
led1: led_1 {
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
label = "Green LED 1";
};
led2: led_2 {
gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>;
label = "Green LED 2";
};
led3: led_3 {
gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
label = "Green LED 3";
};
};

pwmleds {
compatible = "pwm-leds";
/*
* LEDs are connected to GPIO Port 9 - pins 0-3. There is no valid hardware
* configuration to pass PWM signal on pis 0 and 1. First valid config is P9.2.
* Signal on PWM130's channel 0 can be passed directly on GPIO Port 9 pin 2.
*/
pwm_led2: pwm_led_2 {
pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
};

aliases {
led0 = &led0;
led1 = &led1;
led2 = &led2;
led3 = &led3;
pwm-led0 = &pwm_led2;
};
};

&cpuapp_cpuppr_ipc {
Expand Down Expand Up @@ -56,3 +96,10 @@
pinctrl-1 = <&uart136_sleep>;
pinctrl-names = "default", "sleep";
};

&pwm130 {
status = "okay";
pinctrl-0 = <&pwm130_default>;
pinctrl-1 = <&pwm130_sleep>;
pinctrl-names = "default", "sleep";
};
5 changes: 5 additions & 0 deletions snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
&uart135 {
status = "reserved";
};

&pwm130 {
status = "reserved";
interrupt-parent = <&cpuppr_clic>;
};

0 comments on commit 054f89f

Please sign in to comment.