Skip to content

Commit 713375a

Browse files
Raffael Rostagnokartben
authored andcommitted
tests: drivers: ledc_pwm: Add test cases
Add test cases to include coverage for ESP32 HS channels. Signed-off-by: Raffael Rostagno <[email protected]>
1 parent fc8119d commit 713375a

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

tests/drivers/pwm/pwm_gpio_loopback/socs/esp32_procpu.overlay

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: Apache-2.0
33
*
4-
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
4+
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
55
*/
66

77
#include <zephyr/dt-bindings/pwm/pwm.h>
@@ -12,18 +12,24 @@
1212
zephyr,user {
1313
/* GPIO input pins order must match PWM pinctrl config */
1414
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
15-
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
15+
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>,
16+
<&gpio0 4 ESP32_GPIO_PIN_OUT_EN>,
17+
<&gpio0 5 ESP32_GPIO_PIN_OUT_EN>;
1618

1719
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
18-
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
20+
<&ledc0 5 80000 PWM_POLARITY_INVERTED>,
21+
<&ledc0 9 1000000 PWM_POLARITY_NORMAL>,
22+
<&ledc0 10 1000000 PWM_POLARITY_INVERTED>;
1923
};
2024
};
2125

2226
&pinctrl {
2327
ledc0_default: ledc0_default {
2428
group1 {
2529
pinmux = <LEDC_CH0_GPIO2>,
26-
<LEDC_CH5_GPIO3>;
30+
<LEDC_CH5_GPIO3>,
31+
<LEDC_CH9_GPIO4>,
32+
<LEDC_CH10_GPIO5>;
2733
input-enable;
2834
};
2935
};
@@ -45,4 +51,16 @@
4551
reg = <0x5>;
4652
timer = <1>;
4753
};
54+
55+
/* HS channel */
56+
channel9@9 {
57+
reg = <0x9>;
58+
timer = <0>;
59+
};
60+
61+
/* share same timer with ch9 */
62+
channel10@a {
63+
reg = <0xa>;
64+
timer = <0>;
65+
};
4866
};

0 commit comments

Comments
 (0)