feat(soc): introduce the soc_caps_full.h for internal use only

This commit is contained in:
morris
2024-12-04 13:40:30 +08:00
parent 296bc7ddcc
commit 0296c30908
45 changed files with 467 additions and 451 deletions

View File

@@ -1,14 +1,22 @@
## `soc` ## # The SoC component
The `soc` component provides hardware description for targets supported by ESP-IDF. The `soc` component provides register-level descriptions for targets supported by ESP-IDF.
- `xxx_reg.h` - defines registers related to the hardware | File | Description |
- `xxx_struct.h` - hardware description in C `struct` |---------------------|-----------------------------------------------------------------------------------------------|
- `xxx_channel.h` - definitions for hardware with multiple channels | `xxx_reg.h`/`xx_struct.h` | Defines registers layout of a specific module. These files are automated, and should not be updated manually. <br/> Please note the register names and layout are subject to change between different chip series. |
- `xxx_caps.h` - features/capabilities of the hardware | `xxx_pins.h` | Defines the unchangeable GPIOs used by a specific module. <br/> e.g. if a high speed signal is routed through IO MUX, its corresponding GPIO is not selectable. |
- `xxx_pins.h` - pin definitions | `soc_caps.h` | Describes the differences in capabilities between different chips. <br/> The macros here can also affect cmake build system, Kconfig system, docs system, pytest and CI environment. <br/> **Changes to this file requires extra caution as they are part of the public API.** |
- `xxx_periph.h/*.c` - includes all headers related to a peripheral; declaration and definition of IO mapping for that hardware | `xxx_periph.h` | This is the portal for each peripheral module at the SoC layer, <br/> containing all relevant register header files and organizing other key information, such as interrupt sources, hardware signal IDs, etc. |
| `xxx.peripherals.ld` | This is the linker script that defines each module's memory address. |
Specially, the `xxx_reg.h` and `xxx_struct.h` headers that generated by script are under `register/soc` folder. Please DO NOT **add** other manual coded files under this folder. ## The SoC Capabilities
For other soc headers that are used as wrapper, definition, signaling, mapping or manual coded registers, please add them under `include/soc` folder. There are two documents describing SoC capabilities, `soc_caps.h` and `soc_caps_full.h`. The former is a public header file, and the information in it is coarse-grained. The latter is a header file for internal developers that contains fine-grained module information. To used the soc capability macros, you should use the macro functions offered by `soc/soc_caps_eval.h`.
| Macro function | Description | Example |
|----------------|-------------|---------|
| `SOC_IS` | Checks if the current SoC is a specific one. | `SOC_IS(ESP32)` |
| `SOC_HAS` | Checks if the current SoC has a specific module. | `SOC_HAS(DAC)` |
| `SOC_MODULE_ATTR` | Get the attribute of a specific module. | `SOC_MODULE_ATTR(GPTIMER, TIMERS_TOTAL)` |
| `SOC_MODULE_SUPPORT` | Checks if the current SoC supports a specific feature. | `SOC_MODULE_SUPPORT(GPTIMER, ETM)` |

View File

@@ -191,10 +191,6 @@ config SOC_XTAL_SUPPORT_40M
bool bool
default y default y
config SOC_XTAL_SUPPORT_AUTO_DETECT
bool
default y
config SOC_ADC_RTC_CTRL_SUPPORTED config SOC_ADC_RTC_CTRL_SUPPORTED
bool bool
default y default y
@@ -249,11 +245,11 @@ config SOC_ADC_DIGI_MONITOR_NUM
config SOC_ADC_SAMPLE_FREQ_THRES_HIGH config SOC_ADC_SAMPLE_FREQ_THRES_HIGH
int int
default 2 default 2000000
config SOC_ADC_SAMPLE_FREQ_THRES_LOW config SOC_ADC_SAMPLE_FREQ_THRES_LOW
int int
default 20 default 20000
config SOC_ADC_RTC_MIN_BITWIDTH config SOC_ADC_RTC_MIN_BITWIDTH
int int
@@ -439,10 +435,6 @@ config SOC_I2S_SUPPORTS_ADC
bool bool
default y default y
config SOC_I2S_SUPPORTS_DAC
bool
default y
config SOC_I2S_SUPPORTS_LCD_CAMERA config SOC_I2S_SUPPORTS_LCD_CAMERA
bool bool
default y default y
@@ -691,26 +683,6 @@ config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED
bool bool
default y default y
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 2
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 64
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 4
config SOC_TIMER_GROUP_SUPPORT_APB
bool
default y
config SOC_LP_TIMER_BIT_WIDTH_LO config SOC_LP_TIMER_BIT_WIDTH_LO
int int
default 32 default 32

View File

