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 22
22
#include <zephyr/logging/log.h>
23
23
LOG_MODULE_REGISTER (pwm_ledc_esp32 , CONFIG_PWM_LOG_LEVEL );
24
24
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
+
25
36
struct pwm_ledc_esp32_data {
26
37
ledc_hal_context_t hal ;
27
38
struct k_sem cmd_sem ;
@@ -350,12 +361,6 @@ static const struct pwm_driver_api pwm_led_esp32_api = {
350
361
351
362
PINCTRL_DT_INST_DEFINE (0 );
352
363
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
-
359
364
#define CHANNEL_CONFIG (node_id ) \
360
365
{ \
361
366
.idx = DT_REG_ADDR(node_id), \
You can’t perform that action at this time.
0 commit comments