Skip to content

Commit fd9a980

Browse files
Raffael Rostagnonordic-pikr
authored andcommitted
[nrf fromtree] tests: pwm_gpio_loopback: esp32: Add test overlays
Add test overlays for ESP32 devices. Signed-off-by: Raffael Rostagno <[email protected]> (cherry picked from commit 16d7bbf)
1 parent 3af9db3 commit fd9a980

File tree

6 files changed

+288
-0
lines changed

6 files changed

+288
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h>
10+
11+
/ {
12+
zephyr,user {
13+
/* GPIO input pins order must match PWM pinctrl config */
14+
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
15+
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
16+
17+
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
18+
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
19+
};
20+
};
21+
22+
&pinctrl {
23+
ledc0_default: ledc0_default {
24+
group1 {
25+
pinmux = <LEDC_CH0_GPIO2>,
26+
<LEDC_CH5_GPIO3>;
27+
input-enable;
28+
};
29+
};
30+
};
31+
32+
&ledc0 {
33+
pinctrl-0 = <&ledc0_default>;
34+
pinctrl-names = "default";
35+
status = "okay";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
channel0@0 {
40+
reg = <0x0>;
41+
timer = <0>;
42+
};
43+
44+
channel5@5 {
45+
reg = <0x5>;
46+
timer = <1>;
47+
};
48+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h>
10+
11+
/ {
12+
zephyr,user {
13+
/* GPIO input pins order must match PWM pinctrl config */
14+
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
15+
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
16+
17+
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
18+
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
19+
};
20+
};
21+
22+
&pinctrl {
23+
ledc0_default: ledc0_default {
24+
group1 {
25+
pinmux = <LEDC_CH0_GPIO2>,
26+
<LEDC_CH5_GPIO3>;
27+
input-enable;
28+
};
29+
};
30+
};
31+
32+
&ledc0 {
33+
pinctrl-0 = <&ledc0_default>;
34+
pinctrl-names = "default";
35+
status = "okay";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
channel0@0 {
40+
reg = <0x0>;
41+
timer = <0>;
42+
};
43+
44+
channel5@5 {
45+
reg = <0x5>;
46+
timer = <1>;
47+
};
48+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h>
10+
11+
/ {
12+
zephyr,user {
13+
/* GPIO input pins order must match PWM pinctrl config */
14+
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
15+
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
16+
17+
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
18+
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
19+
};
20+
};
21+
22+
&pinctrl {
23+
ledc0_default: ledc0_default {
24+
group1 {
25+
pinmux = <LEDC_CH0_GPIO2>,
26+
<LEDC_CH5_GPIO3>;
27+
input-enable;
28+
};
29+
};
30+
};
31+
32+
&ledc0 {
33+
pinctrl-0 = <&ledc0_default>;
34+
pinctrl-names = "default";
35+
status = "okay";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
channel0@0 {
40+
reg = <0x0>;
41+
timer = <0>;
42+
};
43+
44+
channel5@5 {
45+
reg = <0x5>;
46+
timer = <1>;
47+
};
48+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h>
10+
11+
/ {
12+
zephyr,user {
13+
/* GPIO input pins order must match PWM pinctrl config */
14+
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
15+
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
16+
17+
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
18+
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
19+
};
20+
};
21+
22+
&pinctrl {
23+
ledc0_default: ledc0_default {
24+
group1 {
25+
pinmux = <LEDC_CH0_GPIO2>,
26+
<LEDC_CH5_GPIO3>;
27+
input-enable;
28+
};
29+
};
30+
};
31+
32+
&ledc0 {
33+
pinctrl-0 = <&ledc0_default>;
34+
pinctrl-names = "default";
35+
status = "okay";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
channel0@0 {
40+
reg = <0x0>;
41+
timer = <0>;
42+
};
43+
44+
channel5@5 {
45+
reg = <0x5>;
46+
timer = <1>;
47+
};
48+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h>
10+
11+
/ {
12+
zephyr,user {
13+
/* GPIO input pins order must match PWM pinctrl config */
14+
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
15+
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
16+
17+
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
18+
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
19+
};
20+
};
21+
22+
&pinctrl {
23+
ledc0_default: ledc0_default {
24+
group1 {
25+
pinmux = <LEDC_CH0_GPIO2>,
26+
<LEDC_CH5_GPIO3>;
27+
input-enable;
28+
};
29+
};
30+
};
31+
32+
&ledc0 {
33+
pinctrl-0 = <&ledc0_default>;
34+
pinctrl-names = "default";
35+
status = "okay";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
channel0@0 {
40+
reg = <0x0>;
41+
timer = <0>;
42+
};
43+
44+
channel5@5 {
45+
reg = <0x5>;
46+
timer = <1>;
47+
};
48+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h>
10+
11+
/ {
12+
zephyr,user {
13+
/* GPIO input pins order must match PWM pinctrl config */
14+
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>,
15+
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>;
16+
17+
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>,
18+
<&ledc0 5 80000 PWM_POLARITY_INVERTED>;
19+
};
20+
};
21+
22+
&pinctrl {
23+
ledc0_default: ledc0_default {
24+
group1 {
25+
pinmux = <LEDC_CH0_GPIO2>,
26+
<LEDC_CH5_GPIO3>;
27+
input-enable;
28+
};
29+
};
30+
};
31+
32+
&ledc0 {
33+
pinctrl-0 = <&ledc0_default>;
34+
pinctrl-names = "default";
35+
status = "okay";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
channel0@0 {
40+
reg = <0x0>;
41+
timer = <0>;
42+
};
43+
44+
channel5@5 {
45+
reg = <0x5>;
46+
timer = <1>;
47+
};
48+
};

0 commit comments

Comments
 (0)