@@ -37,6 +37,10 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#ifdef __has_include #ifdef __has_include
# if __has_include("sdkconfig.h") # if __has_include("sdkconfig.h")
# include "sdkconfig.h" # include "sdkconfig.h"
@@ -55,10 +59,11 @@
// Define warning strings here for ECO-ed features to show error when they are used without being // Define warning strings here for ECO-ed features to show error when they are used without being
// defined correctly // defined correctly
#define SOC_BROWNOUT_RESET_SUPPORTED "Not determined" // [gen_soc_caps:ignore] #define SOC_BROWNOUT_RESET_SUPPORTED "Not determined" // [gen_soc_caps:ignore]
#define SOC_TWAI_BRP_DIV_SUPPORTED "Not determined" // [gen_soc_caps:ignore]
#define SOC_DPORT_WORKAROUND "Not determined" // [gen_soc_caps:ignore] #define SOC_DPORT_WORKAROUND "Not determined" // [gen_soc_caps:ignore]
#endif #endif
#define _SOC_CAPS_TARGET_IS_ESP32 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_CAPS_ECO_VER_MAX 301 #define SOC_CAPS_ECO_VER_MAX 301
@@ -114,7 +119,6 @@
/*-------------------------- XTAL CAPS ---------------------------------------*/ /*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_26M 1 #define SOC_XTAL_SUPPORT_26M 1
#define SOC_XTAL_SUPPORT_40M 1 #define SOC_XTAL_SUPPORT_40M 1
#define SOC_XTAL_SUPPORT_AUTO_DETECT 1 // Measure XTAL freq with an internal RC clock
/*-------------------------- ADC CAPS ----------------------------------------*/ /*-------------------------- ADC CAPS ----------------------------------------*/
/*!< SAR ADC Module*/ /*!< SAR ADC Module*/
@@ -135,8 +139,8 @@
#define SOC_ADC_DIGI_RESULT_BYTES (2) #define SOC_ADC_DIGI_RESULT_BYTES (2)
#define SOC_ADC_DIGI_DATA_BYTES_PER_CONV (4) #define SOC_ADC_DIGI_DATA_BYTES_PER_CONV (4)
#define SOC_ADC_DIGI_MONITOR_NUM (0U) // to reference `IDF_TARGET_SOC_ADC_DIGI_MONITOR_NUM` in document #define SOC_ADC_DIGI_MONITOR_NUM (0U) // to reference `IDF_TARGET_SOC_ADC_DIGI_MONITOR_NUM` in document
#define SOC_ADC_SAMPLE_FREQ_THRES_HIGH (2*1000*1000) #define SOC_ADC_SAMPLE_FREQ_THRES_HIGH (2000000)
#define SOC_ADC_SAMPLE_FREQ_THRES_LOW (20*1000) #define SOC_ADC_SAMPLE_FREQ_THRES_LOW (20000)
/*!< RTC */ /*!< RTC */
#define SOC_ADC_RTC_MIN_BITWIDTH (9) #define SOC_ADC_RTC_MIN_BITWIDTH (9)
@@ -226,7 +230,6 @@
#define SOC_I2S_PDM_MAX_RX_LINES (1U) #define SOC_I2S_PDM_MAX_RX_LINES (1U)
#define SOC_I2S_SUPPORTS_ADC_DAC (1) #define SOC_I2S_SUPPORTS_ADC_DAC (1)
#define SOC_I2S_SUPPORTS_ADC (1) #define SOC_I2S_SUPPORTS_ADC (1)
#define SOC_I2S_SUPPORTS_DAC (1)
#define SOC_I2S_SUPPORTS_LCD_CAMERA (1) #define SOC_I2S_SUPPORTS_LCD_CAMERA (1)
#define SOC_I2S_MAX_DATA_WIDTH (24) #define SOC_I2S_MAX_DATA_WIDTH (24)
@@ -322,13 +325,6 @@
// Peripheral supports DIO, DOUT, QIO, or QOUT // Peripheral supports DIO, DOUT, QIO, or QOUT
#define SOC_SPI_PERIPH_SUPPORT_MULTILINE_MODE(spi_host) ({(void)spi_host; 1;}) #define SOC_SPI_PERIPH_SUPPORT_MULTILINE_MODE(spi_host) ({(void)spi_host; 1;})
/*-------------------------- TIMER GROUP CAPS --------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (2)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (64)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (4)
#define SOC_TIMER_GROUP_SUPPORT_APB (1)
/*-------------------------- LP_TIMER CAPS ----------------------------------*/ /*-------------------------- LP_TIMER CAPS ----------------------------------*/
#define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part
@@ -347,7 +343,6 @@
#define SOC_TWAI_BRP_MIN 2 #define SOC_TWAI_BRP_MIN 2
#if SOC_CAPS_ECO_VER >= 200 #if SOC_CAPS_ECO_VER >= 200
# define SOC_TWAI_BRP_MAX 256 # define SOC_TWAI_BRP_MAX 256
# define SOC_TWAI_BRP_DIV_SUPPORTED 1
#else #else
# define SOC_TWAI_BRP_MAX 128 # define SOC_TWAI_BRP_MAX 128
#endif #endif

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 64 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 2 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -603,26 +603,6 @@ config SOC_SYSTIMER_ALARM_MISS_COMPENSATE
bool bool
default y default y
config SOC_TIMER_GROUPS
int
default 1
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 1
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 1
config SOC_LP_TIMER_BIT_WIDTH_LO config SOC_LP_TIMER_BIT_WIDTH_LO
int int
default 32 default 32

View File

@@ -16,6 +16,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32C2 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_ADC_SUPPORTED 1 #define SOC_ADC_SUPPORTED 1
#define SOC_DEDICATED_GPIO_SUPPORTED 1 #define SOC_DEDICATED_GPIO_SUPPORTED 1
@@ -268,13 +274,6 @@
#define SOC_SYSTIMER_INT_LEVEL 1 // Systimer peripheral uses level interrupt #define SOC_SYSTIMER_INT_LEVEL 1 // Systimer peripheral uses level interrupt
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE 1 // Systimer peripheral can generate interrupt immediately if t(target) > t(current) #define SOC_SYSTIMER_ALARM_MISS_COMPENSATE 1 // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS (1U)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (1U)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (1U)
/*-------------------------- LP_TIMER CAPS ----------------------------------*/ /*-------------------------- LP_TIMER CAPS ----------------------------------*/
#define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 1 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 1 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -863,30 +863,6 @@ config SOC_SYSTIMER_ALARM_MISS_COMPENSATE
bool bool
default y default y
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 1
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_APB
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 2
config SOC_LP_TIMER_BIT_WIDTH_LO config SOC_LP_TIMER_BIT_WIDTH_LO
int int
default 32 default 32

