From 73ebd544fd4ddca928d56c137df26f5b7eccf4bd Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Mon, 17 Nov 2025 12:17:01 +0800 Subject: [PATCH] refactor(i2s): refactor of the private i2s caps --- components/esp_adc/CMakeLists.txt | 2 +- components/esp_driver_dac/CMakeLists.txt | 2 +- .../test_apps/dac/main/CMakeLists.txt | 2 +- components/esp_driver_i2s/i2s_common.c | 20 +++++++++---------- components/esp_driver_i2s/i2s_platform.c | 8 ++++---- components/esp_driver_i2s/i2s_private.h | 7 ++++--- .../test_apps/i2s/main/test_i2s.c | 10 +++++----- components/esp_hal_i2s/esp32/i2s_periph.c | 2 +- .../esp_hal_i2s/esp32/include/hal/i2s_ll.h | 1 - components/esp_hal_i2s/esp32c3/i2s_periph.c | 2 +- .../esp_hal_i2s/esp32c3/include/hal/i2s_ll.h | 2 +- components/esp_hal_i2s/esp32c5/i2s_periph.c | 4 ++-- .../esp_hal_i2s/esp32c5/include/hal/i2s_ll.h | 6 +++--- components/esp_hal_i2s/esp32c6/i2s_periph.c | 4 ++-- .../esp_hal_i2s/esp32c6/include/hal/i2s_ll.h | 6 +++--- components/esp_hal_i2s/esp32c61/i2s_periph.c | 4 ++-- .../esp_hal_i2s/esp32c61/include/hal/i2s_ll.h | 6 +++--- components/esp_hal_i2s/esp32h2/i2s_periph.c | 4 ++-- .../esp_hal_i2s/esp32h2/include/hal/i2s_ll.h | 6 +++--- components/esp_hal_i2s/esp32h4/i2s_periph.c | 4 ++-- .../esp_hal_i2s/esp32h4/include/hal/i2s_ll.h | 6 +++--- components/esp_hal_i2s/esp32p4/i2s_periph.c | 4 ++-- .../esp_hal_i2s/esp32p4/include/hal/i2s_ll.h | 6 +++--- components/esp_hal_i2s/esp32s2/i2s_periph.c | 2 +- .../esp_hal_i2s/esp32s2/include/hal/i2s_ll.h | 1 - components/esp_hal_i2s/esp32s3/i2s_periph.c | 2 +- .../esp_hal_i2s/esp32s3/include/hal/i2s_ll.h | 2 +- .../esp_hal_i2s/include/hal/i2s_periph.h | 7 +++---- components/esp_hal_lcd/CMakeLists.txt | 3 ++- components/esp_hw_support/CMakeLists.txt | 5 ++++- .../esp_hw_support/sleep_system_peripheral.c | 9 +++++++-- components/esp_system/CMakeLists.txt | 1 + components/hal/CMakeLists.txt | 2 +- components/hal/include/hal/i2s_hal.h | 2 +- .../soc/esp32/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32c3/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32c5/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32c6/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32c61/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32h2/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32h21/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32h4/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32p4/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32s2/include/soc/soc_caps_full.h | 4 ---- .../soc/esp32s3/include/soc/soc_caps_full.h | 4 ---- docs/doxygen/Doxyfile | 1 - 46 files changed, 81 insertions(+), 118 deletions(-) diff --git a/components/esp_adc/CMakeLists.txt b/components/esp_adc/CMakeLists.txt index 061a26c2f5..d52d3c70dd 100644 --- a/components/esp_adc/CMakeLists.txt +++ b/components/esp_adc/CMakeLists.txt @@ -48,7 +48,7 @@ endif() set(extra_requires) idf_build_get_property(target IDF_TARGET) if(${target} STREQUAL "esp32") - list(APPEND extra_requires esp_driver_i2s esp_hal_i2s) + list(APPEND extra_requires esp_driver_i2s) endif() if(${target} STREQUAL "esp32s2") list(APPEND extra_requires esp_driver_spi) diff --git a/components/esp_driver_dac/CMakeLists.txt b/components/esp_driver_dac/CMakeLists.txt index 8c02c09aaa..4b34f22df6 100644 --- a/components/esp_driver_dac/CMakeLists.txt +++ b/components/esp_driver_dac/CMakeLists.txt @@ -6,7 +6,7 @@ set(priv_req esp_pm esp_driver_gpio) if(${target} STREQUAL "linux") return() # This component is not supported by the POSIX/Linux simulator elseif(${target} STREQUAL "esp32") - list(APPEND priv_req esp_driver_i2s esp_hal_i2s) + list(APPEND priv_req esp_driver_i2s) elseif(${target} STREQUAL "esp32s2") list(APPEND priv_req esp_driver_spi) endif() diff --git a/components/esp_driver_dac/test_apps/dac/main/CMakeLists.txt b/components/esp_driver_dac/test_apps/dac/main/CMakeLists.txt index 816654dc2b..5a701a9196 100644 --- a/components/esp_driver_dac/test_apps/dac/main/CMakeLists.txt +++ b/components/esp_driver_dac/test_apps/dac/main/CMakeLists.txt @@ -8,6 +8,6 @@ endif() # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity esp_driver_pcnt esp_adc esp_hal_i2s + PRIV_REQUIRES unity esp_driver_pcnt esp_adc esp_driver_dac esp_driver_gpio esp_driver_i2s esp_driver_spi WHOLE_ARCHIVE) diff --git a/components/esp_driver_i2s/i2s_common.c b/components/esp_driver_i2s/i2s_common.c index d60dc2aea2..ff8d33597d 100644 --- a/components/esp_driver_i2s/i2s_common.c +++ b/components/esp_driver_i2s/i2s_common.c @@ -227,13 +227,13 @@ static esp_err_t i2s_destroy_controller_obj(i2s_controller_t **i2s_obj) * @param id i2s port id * @param search_reverse reverse the sequence of port acquirement * set false to acquire from I2S_NUM_0 first - * set true to acquire from SOC_I2S_ATTR(INST_NUM) - 1 first + * set true to acquire from I2S_LL_GET(INST_NUM) - 1 first * @return * - pointer of acquired i2s controller object */ static i2s_controller_t *i2s_acquire_controller_obj(int id) { - if (id < 0 || id >= SOC_I2S_ATTR(INST_NUM)) { + if (id < 0 || id >= I2S_LL_GET(INST_NUM)) { return NULL; } /* pre-alloc controller object */ @@ -792,17 +792,17 @@ esp_err_t i2s_init_dma_intr(i2s_chan_handle_t handle, int intr_flag) { esp_err_t ret = ESP_OK; int port_id = handle->controller->id; - ESP_RETURN_ON_FALSE((port_id >= 0) && (port_id < SOC_I2S_ATTR(INST_NUM)), ESP_ERR_INVALID_ARG, TAG, "invalid handle"); + ESP_RETURN_ON_FALSE((port_id >= 0) && (port_id < I2S_LL_GET(INST_NUM)), ESP_ERR_INVALID_ARG, TAG, "invalid handle"); /* Set GDMA trigger module */ gdma_trigger_t trig = {.periph = GDMA_TRIG_PERIPH_I2S}; switch (port_id) { -#if SOC_I2S_ATTR(INST_NUM) > 2 +#if I2S_LL_GET(INST_NUM) > 2 case I2S_NUM_2: trig.instance_id = SOC_GDMA_TRIG_PERIPH_I2S2; break; #endif -#if SOC_I2S_ATTR(INST_NUM) > 1 +#if I2S_LL_GET(INST_NUM) > 1 case I2S_NUM_1: trig.instance_id = SOC_GDMA_TRIG_PERIPH_I2S1; break; @@ -863,7 +863,7 @@ esp_err_t i2s_init_dma_intr(i2s_chan_handle_t handle, int intr_flag) { esp_err_t ret = ESP_OK; int port_id = handle->controller->id; - ESP_RETURN_ON_FALSE((port_id >= 0) && (port_id < SOC_I2S_ATTR(INST_NUM)), ESP_ERR_INVALID_ARG, TAG, "invalid handle"); + ESP_RETURN_ON_FALSE((port_id >= 0) && (port_id < I2S_LL_GET(INST_NUM)), ESP_ERR_INVALID_ARG, TAG, "invalid handle"); intr_flag |= handle->intr_prio_flags; /* Initialize I2S module interrupt */ if (handle->dir == I2S_DIR_TX) { @@ -985,7 +985,7 @@ esp_err_t i2s_new_channel(const i2s_chan_config_t *chan_cfg, i2s_chan_handle_t * /* Parameter validity check */ I2S_NULL_POINTER_CHECK(TAG, chan_cfg); I2S_NULL_POINTER_CHECK(TAG, tx_handle || rx_handle); - ESP_RETURN_ON_FALSE((chan_cfg->id >= 0 && chan_cfg->id < SOC_I2S_ATTR(INST_NUM)) || chan_cfg->id == I2S_NUM_AUTO, ESP_ERR_INVALID_ARG, TAG, "invalid I2S port id"); + ESP_RETURN_ON_FALSE((chan_cfg->id >= 0 && chan_cfg->id < I2S_LL_GET(INST_NUM)) || chan_cfg->id == I2S_NUM_AUTO, ESP_ERR_INVALID_ARG, TAG, "invalid I2S port id"); ESP_RETURN_ON_FALSE(chan_cfg->dma_desc_num >= 2, ESP_ERR_INVALID_ARG, TAG, "there should be at least 2 DMA buffers"); ESP_RETURN_ON_FALSE(chan_cfg->intr_priority >= 0 && chan_cfg->intr_priority <= 7, ESP_ERR_INVALID_ARG, TAG, "intr_priority should be within 0~7"); #if !SOC_HAS(PAU) @@ -1003,7 +1003,7 @@ esp_err_t i2s_new_channel(const i2s_chan_config_t *chan_cfg, i2s_chan_handle_t * /* Channel will be registered to one i2s port automatically if id is I2S_NUM_AUTO * Otherwise, the channel will be registered to the specific port. */ if (id == I2S_NUM_AUTO) { - for (int i = 0; i < SOC_I2S_ATTR(INST_NUM) && !channel_found; i++) { + for (int i = 0; i < I2S_LL_GET(INST_NUM) && !channel_found; i++) { i2s_obj = i2s_acquire_controller_obj(i); if (!i2s_obj) { continue; @@ -1062,7 +1062,7 @@ esp_err_t i2s_new_channel(const i2s_chan_config_t *chan_cfg, i2s_chan_handle_t * err: /* if the controller object has no channel, find the corresponding global object and destroy it */ if (i2s_obj != NULL && i2s_obj->rx_chan == NULL && i2s_obj->tx_chan == NULL) { - for (int i = 0; i < SOC_I2S_ATTR(INST_NUM); i++) { + for (int i = 0; i < I2S_LL_GET(INST_NUM); i++) { if (i2s_obj == g_i2s.controller[i]) { i2s_destroy_controller_obj(&g_i2s.controller[i]); break; @@ -1173,7 +1173,7 @@ esp_err_t i2s_channel_get_info(i2s_chan_handle_t handle, i2s_chan_info_t *chan_i I2S_NULL_POINTER_CHECK(TAG, chan_info); /* Find whether the handle is a registered i2s handle or still available */ - for (int i = 0; i < SOC_I2S_ATTR(INST_NUM); i++) { + for (int i = 0; i < I2S_LL_GET(INST_NUM); i++) { if (g_i2s.controller[i] != NULL) { if (g_i2s.controller[i]->tx_chan == handle || g_i2s.controller[i]->rx_chan == handle) { diff --git a/components/esp_driver_i2s/i2s_platform.c b/components/esp_driver_i2s/i2s_platform.c index 7baa7903ad..0bcf1117e7 100644 --- a/components/esp_driver_i2s/i2s_platform.c +++ b/components/esp_driver_i2s/i2s_platform.c @@ -16,8 +16,8 @@ static const char *TAG = "i2s_platform"; */ i2s_platform_t g_i2s = { .spinlock = (portMUX_TYPE)portMUX_INITIALIZER_UNLOCKED, - .controller[0 ...(SOC_I2S_ATTR(INST_NUM) - 1)] = NULL, // groups will be lazy installed - .comp_name[0 ...(SOC_I2S_ATTR(INST_NUM) - 1)] = NULL, + .controller[0 ...(I2S_LL_GET(INST_NUM) - 1)] = NULL, // groups will be lazy installed + .comp_name[0 ...(I2S_LL_GET(INST_NUM) - 1)] = NULL, #if SOC_LP_I2S_SUPPORTED .lp_controller[0 ...(SOC_LP_I2S_NUM - 1)] = NULL, .lp_comp_name[0 ...(SOC_LP_I2S_NUM - 1)] = NULL, @@ -34,7 +34,7 @@ esp_err_t i2s_platform_acquire_occupation(i2s_ctlr_t type, int id, const char *c { esp_err_t ret = ESP_OK; const char *occupied_comp = NULL; - ESP_RETURN_ON_FALSE(id < SOC_I2S_ATTR(INST_NUM), ESP_ERR_INVALID_ARG, TAG, "invalid i2s port id"); + ESP_RETURN_ON_FALSE(id < I2S_LL_GET(INST_NUM), ESP_ERR_INVALID_ARG, TAG, "invalid i2s port id"); if (type == I2S_CTLR_HP) { portENTER_CRITICAL(&g_i2s.spinlock); @@ -79,7 +79,7 @@ esp_err_t i2s_platform_acquire_occupation(i2s_ctlr_t type, int id, const char *c esp_err_t i2s_platform_release_occupation(i2s_ctlr_t type, int id) { esp_err_t ret = ESP_OK; - ESP_RETURN_ON_FALSE(id < SOC_I2S_ATTR(INST_NUM), ESP_ERR_INVALID_ARG, TAG, "invalid i2s port id"); + ESP_RETURN_ON_FALSE(id < I2S_LL_GET(INST_NUM), ESP_ERR_INVALID_ARG, TAG, "invalid i2s port id"); if (type == I2S_CTLR_HP) { portENTER_CRITICAL(&g_i2s.spinlock); diff --git a/components/esp_driver_i2s/i2s_private.h b/components/esp_driver_i2s/i2s_private.h index d39f87ee55..8345f9c61f 100644 --- a/components/esp_driver_i2s/i2s_private.h +++ b/components/esp_driver_i2s/i2s_private.h @@ -14,6 +14,7 @@ #include "soc/lldesc.h" #include "soc/soc_caps.h" #include "soc/soc_caps_full.h" +#include "hal/i2s_periph.h" #include "hal/i2s_hal.h" #include "hal/lp_i2s_hal.h" #if SOC_LP_I2S_SUPPORTED @@ -225,11 +226,11 @@ struct lp_i2s_channel_obj_t { */ typedef struct { portMUX_TYPE spinlock; /*!< Platform level lock */ - i2s_controller_t *controller[SOC_I2S_ATTR(INST_NUM)]; /*!< Controller object */ - const char *comp_name[SOC_I2S_ATTR(INST_NUM)]; /*!< The component name that occupied i2s controller */ + i2s_controller_t *controller[I2S_LL_GET(INST_NUM)]; /*!< Controller object */ + const char *comp_name[I2S_LL_GET(INST_NUM)]; /*!< The component name that occupied i2s controller */ #if SOC_LP_I2S_SUPPORTED lp_i2s_controller_t *lp_controller[SOC_LP_I2S_NUM]; /*!< LP controller object*/ - const char *lp_comp_name[SOC_I2S_ATTR(INST_NUM)]; /*!< The component name that occupied lp i2s controller */ + const char *lp_comp_name[I2S_LL_GET(INST_NUM)]; /*!< The component name that occupied lp i2s controller */ #endif } i2s_platform_t; diff --git a/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c b/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c index 11c34b5b4b..070281eb10 100644 --- a/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c +++ b/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c @@ -55,7 +55,7 @@ static void i2s_test_io_config(int mode) gpio_set_direction(DATA_OUT_IO, GPIO_MODE_INPUT_OUTPUT); switch (mode) { -#if SOC_I2S_ATTR(INST_NUM) > 1 +#if I2S_LL_GET(INST_NUM) > 1 case I2S_TEST_MODE_SLAVE_TO_MASTER: { esp_rom_gpio_connect_out_signal(MASTER_BCK_IO, i2s_periph_signal[0].m_rx_bck_sig, 0, 0); esp_rom_gpio_connect_in_signal(MASTER_BCK_IO, i2s_periph_signal[1].s_tx_bck_sig, 0); @@ -169,14 +169,14 @@ TEST_CASE("I2S_basic_channel_allocation_reconfig_deleting_test", "[i2s]") /* Exhaust test */ std_cfg.gpio_cfg.mclk = -1; - i2s_chan_handle_t tx_ex[SOC_I2S_ATTR(INST_NUM)] = {}; - for (int i = 0; i < SOC_I2S_ATTR(INST_NUM); i++) { + i2s_chan_handle_t tx_ex[I2S_LL_GET(INST_NUM)] = {}; + for (int i = 0; i < I2S_LL_GET(INST_NUM); i++) { TEST_ESP_OK(i2s_new_channel(&chan_cfg, &tx_ex[i], NULL)); TEST_ESP_OK(i2s_channel_init_std_mode(tx_ex[i], &std_cfg)); TEST_ESP_OK(i2s_channel_enable(tx_ex[i])); } TEST_ESP_ERR(ESP_ERR_NOT_FOUND, i2s_new_channel(&chan_cfg, &tx_handle, NULL)); - for (int i = 0; i < SOC_I2S_ATTR(INST_NUM); i++) { + for (int i = 0; i < I2S_LL_GET(INST_NUM); i++) { TEST_ESP_OK(i2s_channel_disable(tx_ex[i])); TEST_ESP_OK(i2s_del_channel(tx_ex[i])); } @@ -812,7 +812,7 @@ TEST_CASE("I2S_loopback_test", "[i2s]") TEST_ESP_OK(i2s_del_channel(rx_handle)); } -#if SOC_I2S_ATTR(INST_NUM) > 1 && !CONFIG_ESP32P4_SELECTS_REV_LESS_V3 +#if I2S_LL_GET(INST_NUM) > 1 && !CONFIG_ESP32P4_SELECTS_REV_LESS_V3 TEST_CASE("I2S_master_write_slave_read_test", "[i2s]") { i2s_chan_handle_t tx_handle; diff --git a/components/esp_hal_i2s/esp32/i2s_periph.c b/components/esp_hal_i2s/esp32/i2s_periph.c index 804ab918ec..9ac2ff84b1 100644 --- a/components/esp_hal_i2s/esp32/i2s_periph.c +++ b/components/esp_hal_i2s/esp32/i2s_periph.c @@ -10,7 +10,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = -1, // Unavailable .mck_in_sig = -1, // Unavailable diff --git a/components/esp_hal_i2s/esp32/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32/include/hal/i2s_ll.h index 45a8dbf0a2..0eb174a347 100644 --- a/components/esp_hal_i2s/esp32/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32/include/hal/i2s_ll.h @@ -16,7 +16,6 @@ #include #include "hal/misc.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/dport_reg.h" #include "hal/i2s_types.h" diff --git a/components/esp_hal_i2s/esp32c3/i2s_periph.c b/components/esp_hal_i2s/esp32c3/i2s_periph.c index 41c27ced3e..ad5d1d4bbc 100644 --- a/components/esp_hal_i2s/esp32c3/i2s_periph.c +++ b/components/esp_hal_i2s/esp32c3/i2s_periph.c @@ -10,7 +10,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = I2S_MCLK_OUT_IDX, .mck_in_sig = I2S_MCLK_IN_IDX, diff --git a/components/esp_hal_i2s/esp32c3/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32c3/include/hal/i2s_ll.h index c9cc94d301..a3c770672e 100644 --- a/components/esp_hal_i2s/esp32c3/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32c3/include/hal/i2s_ll.h @@ -15,13 +15,13 @@ #include #include "hal/misc.h" #include "hal/assert.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/system_struct.h" #include "hal/i2s_types.h" #include "hal/hal_utils.h" #define I2S_LL_GET(_attr) I2S_LL_ ## _attr +#define I2S_LL_INST_NUM 1 #ifdef __cplusplus extern "C" { diff --git a/components/esp_hal_i2s/esp32c5/i2s_periph.c b/components/esp_hal_i2s/esp32c5/i2s_periph.c index aca226ffb3..3a98d21cc1 100644 --- a/components/esp_hal_i2s/esp32c5/i2s_periph.c +++ b/components/esp_hal_i2s/esp32c5/i2s_periph.c @@ -11,7 +11,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = I2S_MCLK_OUT_IDX, .mck_in_sig = I2S_MCLK_IN_IDX, @@ -64,7 +64,7 @@ static const uint32_t i2s_regs_map[4] = {0x12360f, 0x0, 0x0, 0x0}; static const regdma_entries_config_t i2s0_regs_retention[] = I2S_SLEEP_RETENTION_ENTRIES(0); -const i2s_reg_retention_info_t i2s_reg_retention_info[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_reg_retention_info_t i2s_reg_retention_info[I2S_LL_GET(INST_NUM)] = { [0] = { .retention_module = SLEEP_RETENTION_MODULE_I2S0, .entry_array = i2s0_regs_retention, diff --git a/components/esp_hal_i2s/esp32c5/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32c5/include/hal/i2s_ll.h index 5cbbe9bfe4..009f59a51e 100644 --- a/components/esp_hal_i2s/esp32c5/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32c5/include/hal/i2s_ll.h @@ -15,7 +15,6 @@ #include #include "hal/misc.h" #include "hal/assert.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/pcr_struct.h" #include "soc/soc_etm_struct.h" @@ -24,6 +23,7 @@ #include "hal/hal_utils.h" #define I2S_LL_GET(_attr) I2S_LL_ ## _attr +#define I2S_LL_INST_NUM 1 #ifdef __cplusplus extern "C" { @@ -42,7 +42,7 @@ extern "C" { #define I2S_LL_DEFAULT_CLK_FREQ (160 * 1000000) // PLL_F160M_CLK: 160MHz #define I2S_LL_ETM_EVENT_TABLE(i2s_port, chan_dir, event) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_EVENT_DONE] = I2S0_EVT_RX_DONE, \ [I2S_ETM_EVENT_REACH_THRESH] = I2S0_EVT_X_WORDS_RECEIVED, \ @@ -53,7 +53,7 @@ extern "C" { }}}[i2s_port][(chan_dir) - 1][event] #define I2S_LL_ETM_TASK_TABLE(i2s_port, chan_dir, task) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_TASK_START] = I2S0_TASK_START_RX, \ [I2S_ETM_TASK_STOP] = I2S0_TASK_STOP_RX, \ diff --git a/components/esp_hal_i2s/esp32c6/i2s_periph.c b/components/esp_hal_i2s/esp32c6/i2s_periph.c index b01a39d8f5..7fe405d70b 100644 --- a/components/esp_hal_i2s/esp32c6/i2s_periph.c +++ b/components/esp_hal_i2s/esp32c6/i2s_periph.c @@ -11,7 +11,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = I2S_MCLK_OUT_IDX, .mck_in_sig = I2S_MCLK_IN_IDX, @@ -64,7 +64,7 @@ static const uint32_t i2s_regs_map[4] = {0x12330f, 0x0, 0x0, 0x0}; static const regdma_entries_config_t i2s0_regs_retention[] = I2S_SLEEP_RETENTION_ENTRIES(0); -const i2s_reg_retention_info_t i2s_reg_retention_info[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_reg_retention_info_t i2s_reg_retention_info[I2S_LL_GET(INST_NUM)] = { [0] = { .retention_module = SLEEP_RETENTION_MODULE_I2S0, .entry_array = i2s0_regs_retention, diff --git a/components/esp_hal_i2s/esp32c6/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32c6/include/hal/i2s_ll.h index e8eb7f39da..fb66aa32b1 100644 --- a/components/esp_hal_i2s/esp32c6/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32c6/include/hal/i2s_ll.h @@ -15,7 +15,6 @@ #include #include "hal/misc.h" #include "hal/assert.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/pcr_struct.h" #include "soc/soc_etm_source.h" @@ -23,6 +22,7 @@ #include "hal/hal_utils.h" #define I2S_LL_GET(_attr) I2S_LL_ ## _attr +#define I2S_LL_INST_NUM 1 #ifdef __cplusplus extern "C" { @@ -41,7 +41,7 @@ extern "C" { #define I2S_LL_SUPPORT_XTAL 1 // Support XTAL as I2S clock source #define I2S_LL_ETM_EVENT_TABLE(i2s_port, chan_dir, event) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_EVENT_DONE] = I2S_EVT_RX_DONE, \ [I2S_ETM_EVENT_REACH_THRESH] = I2S_EVT_X_WORDS_RECEIVED, \ @@ -52,7 +52,7 @@ extern "C" { }}}[i2s_port][(chan_dir) - 1][event] #define I2S_LL_ETM_TASK_TABLE(i2s_port, chan_dir, task) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_TASK_START] = I2S_TASK_START_RX, \ [I2S_ETM_TASK_STOP] = I2S_TASK_STOP_RX, \ diff --git a/components/esp_hal_i2s/esp32c61/i2s_periph.c b/components/esp_hal_i2s/esp32c61/i2s_periph.c index 2fbb8e426f..e0a5b28ba3 100644 --- a/components/esp_hal_i2s/esp32c61/i2s_periph.c +++ b/components/esp_hal_i2s/esp32c61/i2s_periph.c @@ -11,7 +11,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = I2S_MCLK_OUT_IDX, .mck_in_sig = I2S_MCLK_IN_IDX, @@ -64,7 +64,7 @@ static const uint32_t i2s_regs_map[4] = {0x12360f, 0x0, 0x0, 0x0}; static const regdma_entries_config_t i2s0_regs_retention[] = I2S_SLEEP_RETENTION_ENTRIES(0); -const i2s_reg_retention_info_t i2s_reg_retention_info[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_reg_retention_info_t i2s_reg_retention_info[I2S_LL_GET(INST_NUM)] = { [0] = { .retention_module = SLEEP_RETENTION_MODULE_I2S0, .entry_array = i2s0_regs_retention, diff --git a/components/esp_hal_i2s/esp32c61/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32c61/include/hal/i2s_ll.h index 3e96ab2813..f4caa7c133 100644 --- a/components/esp_hal_i2s/esp32c61/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32c61/include/hal/i2s_ll.h @@ -15,7 +15,6 @@ #include #include "hal/misc.h" #include "hal/assert.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/pcr_struct.h" #include "soc/soc_etm_struct.h" @@ -24,6 +23,7 @@ #include "hal/hal_utils.h" #define I2S_LL_GET(_attr) I2S_LL_ ## _attr +#define I2S_LL_INST_NUM 1 #ifdef __cplusplus extern "C" { @@ -43,7 +43,7 @@ extern "C" { #define I2S_LL_SUPPORT_XTAL 1 // Support XTAL as I2S clock source #define I2S_LL_ETM_EVENT_TABLE(i2s_port, chan_dir, event) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_EVENT_DONE] = I2S0_EVT_RX_DONE, \ [I2S_ETM_EVENT_REACH_THRESH] = I2S0_EVT_X_WORDS_RECEIVED, \ @@ -54,7 +54,7 @@ extern "C" { }}}[i2s_port][(chan_dir) - 1][event] #define I2S_LL_ETM_TASK_TABLE(i2s_port, chan_dir, task) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_TASK_START] = I2S0_TASK_START_RX, \ [I2S_ETM_TASK_STOP] = I2S0_TASK_STOP_RX, \ diff --git a/components/esp_hal_i2s/esp32h2/i2s_periph.c b/components/esp_hal_i2s/esp32h2/i2s_periph.c index 8ce6a0fefe..d0c7c5868c 100644 --- a/components/esp_hal_i2s/esp32h2/i2s_periph.c +++ b/components/esp_hal_i2s/esp32h2/i2s_periph.c @@ -11,7 +11,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = I2S_MCLK_OUT_IDX, .mck_in_sig = I2S_MCLK_IN_IDX, @@ -63,7 +63,7 @@ static const uint32_t i2s_regs_map[4] = {0x12330f, 0x0, 0x0, 0x0}; static const regdma_entries_config_t i2s0_regs_retention[] = I2S_SLEEP_RETENTION_ENTRIES(0); -const i2s_reg_retention_info_t i2s_reg_retention_info[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_reg_retention_info_t i2s_reg_retention_info[I2S_LL_GET(INST_NUM)] = { [0] = { .retention_module = SLEEP_RETENTION_MODULE_I2S0, .entry_array = i2s0_regs_retention, diff --git a/components/esp_hal_i2s/esp32h2/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32h2/include/hal/i2s_ll.h index 4332110f52..9961930525 100644 --- a/components/esp_hal_i2s/esp32h2/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32h2/include/hal/i2s_ll.h @@ -15,7 +15,6 @@ #include #include "hal/misc.h" #include "hal/assert.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/pcr_struct.h" #include "soc/soc_etm_source.h" @@ -23,6 +22,7 @@ #include "hal/hal_utils.h" #define I2S_LL_GET(_attr) I2S_LL_ ## _attr +#define I2S_LL_INST_NUM 1 #ifdef __cplusplus extern "C" { @@ -41,7 +41,7 @@ extern "C" { #define I2S_LL_SUPPORT_XTAL 1 // Support XTAL as I2S clock source #define I2S_LL_ETM_EVENT_TABLE(i2s_port, chan_dir, event) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_EVENT_DONE] = I2S_EVT_RX_DONE, \ [I2S_ETM_EVENT_REACH_THRESH] = I2S_EVT_X_WORDS_RECEIVED, \ @@ -52,7 +52,7 @@ extern "C" { }}}[i2s_port][(chan_dir) - 1][event] #define I2S_LL_ETM_TASK_TABLE(i2s_port, chan_dir, task) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_TASK_START] = I2S_TASK_START_RX, \ [I2S_ETM_TASK_STOP] = I2S_TASK_STOP_RX, \ diff --git a/components/esp_hal_i2s/esp32h4/i2s_periph.c b/components/esp_hal_i2s/esp32h4/i2s_periph.c index e233a25915..becab28d34 100644 --- a/components/esp_hal_i2s/esp32h4/i2s_periph.c +++ b/components/esp_hal_i2s/esp32h4/i2s_periph.c @@ -11,7 +11,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = I2S_MCLK_OUT_IDX, .mck_in_sig = I2S_MCLK_IN_IDX, @@ -68,7 +68,7 @@ static const uint32_t i2s_regs_map[4] = {0xf191b079, 0x0, 0x0, 0x0}; }; static const regdma_entries_config_t i2s0_regs_retention[] = I2S_SLEEP_RETENTION_ENTRIES(0); -const i2s_reg_retention_info_t i2s_reg_retention_info[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_reg_retention_info_t i2s_reg_retention_info[I2S_LL_GET(INST_NUM)] = { [0] = { .retention_module = SLEEP_RETENTION_MODULE_I2S0, .entry_array = i2s0_regs_retention, diff --git a/components/esp_hal_i2s/esp32h4/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32h4/include/hal/i2s_ll.h index 4a8885bd74..31be0af629 100644 --- a/components/esp_hal_i2s/esp32h4/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32h4/include/hal/i2s_ll.h @@ -15,7 +15,6 @@ #include #include "hal/misc.h" #include "hal/assert.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/pcr_struct.h" #include "soc/soc_etm_struct.h" @@ -24,6 +23,7 @@ #include "hal/hal_utils.h" #define I2S_LL_GET(_attr) I2S_LL_ ## _attr +#define I2S_LL_INST_NUM 1 #ifdef __cplusplus extern "C" { @@ -43,7 +43,7 @@ extern "C" { #define I2S_LL_SUPPORT_XTAL 1 // Support XTAL as I2S clock source #define I2S_LL_ETM_EVENT_TABLE(i2s_port, chan_dir, event) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_EVENT_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_EVENT_DONE] = I2S0_EVT_RX_DONE, \ [I2S_ETM_EVENT_REACH_THRESH] = I2S0_EVT_X_WORDS_RECEIVED, \ @@ -54,7 +54,7 @@ extern "C" { }}}[i2s_port][(chan_dir) - 1][event] #define I2S_LL_ETM_TASK_TABLE(i2s_port, chan_dir, task) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_TASK_MAX]){{ \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_TASK_START] = I2S0_TASK_START_RX, \ [I2S_ETM_TASK_STOP] = I2S0_TASK_STOP_RX, \ diff --git a/components/esp_hal_i2s/esp32p4/i2s_periph.c b/components/esp_hal_i2s/esp32p4/i2s_periph.c index cc371050e2..44a92cdc17 100644 --- a/components/esp_hal_i2s/esp32p4/i2s_periph.c +++ b/components/esp_hal_i2s/esp32p4/i2s_periph.c @@ -12,7 +12,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { [0] = { .mck_out_sig = I2S0_MCLK_PAD_OUT_IDX, .mck_in_sig = I2S0_MCLK_PAD_IN_IDX, @@ -143,7 +143,7 @@ static const regdma_entries_config_t i2s0_regs_retention[] = I2S_SLEEP_RETENTION static const regdma_entries_config_t i2s1_regs_retention[] = I2S_SLEEP_RETENTION_ENTRIES(1); static const regdma_entries_config_t i2s2_regs_retention[] = I2S_SLEEP_RETENTION_ENTRIES(2); -const i2s_reg_retention_info_t i2s_reg_retention_info[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_reg_retention_info_t i2s_reg_retention_info[I2S_LL_GET(INST_NUM)] = { [0] = { .retention_module = SLEEP_RETENTION_MODULE_I2S0, .entry_array = i2s0_regs_retention, diff --git a/components/esp_hal_i2s/esp32p4/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32p4/include/hal/i2s_ll.h index f1e85f8216..4e15350b55 100644 --- a/components/esp_hal_i2s/esp32p4/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32p4/include/hal/i2s_ll.h @@ -15,7 +15,6 @@ #include #include "hal/misc.h" #include "hal/assert.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/soc_etm_struct.h" #include "soc/hp_sys_clkrst_struct.h" @@ -26,6 +25,7 @@ #include "hal/config.h" #define I2S_LL_GET(_attr) I2S_LL_ ## _attr +#define I2S_LL_INST_NUM 3 #ifdef __cplusplus extern "C" { @@ -52,7 +52,7 @@ extern "C" { #define I2S_LL_SUPPORT_XTAL 1 // Support XTAL as I2S clock source #define I2S_LL_ETM_EVENT_TABLE(i2s_port, chan_dir, event) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_EVENT_MAX]){ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_EVENT_MAX]){ \ [0] = { \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_EVENT_DONE] = I2S0_EVT_RX_DONE, \ @@ -86,7 +86,7 @@ extern "C" { }[i2s_port][(chan_dir) - 1][event] #define I2S_LL_ETM_TASK_TABLE(i2s_port, chan_dir, task) \ - (uint32_t[SOC_I2S_ATTR(INST_NUM)][2][I2S_ETM_TASK_MAX]){ \ + (uint32_t[I2S_LL_GET(INST_NUM)][2][I2S_ETM_TASK_MAX]){ \ [0] = { \ [I2S_DIR_RX - 1] = { \ [I2S_ETM_TASK_START] = I2S0_TASK_START_RX, \ diff --git a/components/esp_hal_i2s/esp32s2/i2s_periph.c b/components/esp_hal_i2s/esp32s2/i2s_periph.c index cd81d81482..816cd60f01 100644 --- a/components/esp_hal_i2s/esp32s2/i2s_periph.c +++ b/components/esp_hal_i2s/esp32s2/i2s_periph.c @@ -10,7 +10,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = CLK_I2S_MUX_IDX, .mck_in_sig = -1, // Unavailable diff --git a/components/esp_hal_i2s/esp32s2/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32s2/include/hal/i2s_ll.h index 6129acd8ab..b0d59e662a 100644 --- a/components/esp_hal_i2s/esp32s2/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32s2/include/hal/i2s_ll.h @@ -16,7 +16,6 @@ #include #include "hal/misc.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/system_reg.h" #include "soc/dport_access.h" diff --git a/components/esp_hal_i2s/esp32s3/i2s_periph.c b/components/esp_hal_i2s/esp32s3/i2s_periph.c index a61467ee0e..0951f85c2d 100644 --- a/components/esp_hal_i2s/esp32s3/i2s_periph.c +++ b/components/esp_hal_i2s/esp32s3/i2s_periph.c @@ -10,7 +10,7 @@ /* Bunch of constants for every I2S peripheral: GPIO signals, irqs, hw addr of registers etc */ -const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)] = { +const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)] = { { .mck_out_sig = I2S0_MCLK_OUT_IDX, .mck_in_sig = I2S0_MCLK_IN_IDX, diff --git a/components/esp_hal_i2s/esp32s3/include/hal/i2s_ll.h b/components/esp_hal_i2s/esp32s3/include/hal/i2s_ll.h index a77a1d78f4..e29f3fcefe 100644 --- a/components/esp_hal_i2s/esp32s3/include/hal/i2s_ll.h +++ b/components/esp_hal_i2s/esp32s3/include/hal/i2s_ll.h @@ -15,13 +15,13 @@ #include #include "hal/misc.h" #include "hal/assert.h" -#include "hal/i2s_periph.h" #include "soc/i2s_struct.h" #include "soc/system_struct.h" #include "hal/i2s_types.h" #include "hal/hal_utils.h" #define I2S_LL_GET(_attr) I2S_LL_ ## _attr +#define I2S_LL_INST_NUM 2 #ifdef __cplusplus extern "C" { diff --git a/components/esp_hal_i2s/include/hal/i2s_periph.h b/components/esp_hal_i2s/include/hal/i2s_periph.h index f94770db9f..363d9eac4f 100644 --- a/components/esp_hal_i2s/include/hal/i2s_periph.h +++ b/components/esp_hal_i2s/include/hal/i2s_periph.h @@ -17,10 +17,9 @@ #if SOC_HAS(I2S) #include "soc/i2s_struct.h" #include "soc/i2s_reg.h" +#include "hal/i2s_ll.h" #endif -#define SOC_I2S_ATTR(_attr) SOC_MODULE_ATTR(I2S, _attr) - #ifdef __cplusplus extern "C" { #endif @@ -60,7 +59,7 @@ typedef struct { const uint8_t irq; } i2s_signal_conn_t; -extern const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_ATTR(INST_NUM)]; +extern const i2s_signal_conn_t i2s_periph_signal[I2S_LL_GET(INST_NUM)]; #if SOC_LP_I2S_SUPPORTED extern const i2s_signal_conn_t lp_i2s_periph_signal[SOC_LP_I2S_NUM]; @@ -73,7 +72,7 @@ typedef struct { uint32_t array_size; } i2s_reg_retention_info_t; -extern const i2s_reg_retention_info_t i2s_reg_retention_info[SOC_I2S_ATTR(INST_NUM)]; +extern const i2s_reg_retention_info_t i2s_reg_retention_info[I2S_LL_GET(INST_NUM)]; #endif // SOC_HAS(PAU) #endif // SOC_HAS(I2S) diff --git a/components/esp_hal_lcd/CMakeLists.txt b/components/esp_hal_lcd/CMakeLists.txt index ffe64cf79c..a6883b19d8 100644 --- a/components/esp_hal_lcd/CMakeLists.txt +++ b/components/esp_hal_lcd/CMakeLists.txt @@ -28,4 +28,5 @@ endif() idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${public_include} - REQUIRES soc hal esp_hal_i2s) + PRIV_REQUIRES esp_hal_i2s + REQUIRES soc hal) diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index ff25ad3ea0..505c210c82 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -79,7 +79,10 @@ if(NOT non_os_build) esp_timer esp_pm) - list(APPEND priv_requires esp_mm esp_hal_mspi) + list(APPEND priv_requires esp_mm + esp_hal_mspi + esp_hal_i2s # required by `sleep_system_peripheral.c` + ) if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2) list(APPEND srcs "rtc_wdt.c") diff --git a/components/esp_hw_support/sleep_system_peripheral.c b/components/esp_hw_support/sleep_system_peripheral.c index a9415214a2..31966f87f5 100644 --- a/components/esp_hw_support/sleep_system_peripheral.c +++ b/components/esp_hw_support/sleep_system_peripheral.c @@ -12,6 +12,9 @@ #include "soc/system_periph_retention.h" #include "soc/uart_periph.h" #include "hal/timer_ll.h" +#if SOC_HAS(I2S) +#include "hal/i2s_ll.h" +#endif #include "esp_sleep.h" #include "esp_log.h" @@ -239,12 +242,14 @@ bool peripheral_domain_pd_allowed(void) #if SOC_HAS(PAU) mask.bitmap[SLEEP_RETENTION_MODULE_I2S0 >> 5] |= BIT(SLEEP_RETENTION_MODULE_I2S0 % 32); -# if (SOC_MODULE_ATTR(I2S, INST_NUM) > 1) +#ifdef I2S_LL_GET +# if (I2S_LL_GET(INST_NUM) > 1) mask.bitmap[SLEEP_RETENTION_MODULE_I2S1 >> 5] |= BIT(SLEEP_RETENTION_MODULE_I2S1 % 32); # endif -# if (SOC_MODULE_ATTR(I2S, INST_NUM) > 2) +# if (I2S_LL_GET(INST_NUM) > 2) mask.bitmap[SLEEP_RETENTION_MODULE_I2S2 >> 5] |= BIT(SLEEP_RETENTION_MODULE_I2S2 % 32); # endif +#endif /* I2S_LL_GET */ #endif /* SOC_HAS(PAU) */ #if SOC_I2C_SUPPORT_SLEEP_RETENTION diff --git a/components/esp_system/CMakeLists.txt b/components/esp_system/CMakeLists.txt index e46225dbd0..428558f7b9 100644 --- a/components/esp_system/CMakeLists.txt +++ b/components/esp_system/CMakeLists.txt @@ -79,6 +79,7 @@ else() # [REFACTOR-TODO] Provide system hook to release dependency reversion. # IDF-13980 esp_hal_i2c + esp_hal_i2s esp_hal_wdt esp_hal_lcd esp_hal_mcpwm diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index 37dd53761e..56240fa513 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -3,7 +3,7 @@ idf_build_get_property(esp_tee_build ESP_TEE_BUILD) set(srcs "hal_utils.c") set(includes "platform_port/include") -set(requires soc esp_rom) +set(requires) if(${target} STREQUAL "esp32") # TODO: IDF-14079 remove this dependency when ADC hal is graduated from the common hal component diff --git a/components/hal/include/hal/i2s_hal.h b/components/hal/include/hal/i2s_hal.h index f67fb6fd21..fb4b2b9313 100644 --- a/components/hal/include/hal/i2s_hal.h +++ b/components/hal/include/hal/i2s_hal.h @@ -138,7 +138,7 @@ typedef struct { * @brief Init I2S hal context * * @param hal Context of the HAL layer - * @param port_id The I2S port number, the max port number is (SOC_I2S_ATTR(INST_NUM) -1) + * @param port_id The I2S port number, the max port number is (I2S_LL_GET(INST_NUM) -1) */ void i2s_hal_init(i2s_hal_context_t *hal, int port_id); diff --git a/components/soc/esp32/include/soc/soc_caps_full.h b/components/soc/esp32/include/soc/soc_caps_full.h index 07f93fc7cf..8e64cba1c7 100644 --- a/components/soc/esp32/include/soc/soc_caps_full.h +++ b/components/soc/esp32/include/soc/soc_caps_full.h @@ -9,9 +9,5 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 2 // Number of I2S instances - /*------------------------------- Touch Sensor ------------------------------------*/ #define _SOC_CAPS_TOUCH_CHAN_NUM 10 // Number of touch sensor channels diff --git a/components/soc/esp32c3/include/soc/soc_caps_full.h b/components/soc/esp32c3/include/soc/soc_caps_full.h index 218651f471..ca1d6414d9 100644 --- a/components/soc/esp32c3/include/soc/soc_caps_full.h +++ b/components/soc/esp32c3/include/soc/soc_caps_full.h @@ -8,7 +8,3 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" - -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 1 // Number of I2S instances diff --git a/components/soc/esp32c5/include/soc/soc_caps_full.h b/components/soc/esp32c5/include/soc/soc_caps_full.h index 218651f471..ca1d6414d9 100644 --- a/components/soc/esp32c5/include/soc/soc_caps_full.h +++ b/components/soc/esp32c5/include/soc/soc_caps_full.h @@ -8,7 +8,3 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" - -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 1 // Number of I2S instances diff --git a/components/soc/esp32c6/include/soc/soc_caps_full.h b/components/soc/esp32c6/include/soc/soc_caps_full.h index 218651f471..ca1d6414d9 100644 --- a/components/soc/esp32c6/include/soc/soc_caps_full.h +++ b/components/soc/esp32c6/include/soc/soc_caps_full.h @@ -8,7 +8,3 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" - -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 1 // Number of I2S instances diff --git a/components/soc/esp32c61/include/soc/soc_caps_full.h b/components/soc/esp32c61/include/soc/soc_caps_full.h index 7d2d31a999..ca1d6414d9 100644 --- a/components/soc/esp32c61/include/soc/soc_caps_full.h +++ b/components/soc/esp32c61/include/soc/soc_caps_full.h @@ -8,7 +8,3 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" - -/*--------------------------- I2S CAPS ----------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 1 // Number of I2S instances diff --git a/components/soc/esp32h2/include/soc/soc_caps_full.h b/components/soc/esp32h2/include/soc/soc_caps_full.h index 218651f471..ca1d6414d9 100644 --- a/components/soc/esp32h2/include/soc/soc_caps_full.h +++ b/components/soc/esp32h2/include/soc/soc_caps_full.h @@ -8,7 +8,3 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" - -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 1 // Number of I2S instances diff --git a/components/soc/esp32h21/include/soc/soc_caps_full.h b/components/soc/esp32h21/include/soc/soc_caps_full.h index be17586fdf..ca1d6414d9 100644 --- a/components/soc/esp32h21/include/soc/soc_caps_full.h +++ b/components/soc/esp32h21/include/soc/soc_caps_full.h @@ -8,7 +8,3 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" - -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -// #define _SOC_CAPS_I2S_INST_NUM 1 // Number of I2S instances diff --git a/components/soc/esp32h4/include/soc/soc_caps_full.h b/components/soc/esp32h4/include/soc/soc_caps_full.h index 218651f471..ca1d6414d9 100644 --- a/components/soc/esp32h4/include/soc/soc_caps_full.h +++ b/components/soc/esp32h4/include/soc/soc_caps_full.h @@ -8,7 +8,3 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" - -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 1 // Number of I2S instances diff --git a/components/soc/esp32p4/include/soc/soc_caps_full.h b/components/soc/esp32p4/include/soc/soc_caps_full.h index 85a101a5b3..655b764904 100644 --- a/components/soc/esp32p4/include/soc/soc_caps_full.h +++ b/components/soc/esp32p4/include/soc/soc_caps_full.h @@ -9,9 +9,5 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 3 // Number of I2S instances - /*------------------------------- Touch Sensor ------------------------------------*/ #define _SOC_CAPS_TOUCH_CHAN_NUM 14 // Number of touch sensor channels diff --git a/components/soc/esp32s2/include/soc/soc_caps_full.h b/components/soc/esp32s2/include/soc/soc_caps_full.h index def8b48e42..1cedce872c 100644 --- a/components/soc/esp32s2/include/soc/soc_caps_full.h +++ b/components/soc/esp32s2/include/soc/soc_caps_full.h @@ -9,9 +9,5 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 1 // Number of I2S instances - /*------------------------------- Touch Sensor ------------------------------------*/ #define _SOC_CAPS_TOUCH_CHAN_NUM 15 // Number of touch sensor channels diff --git a/components/soc/esp32s3/include/soc/soc_caps_full.h b/components/soc/esp32s3/include/soc/soc_caps_full.h index 4eb5f4edf2..1cedce872c 100644 --- a/components/soc/esp32s3/include/soc/soc_caps_full.h +++ b/components/soc/esp32s3/include/soc/soc_caps_full.h @@ -9,9 +9,5 @@ #include "soc/soc_caps.h" #include "soc/soc_caps_eval.h" -/*------------------------------- I2S ---------------------------------------*/ -// helper macros to access module attributes -#define _SOC_CAPS_I2S_INST_NUM 2 // Number of I2S instances - /*------------------------------- Touch Sensor ------------------------------------*/ #define _SOC_CAPS_TOUCH_CHAN_NUM 15 // Number of touch sensor channels diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index 3760dd1222..05e2081478 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -169,7 +169,6 @@ INPUT = \ $(PROJECT_PATH)/components/esp_hal_timg/include/hal/timer_types.h \ $(PROJECT_PATH)/components/esp_hal_i2c/include/hal/i2c_types.h \ $(PROJECT_PATH)/components/esp_hal_i2s/include/hal/i2s_types.h \ - $(PROJECT_PATH)/components/esp_hal_jpeg/include/hal/jpeg_types.h \ $(PROJECT_PATH)/components/esp_hal_lcd/include/hal/lcd_types.h \ $(PROJECT_PATH)/components/esp_hal_mspi/include/hal/esp_flash_err.h \ $(PROJECT_PATH)/components/esp_hal_mspi/include/hal/spi_flash_types.h \