-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: pwm_gpio_loopback: esp32: Add test overlays
Add test overlays for ESP32 devices. Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
- Loading branch information
Showing
6 changed files
with
288 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
tests/drivers/pwm/pwm_gpio_loopback/socs/esp32_procpu.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/pwm/pwm.h> | ||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h> | ||
|
||
/ { | ||
zephyr,user { | ||
/* GPIO input pins order must match PWM pinctrl config */ | ||
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>, | ||
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>; | ||
|
||
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>, | ||
<&ledc0 5 80000 PWM_POLARITY_INVERTED>; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
ledc0_default: ledc0_default { | ||
group1 { | ||
pinmux = <LEDC_CH0_GPIO2>, | ||
<LEDC_CH5_GPIO3>; | ||
input-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&ledc0 { | ||
pinctrl-0 = <&ledc0_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
channel0@0 { | ||
reg = <0x0>; | ||
timer = <0>; | ||
}; | ||
|
||
channel5@5 { | ||
reg = <0x5>; | ||
timer = <1>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/pwm/pwm.h> | ||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h> | ||
|
||
/ { | ||
zephyr,user { | ||
/* GPIO input pins order must match PWM pinctrl config */ | ||
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>, | ||
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>; | ||
|
||
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>, | ||
<&ledc0 5 80000 PWM_POLARITY_INVERTED>; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
ledc0_default: ledc0_default { | ||
group1 { | ||
pinmux = <LEDC_CH0_GPIO2>, | ||
<LEDC_CH5_GPIO3>; | ||
input-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&ledc0 { | ||
pinctrl-0 = <&ledc0_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
channel0@0 { | ||
reg = <0x0>; | ||
timer = <0>; | ||
}; | ||
|
||
channel5@5 { | ||
reg = <0x5>; | ||
timer = <1>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/pwm/pwm.h> | ||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h> | ||
|
||
/ { | ||
zephyr,user { | ||
/* GPIO input pins order must match PWM pinctrl config */ | ||
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>, | ||
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>; | ||
|
||
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>, | ||
<&ledc0 5 80000 PWM_POLARITY_INVERTED>; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
ledc0_default: ledc0_default { | ||
group1 { | ||
pinmux = <LEDC_CH0_GPIO2>, | ||
<LEDC_CH5_GPIO3>; | ||
input-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&ledc0 { | ||
pinctrl-0 = <&ledc0_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
channel0@0 { | ||
reg = <0x0>; | ||
timer = <0>; | ||
}; | ||
|
||
channel5@5 { | ||
reg = <0x5>; | ||
timer = <1>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/pwm/pwm.h> | ||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h> | ||
|
||
/ { | ||
zephyr,user { | ||
/* GPIO input pins order must match PWM pinctrl config */ | ||
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>, | ||
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>; | ||
|
||
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>, | ||
<&ledc0 5 80000 PWM_POLARITY_INVERTED>; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
ledc0_default: ledc0_default { | ||
group1 { | ||
pinmux = <LEDC_CH0_GPIO2>, | ||
<LEDC_CH5_GPIO3>; | ||
input-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&ledc0 { | ||
pinctrl-0 = <&ledc0_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
channel0@0 { | ||
reg = <0x0>; | ||
timer = <0>; | ||
}; | ||
|
||
channel5@5 { | ||
reg = <0x5>; | ||
timer = <1>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/pwm/pwm.h> | ||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h> | ||
|
||
/ { | ||
zephyr,user { | ||
/* GPIO input pins order must match PWM pinctrl config */ | ||
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>, | ||
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>; | ||
|
||
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>, | ||
<&ledc0 5 80000 PWM_POLARITY_INVERTED>; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
ledc0_default: ledc0_default { | ||
group1 { | ||
pinmux = <LEDC_CH0_GPIO2>, | ||
<LEDC_CH5_GPIO3>; | ||
input-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&ledc0 { | ||
pinctrl-0 = <&ledc0_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
channel0@0 { | ||
reg = <0x0>; | ||
timer = <0>; | ||
}; | ||
|
||
channel5@5 { | ||
reg = <0x5>; | ||
timer = <1>; | ||
}; | ||
}; |
48 changes: 48 additions & 0 deletions
48
tests/drivers/pwm/pwm_gpio_loopback/socs/esp32s3_procpu.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/pwm/pwm.h> | ||
#include <zephyr/dt-bindings/gpio/gpio.h> | ||
#include <zephyr/dt-bindings/gpio/espressif-esp32-gpio.h> | ||
|
||
/ { | ||
zephyr,user { | ||
/* GPIO input pins order must match PWM pinctrl config */ | ||
gpios = <&gpio0 2 ESP32_GPIO_PIN_OUT_EN>, | ||
<&gpio0 3 ESP32_GPIO_PIN_OUT_EN>; | ||
|
||
pwms = <&ledc0 0 160000 PWM_POLARITY_NORMAL>, | ||
<&ledc0 5 80000 PWM_POLARITY_INVERTED>; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
ledc0_default: ledc0_default { | ||
group1 { | ||
pinmux = <LEDC_CH0_GPIO2>, | ||
<LEDC_CH5_GPIO3>; | ||
input-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&ledc0 { | ||
pinctrl-0 = <&ledc0_default>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
channel0@0 { | ||
reg = <0x0>; | ||
timer = <0>; | ||
}; | ||
|
||
channel5@5 { | ||
reg = <0x5>; | ||
timer = <1>; | ||
}; | ||
}; |