mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-11 17:17:31 +00:00
LEDC: improved support for ESP32-C3 and refactored divisor calculation
As ESP32C3 does not have support for REF_TICK source clock, it is now not possible to select it anymore. Auto cfg clock has been improved for all boards.
This commit is contained in:
@@ -22,6 +22,27 @@
|
||||
#include "soc/ledc_struct.h"
|
||||
|
||||
#define LEDC_LL_GET_HW() &LEDC
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
|
||||
#define LEDC_LL_GLOBAL_CLOCKS { \
|
||||
LEDC_USE_APB_CLK, \
|
||||
LEDC_USE_RTC8M_CLK, \
|
||||
}
|
||||
#define LEDC_LL_TIMER_SPECIFIC_CLOCKS \
|
||||
{\
|
||||
{ \
|
||||
.clk = LEDC_REF_TICK, \
|
||||
.freq = LEDC_REF_CLK_HZ, \
|
||||
} \
|
||||
}
|
||||
|
||||
/* On ESP32, APB clock is a timer-specific clock only in fast clock mode */
|
||||
#define LEDC_LL_IS_TIMER_SPECIFIC_CLOCK(SPEED, CLK) (\
|
||||
((CLK) == LEDC_USE_REF_TICK) || \
|
||||
((SPEED) == LEDC_HIGH_SPEED_MODE && (CLK) == LEDC_USE_APB_CLK) \
|
||||
)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
Reference in New Issue
Block a user