From 0f5731e559ce95a84614cbcbfad6f88b14d6224e Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Tue, 22 Mar 2022 11:06:52 +0100 Subject: [PATCH] samples: blinky pwm running on the nucleo_l4r5zi Adding an overlay to configure the nucleo_l4r5zi for testing the pwm blinky application on red led (PB14 on nucleo board) Each has a specific pwm output from different timers/channels Signed-off-by: Francois Ramu GitOrigin-RevId: 8043fb922a4e682cf38dda4476f7a1f3357eb981 Change-Id: If69f9d5d32ac716e1ba9daf3ce36a868a59051d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/3562859 Tested-by: CopyBot Service Account Reviewed-by: Keith Short Commit-Queue: Keith Short Tested-by: Keith Short --- .../blinky_pwm/boards/nucleo_l4r5zi.overlay | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 samples/basic/blinky_pwm/boards/nucleo_l4r5zi.overlay diff --git a/samples/basic/blinky_pwm/boards/nucleo_l4r5zi.overlay b/samples/basic/blinky_pwm/boards/nucleo_l4r5zi.overlay new file mode 100644 index 00000000000..7e40a648008 --- /dev/null +++ b/samples/basic/blinky_pwm/boards/nucleo_l4r5zi.overlay @@ -0,0 +1,32 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2022 STMicroelectronics + */ + +#include +#include + +/ { + pwmleds { + compatible = "pwm-leds"; + + red_pwm_led: red_pwm_led { + pwms = <&pwm1 2 4 (PWM_POLARITY_NORMAL | PWM_STM32_COMPLEMENTARY)>; + }; + }; + + aliases { + pwm-led0 = &red_pwm_led; + }; +}; + +&timers1 { + status = "okay"; + + pwm1: pwm { + status = "okay"; + pinctrl-0 = <&tim1_ch2n_pb14>; + pinctrl-names = "default"; + }; +};