View File

@@ -16,6 +16,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32C3 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_ADC_SUPPORTED 1 #define SOC_ADC_SUPPORTED 1
#define SOC_DEDICATED_GPIO_SUPPORTED 1 #define SOC_DEDICATED_GPIO_SUPPORTED 1
@@ -363,14 +369,6 @@
#define SOC_SYSTIMER_INT_LEVEL 1 // Systimer peripheral uses level interrupt #define SOC_SYSTIMER_INT_LEVEL 1 // Systimer peripheral uses level interrupt
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE 1 // Systimer peripheral can generate interrupt immediately if t(target) > t(current) #define SOC_SYSTIMER_ALARM_MISS_COMPENSATE 1 // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (1U)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_APB (1)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (2)
/*-------------------------- LP_TIMER CAPS ----------------------------------*/ /*-------------------------- LP_TIMER CAPS ----------------------------------*/
#define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 1 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -1303,30 +1303,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI
int int
default 16 default 16
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 1
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_RC_FAST
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 2
config SOC_TIMER_SUPPORT_ETM config SOC_TIMER_SUPPORT_ETM
bool bool
default y default y

View File

@@ -16,6 +16,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32C5 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_ADC_SUPPORTED 1 #define SOC_ADC_SUPPORTED 1
#define SOC_ANA_CMPR_SUPPORTED 1 #define SOC_ANA_CMPR_SUPPORTED 1
@@ -505,12 +511,6 @@
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (1U)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_RC_FAST (1)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (2)
#define SOC_TIMER_SUPPORT_ETM (1) #define SOC_TIMER_SUPPORT_ETM (1)
#define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1) #define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1)

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 1 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -1163,30 +1163,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI
int int
default 16 default 16
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 1
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_RC_FAST
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 2
config SOC_TIMER_SUPPORT_ETM config SOC_TIMER_SUPPORT_ETM
bool bool
default y default y

View File

@@ -16,6 +16,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32C6 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_ADC_SUPPORTED 1 #define SOC_ADC_SUPPORTED 1
#define SOC_DEDICATED_GPIO_SUPPORTED 1 #define SOC_DEDICATED_GPIO_SUPPORTED 1
@@ -454,12 +460,6 @@
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (1U)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_RC_FAST (1)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (2)
#define SOC_TIMER_SUPPORT_ETM (1) #define SOC_TIMER_SUPPORT_ETM (1)
#define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1) #define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1)

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 1 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -891,30 +891,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI
int int
default 16 default 16
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 1
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 2
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_RC_FAST
bool
default y
config SOC_TIMER_SUPPORT_SLEEP_RETENTION config SOC_TIMER_SUPPORT_SLEEP_RETENTION
bool bool
default y default y

View File

@@ -16,6 +16,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32C61 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_ADC_SUPPORTED 1 #define SOC_ADC_SUPPORTED 1
#define SOC_ANA_CMPR_SUPPORTED 1 #define SOC_ANA_CMPR_SUPPORTED 1
@@ -369,12 +375,6 @@
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (1U)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (2)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_RC_FAST (1)
#define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1) #define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1)
#define SOC_TIMER_SUPPORT_ETM (1) #define SOC_TIMER_SUPPORT_ETM (1)

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 1 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -1179,30 +1179,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI
int int
default 16 default 16
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 1
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_RC_FAST
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 2
config SOC_TIMER_SUPPORT_ETM config SOC_TIMER_SUPPORT_ETM
bool bool
default y default y

View File

@@ -16,6 +16,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32H2 1 // [gen_soc_caps:ignore]
#ifdef __has_include #ifdef __has_include
# if __has_include("sdkconfig.h") # if __has_include("sdkconfig.h")
# include "sdkconfig.h" # include "sdkconfig.h"
@@ -472,12 +478,6 @@
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (1U)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_RC_FAST (1)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (2)
#define SOC_TIMER_SUPPORT_ETM (1) #define SOC_TIMER_SUPPORT_ETM (1)
#define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1) #define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1)

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 1 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -639,30 +639,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI
int int
default 16 default 16
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 1
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 2
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_RC_FAST
bool
default y
config SOC_TIMER_SUPPORT_SLEEP_RETENTION config SOC_TIMER_SUPPORT_SLEEP_RETENTION
bool bool
default y default y

View File

@@ -16,6 +16,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32H21 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
// #define SOC_ADC_SUPPORTED 1 //TODO: [ESP32H21] IDF-11589, IDF-11592 // #define SOC_ADC_SUPPORTED 1 //TODO: [ESP32H21] IDF-11589, IDF-11592
// #define SOC_ANA_CMPR_SUPPORTED 1 // #define SOC_ANA_CMPR_SUPPORTED 1
@@ -436,12 +442,6 @@
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (1U)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (2)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_RC_FAST (1)
// #define SOC_TIMER_SUPPORT_ETM (1) //TODO: [ESP32H21] IDF-11576 // #define SOC_TIMER_SUPPORT_ETM (1) //TODO: [ESP32H21] IDF-11576
#define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1) #define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1)

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 1 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -399,30 +399,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI
int int
default 16 default 16
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 1
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_RC_FAST
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 2
config SOC_TIMER_SUPPORT_SLEEP_RETENTION config SOC_TIMER_SUPPORT_SLEEP_RETENTION
bool bool
default y default y

