Commit 16d7bbf6 authored by Raffael Rostagno's avatar Raffael Rostagno Committed by Benjamin Cabé
Browse files

tests: pwm_gpio_loopback: esp32: Add test overlays



Add test overlays for ESP32 devices.

Signed-off-by: default avatarRaffael Rostagno <raffael.rostagno@espressif.com>
parent ef96ed96
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
/*
 * 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 −0
Original line number Diff line number Diff line
/*
 * 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 −0
Original line number Diff line number Diff line
/*
 * 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 −0
Original line number Diff line number Diff line
/*
 * 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 −0
Original line number Diff line number Diff line
/*
 * 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>;
	};
};
Loading