mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-18 07:37:54 +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:
@@ -26,6 +26,22 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#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_XTAL_CLK, \
|
||||
LEDC_USE_RTC8M_CLK, \
|
||||
}
|
||||
#define LEDC_LL_TIMER_SPECIFIC_CLOCKS \
|
||||
{\
|
||||
{ \
|
||||
.clk = LEDC_REF_TICK, \
|
||||
.freq = LEDC_REF_CLK_HZ, \
|
||||
} \
|
||||
}
|
||||
|
||||
#define LEDC_LL_IS_TIMER_SPECIFIC_CLOCK(SPEED, CLK) ((CLK) == LEDC_USE_REF_TICK)
|
||||
|
||||
/**
|
||||
* @brief Set LEDC low speed timer clock
|
||||
|
Reference in New Issue
Block a user