View File

@@ -24,6 +24,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32H4 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
// #define SOC_ADC_SUPPORTED 1 // TODO: [ESP32H4] IDF-12368 IDF-12370 // #define SOC_ADC_SUPPORTED 1 // TODO: [ESP32H4] IDF-12368 IDF-12370
// #define SOC_ANA_CMPR_SUPPORTED 1 // TODO: [ESP32H4] IDF-12395 big change!! // #define SOC_ANA_CMPR_SUPPORTED 1 // TODO: [ESP32H4] IDF-12395 big change!!
@@ -428,12 +434,6 @@
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (1U)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_RC_FAST (1)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (2)
// #define SOC_TIMER_SUPPORT_ETM (1) // TODO: [ESP32H4] IDF-12355 // #define SOC_TIMER_SUPPORT_ETM (1) // TODO: [ESP32H4] IDF-12355
#define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1) #define SOC_TIMER_SUPPORT_SLEEP_RETENTION (1)

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 1 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -1563,10 +1563,6 @@ config SOC_SPI_SUPPORT_CLK_RC_FAST
bool bool
default y default y
config SOC_SPI_SUPPORT_CLK_SPLL
bool
default y
config SOC_MSPI_HAS_INDEPENT_IOMUX config SOC_MSPI_HAS_INDEPENT_IOMUX
bool bool
default y default y
@@ -1579,10 +1575,6 @@ config SOC_SPI_MAX_PRE_DIVIDER
int int
default 16 default 16
config SOC_LP_SPI_PERIPH_NUM
bool
default y
config SOC_LP_SPI_MAXIMUM_BUFFER_SIZE config SOC_LP_SPI_MAXIMUM_BUFFER_SIZE
int int
default 64 default 64
@@ -1651,10 +1643,6 @@ config SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED
bool bool
default y default y
config SOC_MEMSPI_FLASH_PSRAM_INDEPENDENT
bool
default y
config SOC_SYSTIMER_COUNTER_NUM config SOC_SYSTIMER_COUNTER_NUM
int int
default 2 default 2
@@ -1699,30 +1687,6 @@ config SOC_LP_TIMER_BIT_WIDTH_HI
int int
default 16 default 16
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 2
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_RC_FAST
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 4
config SOC_TIMER_SUPPORT_ETM config SOC_TIMER_SUPPORT_ETM
bool bool
default y default y
@@ -2075,10 +2039,6 @@ config SOC_PM_RETENTION_MODULE_NUM
int int
default 64 default 64
config SOC_PSRAM_VDD_POWER_MPLL
bool
default y
config SOC_CLK_RC_FAST_SUPPORT_CALIBRATION config SOC_CLK_RC_FAST_SUPPORT_CALIBRATION
bool bool
default y default y
@@ -2115,10 +2075,6 @@ config SOC_PERIPH_CLK_CTRL_SHARED
bool bool
default y default y
config SOC_TEMPERATURE_SENSOR_LP_PLL_SUPPORT
bool
default y
config SOC_TEMPERATURE_SENSOR_INTR_SUPPORT config SOC_TEMPERATURE_SENSOR_INTR_SUPPORT
bool bool
default y default y
@@ -2183,14 +2139,6 @@ config SOC_I3C_MASTER_PERIPH_NUM
bool bool
default y default y
config SOC_I3C_MASTER_ADDRESS_TABLE_NUM
int
default 12
config SOC_I3C_MASTER_COMMAND_TABLE_NUM
int
default 12
config SOC_LP_CORE_SUPPORT_ETM config SOC_LP_CORE_SUPPORT_ETM
bool bool
default y default y
@@ -2199,10 +2147,6 @@ config SOC_LP_CORE_SUPPORT_LP_ADC
bool bool
default y default y
config SOC_LP_CORE_SUPPORT_LP_VAD
bool
default y
config SOC_LP_CORE_SUPPORT_STORE_LOAD_EXCEPTIONS config SOC_LP_CORE_SUPPORT_STORE_LOAD_EXCEPTIONS
bool bool
default y default y

View File

