samples: led_pwm: added overlay for the esp32 board
added pwm leds in board overlay file, added configs in board conf file Signed-off-by: Andrei-Edward Popa <andrei_edward.popa@upb.ro>
This commit is contained in:
parent
02c2cae942
commit
ea82845f1b
2 changed files with 27 additions and 0 deletions
1
samples/drivers/led_pwm/boards/esp32.conf
Normal file
1
samples/drivers/led_pwm/boards/esp32.conf
Normal file
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_PWM_LED_ESP32=y
|
26
samples/drivers/led_pwm/boards/esp32.overlay
Normal file
26
samples/drivers/led_pwm/boards/esp32.overlay
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Copyright (c) 2021 Andrei-Edward Popa
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pwm/pwm.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
aliases {
|
||||||
|
pwm-0 = &ledc0;
|
||||||
|
pwm-led0 = &pwm_led_blue;
|
||||||
|
};
|
||||||
|
|
||||||
|
pwmleds {
|
||||||
|
compatible = "pwm-leds";
|
||||||
|
pwm_led_blue: pwm_led_gpio0_2 {
|
||||||
|
label = "PWM LED0";
|
||||||
|
pwms = <&ledc0 2 1000 PWM_POLARITY_NORMAL>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&ledc0 {
|
||||||
|
status = "okay";
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue