refactor(ledc): refactored some LEDC LL functions

This commit is contained in:
Song Ruo Jing
2026-04-01 21:34:52 +08:00
parent 32d31d72a3
commit 88b62b19fd
41 changed files with 890 additions and 846 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -7,6 +7,11 @@
#pragma once
#include "soc/soc_caps.h"
#include "soc/interrupts.h"
#if SOC_LEDC_SUPPORTED
#include "hal/ledc_ll.h"
#include "hal/ledc_types.h"
#endif
#if SOC_PAU_SUPPORTED
#include "soc/regdma.h"
#include "soc/retention_periph_defs.h"
@@ -16,18 +21,18 @@
extern "C" {
#endif
#if SOC_LEDC_SUPPORTED
/*
Stores a bunch of per-ledc-peripheral data.
*/
typedef struct {
const int sig_out0_idx;
const int irq_id;
struct {
const int sig_out0_idx;
} speed_mode[LEDC_SPEED_MODE_MAX];
} ledc_signal_conn_t;
#if SOC_LEDC_SUPPORT_HS_MODE
extern const ledc_signal_conn_t ledc_periph_signal[2];
#else
extern const ledc_signal_conn_t ledc_periph_signal[1];
#endif
extern const ledc_signal_conn_t ledc_periph_signal[LEDC_LL_GET(GROUP_NUM)];
#if SOC_PAU_SUPPORTED && SOC_LEDC_SUPPORT_SLEEP_RETENTION
@@ -53,8 +58,10 @@ typedef struct {
const periph_retention_module_t module_id;
} ledc_reg_retention_info_t;
extern const ledc_reg_retention_info_t ledc_reg_retention_info;
#endif
extern const ledc_reg_retention_info_t ledc_reg_retention_info[LEDC_LL_GET(GROUP_NUM)];
#endif // SOC_PAU_SUPPORTED && SOC_LEDC_SUPPORT_SLEEP_RETENTION
#endif // SOC_LEDC_SUPPORTED
#ifdef __cplusplus
}