@@ -16,6 +16,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32P4 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_ADC_SUPPORTED 1 #define SOC_ADC_SUPPORTED 1
#define SOC_ANA_CMPR_SUPPORTED 1 #define SOC_ANA_CMPR_SUPPORTED 1
@@ -227,7 +233,6 @@
#define SOC_DMA2D_GROUPS (1U) // Number of 2D-DMA groups #define SOC_DMA2D_GROUPS (1U) // Number of 2D-DMA groups
#define SOC_DMA2D_TX_CHANNELS_PER_GROUP (3) // Number of 2D-DMA TX (OUT) channels in each group #define SOC_DMA2D_TX_CHANNELS_PER_GROUP (3) // Number of 2D-DMA TX (OUT) channels in each group
#define SOC_DMA2D_RX_CHANNELS_PER_GROUP (2) // Number of 2D-DMA RX (IN) channels in each group #define SOC_DMA2D_RX_CHANNELS_PER_GROUP (2) // Number of 2D-DMA RX (IN) channels in each group
// #define SOC_DMA2D_SUPPORT_ETM (1) // Support ETM submodule
/*-------------------------- ETM CAPS --------------------------------------*/ /*-------------------------- ETM CAPS --------------------------------------*/
#define SOC_ETM_GROUPS 1U // Number of ETM groups #define SOC_ETM_GROUPS 1U // Number of ETM groups
@@ -571,7 +576,6 @@
#define SOC_SPI_SUPPORT_OCT 1 #define SOC_SPI_SUPPORT_OCT 1
#define SOC_SPI_SUPPORT_CLK_XTAL 1 #define SOC_SPI_SUPPORT_CLK_XTAL 1
#define SOC_SPI_SUPPORT_CLK_RC_FAST 1 #define SOC_SPI_SUPPORT_CLK_RC_FAST 1
#define SOC_SPI_SUPPORT_CLK_SPLL 1
// Peripheral supports DIO, DOUT, QIO, or QOUT // Peripheral supports DIO, DOUT, QIO, or QOUT
// host_id = 0 -> SPI0/SPI1, host_id = 1 -> SPI2, // host_id = 0 -> SPI0/SPI1, host_id = 1 -> SPI2,
@@ -582,8 +586,8 @@
#define SOC_SPI_MAX_PRE_DIVIDER 16 #define SOC_SPI_MAX_PRE_DIVIDER 16
/*-------------------------- LP SPI CAPS ----------------------------------------*/ /*-------------------------- LP SPI CAPS ----------------------------------------*/
#define SOC_LP_SPI_PERIPH_NUM 1
#define SOC_LP_SPI_MAXIMUM_BUFFER_SIZE 64 #define SOC_LP_SPI_MAXIMUM_BUFFER_SIZE 64
/*-------------------------- SPIRAM CAPS ----------------------------------------*/ /*-------------------------- SPIRAM CAPS ----------------------------------------*/
#define SOC_SPIRAM_XIP_SUPPORTED 1 #define SOC_SPIRAM_XIP_SUPPORTED 1
@@ -607,8 +611,6 @@
#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 #define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1
#define SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED 1 #define SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED 1
#define SOC_MEMSPI_FLASH_PSRAM_INDEPENDENT 1
/*-------------------------- SYSTIMER CAPS ----------------------------------*/ /*-------------------------- SYSTIMER CAPS ----------------------------------*/
#define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units #define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units
#define SOC_SYSTIMER_ALARM_NUM 3 // Number of alarm units #define SOC_SYSTIMER_ALARM_NUM 3 // Number of alarm units
@@ -625,12 +627,6 @@
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part
/*--------------------------- TIMER GROUP CAPS ---------------------------------------*/ /*--------------------------- TIMER GROUP CAPS ---------------------------------------*/
#define SOC_TIMER_GROUPS 2
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP 2
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH 54
#define SOC_TIMER_GROUP_SUPPORT_XTAL 1
#define SOC_TIMER_GROUP_SUPPORT_RC_FAST 1
#define SOC_TIMER_GROUP_TOTAL_TIMERS 4
#define SOC_TIMER_SUPPORT_ETM 1 #define SOC_TIMER_SUPPORT_ETM 1
#define SOC_TIMER_SUPPORT_SLEEP_RETENTION 1 #define SOC_TIMER_SUPPORT_SLEEP_RETENTION 1
@@ -764,9 +760,6 @@
#define SOC_PM_RETENTION_MODULE_NUM (64) #define SOC_PM_RETENTION_MODULE_NUM (64)
/*-------------------------- PSRAM CAPS ----------------------------*/
#define SOC_PSRAM_VDD_POWER_MPLL (1)
/*-------------------------- CLOCK SUBSYSTEM CAPS ----------------------------------------*/ /*-------------------------- CLOCK SUBSYSTEM CAPS ----------------------------------------*/
#define SOC_CLK_RC_FAST_SUPPORT_CALIBRATION (1) #define SOC_CLK_RC_FAST_SUPPORT_CALIBRATION (1)
@@ -782,7 +775,6 @@
#define SOC_PERIPH_CLK_CTRL_SHARED (1) /*!< Peripheral clock control (e.g. set clock source) is shared between various peripherals */ #define SOC_PERIPH_CLK_CTRL_SHARED (1) /*!< Peripheral clock control (e.g. set clock source) is shared between various peripherals */
/*-------------------------- Temperature Sensor CAPS -------------------------------------*/ /*-------------------------- Temperature Sensor CAPS -------------------------------------*/
#define SOC_TEMPERATURE_SENSOR_LP_PLL_SUPPORT (1)
#define SOC_TEMPERATURE_SENSOR_INTR_SUPPORT (1) #define SOC_TEMPERATURE_SENSOR_INTR_SUPPORT (1)
#define SOC_TSENS_IS_INDEPENDENT_FROM_ADC (1) /*!< Temperature sensor is a separate module, not share regs with ADC */ #define SOC_TSENS_IS_INDEPENDENT_FROM_ADC (1) /*!< Temperature sensor is a separate module, not share regs with ADC */
#define SOC_TEMPERATURE_SENSOR_SUPPORT_ETM (1) #define SOC_TEMPERATURE_SENSOR_SUPPORT_ETM (1)
@@ -809,11 +801,8 @@
/*--------------------------- I3C ---------------------------------*/ /*--------------------------- I3C ---------------------------------*/
#define SOC_I3C_MASTER_PERIPH_NUM (1) #define SOC_I3C_MASTER_PERIPH_NUM (1)
#define SOC_I3C_MASTER_ADDRESS_TABLE_NUM (12)
#define SOC_I3C_MASTER_COMMAND_TABLE_NUM (12)
/*------------------------------------- ULP CAPS -------------------------------------*/ /*------------------------------------- ULP CAPS -------------------------------------*/
#define SOC_LP_CORE_SUPPORT_ETM (1) /*!< LP Core supports ETM */ #define SOC_LP_CORE_SUPPORT_ETM (1) /*!< LP Core supports ETM */
#define SOC_LP_CORE_SUPPORT_LP_ADC (1) /*!< LP ADC can be accessed from the LP-Core */ #define SOC_LP_CORE_SUPPORT_LP_ADC (1) /*!< LP ADC can be accessed from the LP-Core */
#define SOC_LP_CORE_SUPPORT_LP_VAD (1) /*!< LP VAD can be accessed from the LP-Core */
#define SOC_LP_CORE_SUPPORT_STORE_LOAD_EXCEPTIONS (1) /*!< LP Core will raise exceptions if accessing invalid addresses */ #define SOC_LP_CORE_SUPPORT_STORE_LOAD_EXCEPTIONS (1) /*!< LP Core will raise exceptions if accessing invalid addresses */

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 2 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -791,30 +791,6 @@ config SOC_SYSTIMER_BIT_WIDTH_HI
int int
default 32 default 32
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 2
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 64
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_APB
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 4
config SOC_LP_TIMER_BIT_WIDTH_LO config SOC_LP_TIMER_BIT_WIDTH_LO
int int
default 32 default 32

