File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 2222#include <zephyr/logging/log.h>
2323LOG_MODULE_REGISTER (pwm_ledc_esp32 , CONFIG_PWM_LOG_LEVEL );
2424
25+ #if SOC_LEDC_SUPPORT_APB_CLOCK
26+ #define CLOCK_SOURCE LEDC_APB_CLK
27+ #elif SOC_LEDC_SUPPORT_PLL_DIV_CLOCK
28+ #define CLOCK_SOURCE LEDC_SCLK
29+ #if defined(CONFIG_SOC_SERIES_ESP32C2 )
30+ #define SCLK_CLK_FREQ MHZ(60)
31+ #elif defined(CONFIG_SOC_SERIES_ESP32C6 )
32+ #define SCLK_CLK_FREQ MHZ(80)
33+ #endif
34+ #endif
35+
2536struct pwm_ledc_esp32_data {
2637 ledc_hal_context_t hal ;
2738 struct k_sem cmd_sem ;
@@ -350,12 +361,6 @@ static const struct pwm_driver_api pwm_led_esp32_api = {
350361
351362PINCTRL_DT_INST_DEFINE (0 );
352363
353- #if SOC_LEDC_SUPPORT_APB_CLOCK
354- #define CLOCK_SOURCE LEDC_APB_CLK
355- #elif SOC_LEDC_SUPPORT_PLL_DIV_CLOCK
356- #define CLOCK_SOURCE LEDC_SCLK
357- #endif
358-
359364#define CHANNEL_CONFIG (node_id ) \
360365 { \
361366 .idx = DT_REG_ADDR(node_id), \
You can’t perform that action at this time.
0 commit comments