ledc: Add support for esp32h2; Refactor ledc driver clock source selection related code

LEDC examples and test cases are supported on ESP32H2.
   Switch to use general clock IDs for ledc_clk_cfg_t enum values.
   Deprecate LEDC_USE_RTC8M_CLK.
This commit is contained in:
Song Ruo Jing
2023-01-24 01:54:34 +08:00
parent 375aaf8e7b
commit ad55230b0a
34 changed files with 1078 additions and 336 deletions

View File

@@ -11,6 +11,7 @@
#include "soc/clk_tree_defs.h"
#include "soc/rtc.h"
#include "soc/pcr_reg.h"
#include "soc/lp_clkrst_struct.h"
#include "hal/regi2c_ctrl.h"
#include "soc/regi2c_bbpll.h"
#include "hal/assert.h"
@@ -167,7 +168,7 @@ static inline bool clk_ll_rc_fast_d256_is_enabled(void)
*/
static inline void clk_ll_rc_fast_digi_enable(void)
{
// ESP32H2-TODO: IDF-6401
LP_CLKRST.clk_to_hp.icg_hp_fosc = 1;
}
/**
@@ -175,7 +176,7 @@ static inline void clk_ll_rc_fast_digi_enable(void)
*/
static inline void clk_ll_rc_fast_digi_disable(void)
{
// ESP32H2-TODO: IDF-6401
LP_CLKRST.clk_to_hp.icg_hp_fosc = 0;
}
/**