View File

@@ -36,6 +36,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32S2 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_ADC_SUPPORTED 1 #define SOC_ADC_SUPPORTED 1
#define SOC_DAC_SUPPORTED 1 #define SOC_DAC_SUPPORTED 1
@@ -334,14 +340,6 @@
#define SOC_SYSTIMER_BIT_WIDTH_LO 32 // Bit width of systimer low part #define SOC_SYSTIMER_BIT_WIDTH_LO 32 // Bit width of systimer low part
#define SOC_SYSTIMER_BIT_WIDTH_HI 32 // Bit width of systimer high part #define SOC_SYSTIMER_BIT_WIDTH_HI 32 // Bit width of systimer high part
/*-------------------------- TIMER GROUP CAPS --------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (2)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (64)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_APB (1)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (4)
/*-------------------------- LP_TIMER CAPS ----------------------------------*/ /*-------------------------- LP_TIMER CAPS ----------------------------------*/
#define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 64 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 2 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -995,30 +995,6 @@ config SOC_SYSTIMER_ALARM_MISS_COMPENSATE
bool bool
default y default y
config SOC_TIMER_GROUPS
int
default 2
config SOC_TIMER_GROUP_TIMERS_PER_GROUP
int
default 2
config SOC_TIMER_GROUP_COUNTER_BIT_WIDTH
int
default 54
config SOC_TIMER_GROUP_SUPPORT_XTAL
bool
default y
config SOC_TIMER_GROUP_SUPPORT_APB
bool
default y
config SOC_TIMER_GROUP_TOTAL_TIMERS
int
default 4
config SOC_LP_TIMER_BIT_WIDTH_LO config SOC_LP_TIMER_BIT_WIDTH_LO
int int
default 32 default 32

View File

@@ -21,6 +21,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_ESP32S3 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_ADC_SUPPORTED 1 #define SOC_ADC_SUPPORTED 1
#define SOC_UART_SUPPORTED 1 #define SOC_UART_SUPPORTED 1
@@ -386,14 +392,6 @@
#define SOC_SYSTIMER_INT_LEVEL 1 // Systimer peripheral uses level #define SOC_SYSTIMER_INT_LEVEL 1 // Systimer peripheral uses level
#define SOC_SYSTIMER_ALARM_MISS_COMPENSATE 1 // Systimer peripheral can generate interrupt immediately if t(target) > t(current) #define SOC_SYSTIMER_ALARM_MISS_COMPENSATE 1 // Systimer peripheral can generate interrupt immediately if t(target) > t(current)
/*-------------------------- TIMER GROUP CAPS --------------------------------*/
#define SOC_TIMER_GROUPS (2)
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (2)
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (54)
#define SOC_TIMER_GROUP_SUPPORT_XTAL (1)
#define SOC_TIMER_GROUP_SUPPORT_APB (1)
#define SOC_TIMER_GROUP_TOTAL_TIMERS (4)
/*-------------------------- LP_TIMER CAPS ----------------------------------*/ /*-------------------------- LP_TIMER CAPS ----------------------------------*/
#define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part
#define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"
/*--------------------------- Timer Group -------------------------------------------*/
#define _SOC_CAPS_TIMG_INST_NUM 2 // Number of Timer Group instances
/*--------------------------- GPTIMER ---------------------------------------*/
#define _SOC_CAPS_GPTIMER_COUNTER_BIT_WIDTH 54 // Bit width of GPTIMER counter
#define _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG 2 // Number of general purpose timers in each Timer Group
#define _SOC_CAPS_GPTIMER_TIMERS_TOTAL (_SOC_CAPS_TIMG_INST_NUM * _SOC_CAPS_GPTIMER_TIMERS_PER_TIMG)
/*--------------------------- Watch Dog ------------------------------------------*/
#define _SOC_CAPS_WDT_MWDTS_PER_TIMG 1 // Number of main watchdog timers in each Timer Group

View File

