forked from espressif/esp-idf
hal: use systimer HAL IMPL in ESP32C2 ROM
This commit is contained in:
@@ -45,6 +45,12 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"sha_hal.c"
|
"sha_hal.c"
|
||||||
"adc_hal.c")
|
"adc_hal.c")
|
||||||
|
|
||||||
|
if(CONFIG_SOC_SYSTIMER_SUPPORTED)
|
||||||
|
if(NOT CONFIG_HAL_SYSTIMER_ROM_IMPL)
|
||||||
|
list(APPEND srcs "systimer_hal.c")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${target} STREQUAL "esp32")
|
if(${target} STREQUAL "esp32")
|
||||||
list(APPEND srcs
|
list(APPEND srcs
|
||||||
"dac_hal.c"
|
"dac_hal.c"
|
||||||
@@ -76,7 +82,6 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"pcnt_hal.c"
|
"pcnt_hal.c"
|
||||||
"spi_flash_hal_gpspi.c"
|
"spi_flash_hal_gpspi.c"
|
||||||
"spi_slave_hd_hal.c"
|
"spi_slave_hd_hal.c"
|
||||||
"systimer_hal.c"
|
|
||||||
"touch_sensor_hal.c"
|
"touch_sensor_hal.c"
|
||||||
"usb_hal.c"
|
"usb_hal.c"
|
||||||
"usb_phy_hal.c"
|
"usb_phy_hal.c"
|
||||||
@@ -104,7 +109,6 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"pcnt_hal.c"
|
"pcnt_hal.c"
|
||||||
"spi_flash_hal_gpspi.c"
|
"spi_flash_hal_gpspi.c"
|
||||||
"spi_slave_hd_hal.c"
|
"spi_slave_hd_hal.c"
|
||||||
"systimer_hal.c"
|
|
||||||
"touch_sensor_hal.c"
|
"touch_sensor_hal.c"
|
||||||
"usb_hal.c"
|
"usb_hal.c"
|
||||||
"usb_phy_hal.c"
|
"usb_phy_hal.c"
|
||||||
@@ -129,7 +133,6 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"sigmadelta_hal.c"
|
"sigmadelta_hal.c"
|
||||||
"spi_flash_hal_gpspi.c"
|
"spi_flash_hal_gpspi.c"
|
||||||
"spi_slave_hd_hal.c"
|
"spi_slave_hd_hal.c"
|
||||||
"systimer_hal.c"
|
|
||||||
"xt_wdt_hal.c"
|
"xt_wdt_hal.c"
|
||||||
"i2s_hal.c"
|
"i2s_hal.c"
|
||||||
"twai_hal.c"
|
"twai_hal.c"
|
||||||
@@ -149,7 +152,6 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"sigmadelta_hal.c"
|
"sigmadelta_hal.c"
|
||||||
"spi_flash_hal_gpspi.c"
|
"spi_flash_hal_gpspi.c"
|
||||||
"spi_slave_hd_hal.c"
|
"spi_slave_hd_hal.c"
|
||||||
"systimer_hal.c"
|
|
||||||
"i2s_hal.c"
|
"i2s_hal.c"
|
||||||
"twai_hal.c"
|
"twai_hal.c"
|
||||||
"twai_hal_iram.c"
|
"twai_hal_iram.c"
|
||||||
@@ -165,7 +167,6 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
"gdma_hal.c"
|
"gdma_hal.c"
|
||||||
"spi_flash_hal_gpspi.c"
|
"spi_flash_hal_gpspi.c"
|
||||||
"spi_slave_hd_hal.c"
|
"spi_slave_hd_hal.c"
|
||||||
"systimer_hal.c"
|
|
||||||
"esp32c2/brownout_hal.c"
|
"esp32c2/brownout_hal.c"
|
||||||
"esp32c2/rtc_cntl_hal.c")
|
"esp32c2/rtc_cntl_hal.c")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -65,4 +65,20 @@ menu "Hardware Abstraction Layer (HAL) and Low Level (LL)"
|
|||||||
default 4 if HAL_LOG_LEVEL_DEBUG
|
default 4 if HAL_LOG_LEVEL_DEBUG
|
||||||
default 5 if HAL_LOG_LEVEL_VERBOSE
|
default 5 if HAL_LOG_LEVEL_VERBOSE
|
||||||
|
|
||||||
|
config HAL_SYSTIMER_HAS_ROM_IMPL
|
||||||
|
bool
|
||||||
|
default y if IDF_TARGET_ESP32C2
|
||||||
|
|
||||||
|
config HAL_SYSTIMER_ROM_IMPL
|
||||||
|
bool "Use systimer HAL implementation in ROM"
|
||||||
|
depends on HAL_SYSTIMER_HAS_ROM_IMPL
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable this flag to use HAL functions from ROM instead of ESP-IDF.
|
||||||
|
|
||||||
|
If keeping this as "n" in your project, you will have less free IRAM.
|
||||||
|
If making this as "y" in your project, you will increase free IRAM,
|
||||||
|
but you will lose the possibility to debug this module, and some new
|
||||||
|
features will be added and bugs will be fixed in the IDF source
|
||||||
|
but cannot be synced to ROM.
|
||||||
endmenu
|
endmenu
|
||||||
|
@@ -21,7 +21,8 @@ entries:
|
|||||||
twai_hal_iram (noflash)
|
twai_hal_iram (noflash)
|
||||||
if IDF_TARGET_ESP32 = n:
|
if IDF_TARGET_ESP32 = n:
|
||||||
spi_flash_hal_gpspi (noflash)
|
spi_flash_hal_gpspi (noflash)
|
||||||
systimer_hal (noflash)
|
if HAL_SYSTIMER_HAS_ROM_IMPL = n || HAL_SYSTIMER_ROM_IMPL = n:
|
||||||
|
systimer_hal (noflash)
|
||||||
if GPTIMER_CTRL_FUNC_IN_IRAM = y:
|
if GPTIMER_CTRL_FUNC_IN_IRAM = y:
|
||||||
timer_hal_iram (noflash)
|
timer_hal_iram (noflash)
|
||||||
if GPIO_CTRL_FUNC_IN_IRAM = y:
|
if GPIO_CTRL_FUNC_IN_IRAM = y:
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
@@ -387,6 +387,10 @@ config SOC_MEMSPI_SRC_FREQ_15M_SUPPORTED
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_SYSTIMER_SUPPORTED
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_SYSTIMER_COUNTER_NUM
|
config SOC_SYSTIMER_COUNTER_NUM
|
||||||
int
|
int
|
||||||
default 2
|
default 2
|
||||||
|
@@ -207,6 +207,7 @@
|
|||||||
#define SOC_MEMSPI_SRC_FREQ_15M_SUPPORTED 1
|
#define SOC_MEMSPI_SRC_FREQ_15M_SUPPORTED 1
|
||||||
|
|
||||||
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
||||||
|
#define SOC_SYSTIMER_SUPPORTED 1
|
||||||
#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
|
||||||
#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
|
||||||
|
@@ -563,6 +563,10 @@ config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_SYSTIMER_SUPPORTED
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_SYSTIMER_COUNTER_NUM
|
config SOC_SYSTIMER_COUNTER_NUM
|
||||||
int
|
int
|
||||||
default 2
|
default 2
|
||||||
|
@@ -276,6 +276,7 @@
|
|||||||
#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1
|
#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1
|
||||||
|
|
||||||
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
||||||
|
#define SOC_SYSTIMER_SUPPORTED 1
|
||||||
#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
|
||||||
#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
|
||||||
|
@@ -555,6 +555,10 @@ config SOC_MEMSPI_SRC_FREQ_12M_SUPPORTED
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_SYSTIMER_SUPPORTED
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_SYSTIMER_COUNTER_NUM
|
config SOC_SYSTIMER_COUNTER_NUM
|
||||||
int
|
int
|
||||||
default 2
|
default 2
|
||||||
|
@@ -287,6 +287,7 @@
|
|||||||
#define SOC_MEMSPI_SRC_FREQ_12M_SUPPORTED 1
|
#define SOC_MEMSPI_SRC_FREQ_12M_SUPPORTED 1
|
||||||
|
|
||||||
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
/*-------------------------- SYSTIMER CAPS ----------------------------------*/
|
||||||
|
#define SOC_SYSTIMER_SUPPORTED 1
|
||||||
#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
|
||||||
#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
|
||||||
|
@@ -579,6 +579,10 @@ config SOC_SYSTIMER_BIT_WIDTH_HI
|
|||||||
int
|
int
|
||||||
default 32
|
default 32
|
||||||
|
|
||||||
|
config SOC_SYSTIMER_SUPPORTED
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_TIMER_GROUPS
|
config SOC_TIMER_GROUPS
|
||||||
int
|
int
|
||||||
default 2
|
default 2
|
||||||
|
@@ -269,6 +269,7 @@
|
|||||||
#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 --------------------------------*/
|
/*-------------------------- TIMER GROUP CAPS --------------------------------*/
|
||||||
|
#define SOC_SYSTIMER_SUPPORTED 1
|
||||||
#define SOC_TIMER_GROUPS (2)
|
#define SOC_TIMER_GROUPS (2)
|
||||||
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (2)
|
#define SOC_TIMER_GROUP_TIMERS_PER_GROUP (2)
|
||||||
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (64)
|
#define SOC_TIMER_GROUP_COUNTER_BIT_WIDTH (64)
|
||||||
|
@@ -651,7 +651,7 @@ config SOC_SPIRAM_SUPPORTED
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config SOC_TOUCH_VERSION_2
|
config SOC_SYSTIMER_SUPPORTED
|
||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
@@ -707,6 +707,10 @@ config SOC_TIMER_GROUP_TOTAL_TIMERS
|
|||||||
int
|
int
|
||||||
default 4
|
default 4
|
||||||
|
|
||||||
|
config SOC_TOUCH_VERSION_2
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_TOUCH_SENSOR_NUM
|
config SOC_TOUCH_SENSOR_NUM
|
||||||
int
|
int
|
||||||
default 15
|
default 15
|
||||||
|
@@ -271,7 +271,7 @@
|
|||||||
#define SOC_SPIRAM_SUPPORTED 1
|
#define SOC_SPIRAM_SUPPORTED 1
|
||||||
|
|
||||||
/*-------------------------- SYS TIMER CAPS ----------------------------------*/
|
/*-------------------------- SYS TIMER CAPS ----------------------------------*/
|
||||||
#define SOC_TOUCH_VERSION_2 (1) // Hardware version of touch sensor
|
#define SOC_SYSTIMER_SUPPORTED 1
|
||||||
#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
|
||||||
#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
|
||||||
@@ -289,6 +289,7 @@
|
|||||||
#define SOC_TIMER_GROUP_TOTAL_TIMERS (4)
|
#define SOC_TIMER_GROUP_TOTAL_TIMERS (4)
|
||||||
|
|
||||||
/*-------------------------- TOUCH SENSOR CAPS -------------------------------*/
|
/*-------------------------- TOUCH SENSOR CAPS -------------------------------*/
|
||||||
|
#define SOC_TOUCH_VERSION_2 (1) // Hardware version of touch sensor
|
||||||
#define SOC_TOUCH_SENSOR_NUM (15) /*! 15 Touch channels */
|
#define SOC_TOUCH_SENSOR_NUM (15) /*! 15 Touch channels */
|
||||||
#define SOC_TOUCH_PROXIMITY_CHANNEL_NUM (3) /* Sopport touch proximity channel number. */
|
#define SOC_TOUCH_PROXIMITY_CHANNEL_NUM (3) /* Sopport touch proximity channel number. */
|
||||||
#define SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED (1) /*Sopport touch proximity channel measure done interrupt type. */
|
#define SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED (1) /*Sopport touch proximity channel measure done interrupt type. */
|
||||||
|
Reference in New Issue
Block a user