Skip to content

Commit

Permalink
[nrf fromlist] boards: nordic: Add PWM support for LEDs on nRF54 DKs
Browse files Browse the repository at this point in the history
Adds support for first possible LED to be connected with HW PWM.

Upstream PR: zephyrproject-rtos/zephyr#72010

Signed-off-by: Karol Lasończyk <[email protected]>
  • Loading branch information
kl-cruz committed Apr 29, 2024
1 parent 99187c8 commit 51d14fc
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
14 changes: 14 additions & 0 deletions boards/arm/nrf54h20dk_nrf54h20/nrf54h20dk_nrf54h20-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,18 @@
<NRF_PSEL(UART_CTS, 2, 5)>;
};
};

/omit-if-no-ref/ pwm120_default: pwm120_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 9, 0)>;
};
};

/omit-if-no-ref/ pwm120_sleep: pwm120_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 9, 0)>;
low-power-enable;
};
};

};
15 changes: 15 additions & 0 deletions boards/arm/nrf54h20dk_nrf54h20/nrf54h20dk_nrf54h20_cpuapp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
led1 = &led1;
led2 = &led2;
led3 = &led3;
pwm-led0 = &pwm_led0;
sw0 = &button0;
sw1 = &button1;
sw2 = &button2;
Expand Down Expand Up @@ -89,6 +90,13 @@
};
};

pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&pwm120 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
};

prng: prng {
compatible = "nordic,entropy-prng";
status = "okay";
Expand Down Expand Up @@ -193,3 +201,10 @@ ipc0: &cpuapp_cpurad_ipc {
pinctrl-names = "default", "sleep";
hw-flow-control;
};

&pwm120 {
status = "okay";
pinctrl-0 = <&pwm120_default>;
pinctrl-1 = <&pwm120_sleep>;
pinctrl-names = "default", "sleep";
};
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,17 @@
low-power-enable;
};
};

pwm20_default: pwm20_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 8)>;
};
};

pwm20_sleep: pwm20_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 8)>;
low-power-enable;
};
};
};
15 changes: 15 additions & 0 deletions boards/arm/nrf54l15pdk_nrf54l15/nrf54l15pdk_nrf54l15_cpuapp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
};
};

pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&pwm20 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
};

buttons {
compatible = "gpio-keys";
button0: button_0 {
Expand Down Expand Up @@ -72,6 +79,7 @@
led1 = &led1;
led2 = &led2;
led3 = &led3;
pwm-led0 = &pwm_led0;
watchdog0 = &wdt30;
sw0 = &button0;
sw1 = &button1;
Expand Down Expand Up @@ -205,3 +213,10 @@
&adc {
status = "okay";
};

&pwm20 {
status = "okay";
pinctrl-0 = <&pwm20_default>;
pinctrl-1 = <&pwm20_sleep>;
pinctrl-names = "default", "sleep";
};
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,18 @@
&button3 {
gpios = <&gpio0 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&pinctrl {
/omit-if-no-ref/ pwm20_default: pwm20_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
};
};

/omit-if-no-ref/ pwm20_sleep: pwm20_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
low-power-enable;
};
};
};

0 comments on commit 51d14fc

Please sign in to comment.