@@ -0,0 +1,31 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
/**
* SOC Capability evaluation helpers
*
* These macros provide a standardized way to query SOC capabilities without directly
* accessing internal implementation macros in soc_caps_full.h and public macros in soc_caps.h.
*
* The main categories of macros are:
* - SOC_IS : Check if the SOC is a specific target (e.g., SOC_IS(ESP32S3))
* - SOC_MODULE_ATTR : Get a specific attribute of a module (e.g., SOC_MODULE_ATTR(GPTIMER, NUM))
* - SOC_MODULE_SUPPORT : Check if a module supports a feature (e.g., SOC_MODULE_SUPPORT(GPTIMER, ETM))
*/
#define _SOC_CAPS_EVAL(_name) _SOC_CAPS_ ## _name
/* User-facing semantic macros */
// Check if the SOC has a specific module
#define SOC_HAS(_module) SOC_ ## _module ## _SUPPORTED
// Check if the SOC is a specific target
#define SOC_IS(_target) _SOC_CAPS_EVAL(TARGET_IS_ ## _target)
// Generic query macro, which can be used to get any module attribute (e.g. version, ID, number, etc.)
#define SOC_MODULE_ATTR(_module, _attr) _SOC_CAPS_EVAL(_module ## _ ## _attr)
// Generic support check macro, which can be used to check if a module supports a specific feature (e.g. ETM, DMA, etc.)
#define SOC_MODULE_SUPPORT(_module, _feat) _SOC_CAPS_EVAL(_module ## _SUPPORT_ ## _feat)

View File

@@ -21,6 +21,12 @@
#pragma once #pragma once
#if __has_include("soc/soc_caps_eval.h")
#include "soc/soc_caps_eval.h"
#endif
#define _SOC_CAPS_TARGET_IS_HOST 1 // [gen_soc_caps:ignore]
/*-------------------------- COMMON CAPS ---------------------------------------*/ /*-------------------------- COMMON CAPS ---------------------------------------*/
#define SOC_EFUSE_SUPPORTED (1) #define SOC_EFUSE_SUPPORTED (1)
#define SOC_EFUSE_KEY_PURPOSE_FIELD (1) #define SOC_EFUSE_KEY_PURPOSE_FIELD (1)

View File

@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/soc_caps.h"
#include "soc/soc_caps_eval.h"

View File

