2021-10-28 22:30:25 +08:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Copyright (c) 2021 Andrei-Edward Popa
|
2022-06-14 01:22:39 +08:00
|
|
|
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
|
2021-10-28 22:30:25 +08:00
|
|
|
*/
|
|
|
|
|
2022-05-09 17:06:18 +08:00
|
|
|
#include <zephyr/dt-bindings/pwm/pwm.h>
|
2022-06-14 01:22:39 +08:00
|
|
|
#include <dt-bindings/pinctrl/esp32-pinctrl.h>
|
2021-10-28 22:30:25 +08:00
|
|
|
|
|
|
|
/ {
|
|
|
|
aliases {
|
|
|
|
pwm-0 = &ledc0;
|
|
|
|
pwm-led0 = &pwm_led_blue;
|
|
|
|
};
|
|
|
|
|
|
|
|
pwmleds {
|
|
|
|
compatible = "pwm-leds";
|
|
|
|
pwm_led_blue: pwm_led_gpio0_2 {
|
2022-06-14 01:22:39 +08:00
|
|
|
label = "PWM LED0";
|
|
|
|
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
|
2021-10-28 22:30:25 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-06-14 01:22:39 +08:00
|
|
|
&pinctrl {
|
|
|
|
ledc0_ch0_gpio2: ledc0_ch0_gpio2 {
|
|
|
|
pinmux = <LEDC_CH0_GPIO2>;
|
|
|
|
output-enable;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-10-28 22:30:25 +08:00
|
|
|
&ledc0 {
|
2022-06-14 01:22:39 +08:00
|
|
|
pinctrl-0 = <&ledc0_ch0_gpio2>;
|
|
|
|
pinctrl-names = "default";
|
2021-10-28 22:30:25 +08:00
|
|
|
status = "okay";
|
2022-06-14 01:22:39 +08:00
|
|
|
#address-cells = <1>;
|
|
|
|
#size-cells = <0>;
|
|
|
|
channel0@0 {
|
|
|
|
reg = <0x0>;
|
|
|
|
timer = <0>;
|
|
|
|
};
|
2021-10-28 22:30:25 +08:00
|
|
|
};
|