boards: arm: rpi_pico: add pwm bindings to devictree

Add bindings for pwm-leds to the rpi pico board. The default
pwm binding is connected to the onboard LED (P25).

Signed-off-by: Joep Buruma <burumaj50@gmail.com>
This commit is contained in:
Joep Buruma 2022-02-18 21:16:59 +01:00 committed by Carles Cufí
parent 7e0fff24c7
commit b876ad9d6f
4 changed files with 27 additions and 0 deletions

View file

@ -70,6 +70,9 @@ hardware features:
* - Watchdog Timer (WDT)
- :kconfig:option:`CONFIG_WATCHDOG`
- :dtcompatible:`raspberrypi,pico-watchdog`
* - PWM
- :kconfig: `CONFIG_PWM`
- :dtcompatible: `raspberrypi,pico-pwm`
Programming and Debugging
*************************

View file

@ -31,4 +31,10 @@
input-schmitt-enable;
};
};
pwm_ch4b_default: pwm_ch4b_default {
group1 {
pinmux = <PWM_4B_P25>;
};
};
};

View file

@ -8,6 +8,7 @@
#include <rpi_pico/rp2040.dtsi>
#include "rpi_pico-pinctrl.dtsi"
#include <dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/i2c/i2c.h>
@ -34,9 +35,19 @@
#clock-cells = <0>;
};
pwm_leds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
status = "disabled";
pwms = <&pwm 9 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "PWM_LED";
};
};
aliases {
led0 = &led0;
watchdog0 = &wdt0;
pwm-led0 = &pwm_led0;
};
};
@ -99,3 +110,9 @@
zephyr_udc0: &usbd {
status = "okay";
};
&pwm {
pinctrl-0 = <&pwm_ch4b_default>;
pinctrl-names = "default";
divider-int-0 = <255>;
};

View file

@ -14,3 +14,4 @@ supported:
- i2c
- hwinfo
- watchdog
- pwm