@@ -16,7 +16,7 @@
PROJECT_NAME = "IDF Programming Guide" PROJECT_NAME = "IDF Programming Guide"
## The 'INPUT' statement below is used as input by script 'gen-df-input.py' ## The 'INPUT' statement below is used as input by script 'gen-df-input.py'
## to automatically generate API reference list files heder_file.inc ## to automatically generate API reference list files header_file.inc
## These files are placed in '_inc' directory ## These files are placed in '_inc' directory
## and used to include in API reference documentation ## and used to include in API reference documentation
@@ -311,7 +311,8 @@ INPUT = \
$(PROJECT_PATH)/components/protocomm/include/crypto/srp6a/esp_srp.h \ $(PROJECT_PATH)/components/protocomm/include/crypto/srp6a/esp_srp.h \
$(PROJECT_PATH)/components/pthread/include/esp_pthread.h \ $(PROJECT_PATH)/components/pthread/include/esp_pthread.h \
$(PROJECT_PATH)/components/sdmmc/include/sdmmc_cmd.h \ $(PROJECT_PATH)/components/sdmmc/include/sdmmc_cmd.h \
$(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/adc_channel.h \ $(PROJECT_PATH)/components/soc/include/soc/soc_caps_eval.h \
$(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/adc_channel.h \
$(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/clk_tree_defs.h \ $(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/clk_tree_defs.h \
$(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/gpio_num.h \ $(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/gpio_num.h \
$(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/soc_caps.h \ $(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/soc_caps.h \

View File

@@ -1,16 +1,36 @@
SoC Capabilities SoC Capability Macros
================ =====================
:link_to_translation:`zh_CN:[中文]` :link_to_translation:`zh_CN:[中文]`
This section lists the macro definitions of the {IDF_TARGET_NAME}'s SoC hardware capabilities. These macros are commonly used by conditional-compilation directives (e.g., ``#if``) in ESP-IDF to determine which hardware-dependent features are supported, thus control what portions of code are compiled. Different models of ESP chips integrate various hardware modules. Even the same type of module may have subtle differences across different chips. ESP-IDF provides a small "database" to describe the differences between chips (please note, only differences are described, not commonalities). The contents of this "database" are defined as macros in the **soc/soc_caps.h** file, referred to as **SoC capability macros**. Users can utilize these macros in their code with conditional compilation directives (such as ``#if``) to control which code is actually compiled.
.. warning:: .. note::
These macro definitions are currently not considered to be part of the public API, and may be changed in a breaking manner (see :doc:`../../../versions` for more details). Please note that the contents of **soc/soc_caps.h** are currently unstable and may undergo significant changes in the future.
Using SoC Capability Macros
---------------------------
We recommend accessing SoC capability macros indirectly through the following macro functions:
.. list-table::
:widths: 30 60 80
:header-rows: 1
* - Macro Function
- Description
- Example
* - :c:macro:`SOC_IS`
- Determines the chip model
- ``#if SOC_IS(ESP32)`` checks if the chip is ESP32
* - :c:macro:`SOC_HAS`
- Checks if the chip has a specific hardware module or feature
- ``#if SOC_HAS(DAC)`` checks if the chip has a DAC module
API Reference API Reference
------------- -------------
.. include-build-file:: inc/soc_caps.inc .. include-build-file:: inc/soc_caps.inc
.. include-build-file:: inc/soc_caps_eval.inc

View File

@@ -1,16 +1,35 @@
SoC SoC 能力宏
================ ==========
:link_to_translation:`en:[English]` :link_to_translation:`en:[English]`
此文档介绍了 {IDF_TARGET_NAME} SoC 硬件功能的宏定义。ESP-IDF 中的条件编译指令通常使用这些宏来确定哪些依赖于硬件的功能受到支持,从而控制编译的代码内容。 不同型号的 ESP 芯片内部会集成不同的硬件模块。哪怕是同一种模块在不同的芯片上也可能具有细微的差异。ESP-IDF 中提供了一份小型的“数据库”来描述不同芯片之间的差异(注意,我们不描述共性,只描述差异)。这份“数据库“的内容以宏定义的形式定义在 **soc/soc_caps.h** 文件中,我们称之为 **SoC 能力宏**。用户可以通过在代码中使用条件编译指令(比如 ``#if``)来使用这些宏,从而控制实际需要编译的代码内容。
.. note:: .. note::
目前,这些宏定义不属于公共 API,未来可能发生重大更改。如需了解详情,请前往 :doc:`../../../versions` 请注意, **soc/soc_caps.h** 中的内容目前还不稳定,未来可能发生重大更改。
使用 SoC 能力宏
---------------
我们推荐通过下面的宏函数来间接地访问 SoC 能力宏:
.. list-table::
:widths: 30 60 80
:header-rows: 1
* - 宏函数
- 描述
- 示例
* - :c:macro:`SOC_IS`
- 判断芯片型号
- ``#if SOC_IS(ESP32)`` 判断是否为 ESP32 芯片
* - :c:macro:`SOC_HAS`
- 判断芯片是否具有某个硬件模块或功能
- ``#if SOC_HAS(DAC)`` 判断是否具有 DAC 模块
API 参考 API 参考
------------- --------
.. include-build-file:: inc/soc_caps.inc .. include-build-file:: inc/soc_caps.inc
.. include-build-file:: inc/soc_caps_eval.inc

View File

@@ -13,6 +13,7 @@ from string import Template
# The following header files in soc component is treated as stable, so is allowed to be used in any public header files # The following header files in soc component is treated as stable, so is allowed to be used in any public header files
allowed_soc_headers = ( allowed_soc_headers = (
'soc/soc_caps.h', 'soc/soc_caps.h',
'soc/soc_caps_eval.h',
'soc/gpio_num.h', 'soc/gpio_num.h',
'soc/reset_reasons.h', 'soc/reset_reasons.h',
'soc/reg_base.h', 'soc/reg_base.h',
@@ -39,9 +40,7 @@ class PublicAPIVisits:
# $(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/uart_channel.h \ # $(PROJECT_PATH)/components/soc/$(IDF_TARGET)/include/soc/uart_channel.h \
# -> ${PROJECT_PATH}/components/soc/${IDF_TARGET}/include/soc/uart_channel.h # -> ${PROJECT_PATH}/components/soc/${IDF_TARGET}/include/soc/uart_channel.h
line = line.replace('(', '{').replace(')', '}').rstrip('\\ ') line = line.replace('(', '{').replace(')', '}').rstrip('\\ ')
file_path = Template(line).substitute( file_path = Template(line).substitute(PROJECT_PATH=self._idf_path, IDF_TARGET=self._target)
PROJECT_PATH=self._idf_path, IDF_TARGET=self._target
)
yield file_path yield file_path
@@ -51,9 +50,7 @@ def check_soc_not_in(
doxyfile_path: str, doxyfile_path: str,
violation_dict: typing.Dict[str, set], violation_dict: typing.Dict[str, set],
) -> None: ) -> None:
for file_path in PublicAPIVisits( for file_path in PublicAPIVisits(os.path.join(idf_path, doxyfile_path), idf_path, target):
os.path.join(idf_path, doxyfile_path), idf_path, target
):
with open(file_path, 'r', encoding='utf8') as f: with open(file_path, 'r', encoding='utf8') as f:
for line in f: for line in f:
match_data = re.match(include_header_pattern, line) match_data = re.match(include_header_pattern, line)
@@ -72,9 +69,7 @@ def main() -> None:
sys.exit(1) sys.exit(1)
# list all doxyfiles # list all doxyfiles
doxyfiles = fnmatch.filter( doxyfiles = fnmatch.filter(os.listdir(os.path.join(idf_path, 'docs/doxygen')), 'Doxyfile*')
os.listdir(os.path.join(idf_path, 'docs/doxygen')), 'Doxyfile*'
)
print(f'Found Doxyfiles:{doxyfiles}') print(f'Found Doxyfiles:{doxyfiles}')
# targets are judged from Doxyfile name # targets are judged from Doxyfile name

View File

@@ -0,0 +1,17 @@
# Refer to https://ast-grep.github.io/guide/rule-config.html for Rule Essentials
id: recommended-way-to-use-soc-caps
message: Don't expand SOC_CAPS macro manually
severity: error # error, warning, info, hint
note: Should use the macro functions offered by soc_caps_eval.h to compute the SOC_CAPS macro
language: C
files:
- "components/**/*"
- "examples/**/*"
ignores:
- "components/soc/**/soc_caps.h"
- "components/soc/**/soc_caps_full.h"
- "components/soc/**/soc_caps_eval.h"
rule:
kind: identifier
pattern: $A
regex: "^_SOC_CAPS_"