Skip to content

Commit

Permalink
boards: ti: lp_em_2340r5: Add PWM led support
Browse files Browse the repository at this point in the history
Add default pwm leds:
 - pwm_led0 - red led on the board
 - pwm_led1 - green led on the board

Signed-off-by: Stoyan Bogdanov <[email protected]>
  • Loading branch information
bogdanovs committed Jan 24, 2025
1 parent 397b1b8 commit 22cc550
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions boards/ti/lp_em_cc2340r5/lp_em_cc2340r5.dts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "boosterpack_connector.dtsi"
#include "lp_em_cc2340r5-pinctrl.dtsi"
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
Expand All @@ -30,6 +31,8 @@
led1 = &led1;
sw0 = &btn0;
sw1 = &btn1;
pwm-led0 = &pwm_green;
pwm-led1 = &pwm_red;
};

leds {
Expand All @@ -46,6 +49,20 @@
};
};

pwmleds {
compatible = "pwm-leds";

pwm_green: pwm_led_0 {
pwms = <&pwm6 0 1000 PWM_POLARITY_NORMAL>;
label = "Green PWM LED";
};

pwm_red: pwm_led_1 {
pwms = <&pwm5 0 1000 PWM_POLARITY_NORMAL>;
label = "Red PWM LED";
};
};

keys {
compatible = "gpio-keys";

Expand Down Expand Up @@ -73,3 +90,25 @@
pinctrl-0 = <&uart0_rx_default &uart0_tx_default>;
pinctrl-names = "default";
};

&lgpt1 {
clk-prescale = <0>;
status = "okay";
};

&lgpt2 {
clk-prescale = <0>;
status = "okay";
};

&pwm5 {
pinctrl-0 = <&pwm5_default>;
pinctrl-names = "default";
status = "okay";
};

&pwm6 {
pinctrl-0 = <&pwm6_default>;
pinctrl-names = "default";
status = "okay";
};

0 comments on commit 22cc550

Please sign in to comment.