diff --git a/Kconfig b/Kconfig index 0ab2e745ee..97d90667e4 100644 --- a/Kconfig +++ b/Kconfig @@ -445,22 +445,3 @@ mainmenu "Espressif IoT Development Framework Configuration" menu "Component config" source "$COMPONENT_KCONFIGS_SOURCE_FILE" endmenu - - menu "Compatibility options" - config LEGACY_INCLUDE_COMMON_HEADERS - bool "Include headers across components as before IDF v4.0" - default n - help - Soc, esp32, and driver components, the most common - components. Some header of these components are included - implicitly by headers of other components before IDF v4.0. - It's not required for high-level components, but still - included through long header chain everywhere. - - This is harmful to the modularity. So it's changed in IDF - v4.0. - - You can still include these headers in a legacy way until it - is totally deprecated by enable this option. - - endmenu #Compatibility options diff --git a/components/bootloader/project_include.cmake b/components/bootloader/project_include.cmake index 2fd12e1dc2..8e52084d53 100644 --- a/components/bootloader/project_include.cmake +++ b/components/bootloader/project_include.cmake @@ -119,10 +119,6 @@ externalproject_add(bootloader -DEXTRA_COMPONENT_DIRS=${CMAKE_CURRENT_LIST_DIR} -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} ${sign_key_arg} ${ver_key_arg} - # LEGACY_INCLUDE_COMMON_HEADERS has to be passed in via cache variable since - # the bootloader common component requirements depends on this and - # config variables are not available before project() call. - -DLEGACY_INCLUDE_COMMON_HEADERS=${CONFIG_LEGACY_INCLUDE_COMMON_HEADERS} ${extra_cmake_args} INSTALL_COMMAND "" BUILD_ALWAYS 1 # no easy way around this... diff --git a/components/bootloader/subproject/CMakeLists.txt b/components/bootloader/subproject/CMakeLists.txt index f805f93eb9..0c542ee164 100644 --- a/components/bootloader/subproject/CMakeLists.txt +++ b/components/bootloader/subproject/CMakeLists.txt @@ -52,10 +52,7 @@ endforeach() set(BOOTLOADER_BUILD 1) include("${IDF_PATH}/tools/cmake/project.cmake") -set(common_req log esp_rom esp_common esp_hw_support hal newlib) -if(LEGACY_INCLUDE_COMMON_HEADERS) - list(APPEND common_req soc hal) -endif() +set(common_req log esp_rom esp_common esp_hw_support newlib) idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${common_req}") idf_build_set_property(__OUTPUT_SDKCONFIG 0) project(bootloader) diff --git a/components/driver/include/driver/gpio.h b/components/driver/include/driver/gpio.h index 97e949486a..b03c89e5c5 100644 --- a/components/driver/include/driver/gpio.h +++ b/components/driver/include/driver/gpio.h @@ -1,47 +1,22 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include "sdkconfig.h" #include "esp_err.h" -#include #include "esp_intr_alloc.h" #if !CONFIG_IDF_TARGET_LINUX -#include -#include #include "esp_attr.h" +#include "esp_types.h" #include "soc/soc_caps.h" -#include "soc/gpio_periph.h" #endif // !CONFIG_IDF_TARGET_LINUX #include "hal/gpio_types.h" - -// |================================= WARNING ====================================================== | -// | Including ROM header file in a PUBLIC API file will be REMOVED in the next major release (5.x). | -// | User should include "esp_rom_gpio.h" in their code if they have to use those ROM API. | -// |================================================================================================ | -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/rom/gpio.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/rom/gpio.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/rom/gpio.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/rom/gpio.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/rom/gpio.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/rom/gpio.h" -#elif CONFIG_IDF_TARGET_ESP8684 -#include "esp8684/rom/gpio.h" -#endif - -#ifdef CONFIG_LEGACY_INCLUDE_COMMON_HEADERS -#include "soc/rtc_io_reg.h" -#endif +#include "esp_rom_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/components/driver/include/driver/i2s.h b/components/driver/include/driver/i2s.h index 1de790bdba..81ac4f2aea 100644 --- a/components/driver/include/driver/i2s.h +++ b/components/driver/include/driver/i2s.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,8 +10,6 @@ #include "esp_err.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" -#include "soc/i2s_periph.h" -#include "soc/rtc_periph.h" #include "soc/soc_caps.h" #include "hal/i2s_types.h" #include "esp_intr_alloc.h" diff --git a/components/driver/include/driver/ledc.h b/components/driver/include/driver/ledc.h index 89aeab25de..e70f6e25d7 100644 --- a/components/driver/include/driver/ledc.h +++ b/components/driver/include/driver/ledc.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,7 +8,6 @@ #include "esp_err.h" #include "esp_intr_alloc.h" -#include "soc/soc.h" #include "hal/ledc_types.h" #include "driver/gpio.h" diff --git a/components/driver/include/driver/mcpwm.h b/components/driver/include/driver/mcpwm.h index 2a4e825f77..aa435a71a3 100644 --- a/components/driver/include/driver/mcpwm.h +++ b/components/driver/include/driver/mcpwm.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -9,7 +9,6 @@ #include "soc/soc_caps.h" #if SOC_MCPWM_SUPPORTED #include "esp_err.h" -#include "soc/soc.h" #include "driver/gpio.h" #include "esp_intr_alloc.h" #include "hal/mcpwm_types.h" diff --git a/components/driver/include/driver/rtc_io.h b/components/driver/include/driver/rtc_io.h index cbf32c4fc0..ffa51d5846 100644 --- a/components/driver/include/driver/rtc_io.h +++ b/components/driver/include/driver/rtc_io.h @@ -1,16 +1,15 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ -#ifndef _DRIVER_RTC_GPIO_H_ -#define _DRIVER_RTC_GPIO_H_ +#pragma once #include +#include #include "esp_err.h" #include "soc/soc_caps.h" -#include "soc/rtc_io_periph.h" #include "hal/rtc_io_types.h" #include "driver/gpio.h" @@ -25,14 +24,7 @@ extern "C" { * @param gpio_num GPIO number * @return true if GPIO is valid for RTC GPIO use. false otherwise. */ -static inline bool rtc_gpio_is_valid_gpio(gpio_num_t gpio_num) -{ -#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED - return (gpio_num < GPIO_PIN_COUNT && rtc_io_num_map[gpio_num] >= 0); -#else - return false; -#endif -} +bool rtc_gpio_is_valid_gpio(gpio_num_t gpio_num); #define RTC_GPIO_IS_VALID_GPIO(gpio_num) rtc_gpio_is_valid_gpio(gpio_num) // Deprecated, use rtc_gpio_is_valid_gpio() @@ -45,10 +37,7 @@ static inline bool rtc_gpio_is_valid_gpio(gpio_num_t gpio_num) * >=0: Index of rtcio. * -1 : The gpio is not rtcio. */ -static inline int rtc_io_number_get(gpio_num_t gpio_num) -{ - return rtc_io_num_map[gpio_num]; -} +int rtc_io_number_get(gpio_num_t gpio_num); /** * @brief Init a GPIO as RTC GPIO @@ -306,5 +295,3 @@ esp_err_t rtc_gpio_wakeup_disable(gpio_num_t gpio_num); #ifdef __cplusplus } #endif - -#endif diff --git a/components/driver/include/driver/sdio_slave.h b/components/driver/include/driver/sdio_slave.h index e124b5cc86..f9ec3f9c72 100644 --- a/components/driver/include/driver/sdio_slave.h +++ b/components/driver/include/driver/sdio_slave.h @@ -1,17 +1,14 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once -#include "freertos/FreeRTOS.h" #include "esp_err.h" -#include "sys/queue.h" - +#include "freertos/FreeRTOS.h" // for TickType_t #include "hal/sdio_slave_types.h" -#include "soc/sdio_slave_periph.h" #ifdef __cplusplus extern "C" { diff --git a/components/driver/include/driver/sigmadelta.h b/components/driver/include/driver/sigmadelta.h index 17f86b308e..7f7c715953 100644 --- a/components/driver/include/driver/sigmadelta.h +++ b/components/driver/include/driver/sigmadelta.h @@ -1,14 +1,12 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once -#include -#include "soc/soc_caps.h" -#include "soc/sigmadelta_periph.h" +#include "esp_types.h" #include "driver/gpio.h" #include "hal/sigmadelta_types.h" @@ -16,6 +14,16 @@ extern "C" { #endif +/** + * @brief Sigma-delta configure struct + */ +typedef struct { + sigmadelta_channel_t channel; /*!< Sigma-delta channel number */ + int8_t sigmadelta_duty; /*!< Sigma-delta duty, duty ranges from -128 to 127. */ + uint8_t sigmadelta_prescale; /*!< Sigma-delta prescale, prescale ranges from 0 to 255. */ + uint8_t sigmadelta_gpio; /*!< Sigma-delta output io number, refer to gpio.h for more details. */ +} sigmadelta_config_t; + /** * @brief Configure Sigma-delta channel * diff --git a/components/driver/include/driver/spi_common.h b/components/driver/include/driver/spi_common.h index 830b8efd8c..516e94d790 100644 --- a/components/driver/include/driver/spi_common.h +++ b/components/driver/include/driver/spi_common.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,13 +8,9 @@ #include #include -#include "esp_err.h" -#ifndef SPI_MOCK -#include "soc/lldesc.h" -#include "soc/spi_periph.h" -#endif -#include "hal/spi_types.h" #include "sdkconfig.h" +#include "esp_err.h" +#include "hal/spi_types.h" #ifdef __cplusplus extern "C" diff --git a/components/driver/include/driver/spi_common_internal.h b/components/driver/include/driver/spi_common_internal.h index 0704c7ddd8..baa12ad06d 100644 --- a/components/driver/include/driver/spi_common_internal.h +++ b/components/driver/include/driver/spi_common_internal.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -52,6 +52,8 @@ typedef struct spi_bus_lock_dev_t* spi_bus_lock_dev_handle_t; /// Background operation control function typedef void (*bg_ctrl_func_t)(void*); +typedef struct lldesc_s lldesc_t; + /// Attributes of an SPI bus typedef struct { spi_bus_config_t bus_cfg; ///< Config used to initialize the bus diff --git a/components/driver/include/driver/timer.h b/components/driver/include/driver/timer.h index d2290c27f2..61cdcd2c50 100644 --- a/components/driver/include/driver/timer.h +++ b/components/driver/include/driver/timer.h @@ -1,16 +1,15 @@ /* - * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include "esp_err.h" #include "esp_attr.h" -#include "soc/soc.h" #include "soc/soc_caps.h" -#include "soc/timer_periph.h" #include "esp_intr_alloc.h" #include "hal/timer_types.h" diff --git a/components/driver/rtc_io.c b/components/driver/rtc_io.c index 84515814a2..0920b0e729 100644 --- a/components/driver/rtc_io.c +++ b/components/driver/rtc_io.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -13,6 +13,7 @@ #include "freertos/timers.h" #include "driver/rtc_io.h" #include "hal/rtc_io_hal.h" +#include "soc/soc_caps.h" static const char __attribute__((__unused__)) *RTCIO_TAG = "RTCIO"; @@ -220,3 +221,20 @@ esp_err_t rtc_gpio_wakeup_disable(gpio_num_t gpio_num) } #endif // SOC_RTCIO_WAKE_SUPPORTED + +bool rtc_gpio_is_valid_gpio(gpio_num_t gpio_num) +{ +#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED + return (gpio_num < GPIO_PIN_COUNT && rtc_io_num_map[gpio_num] >= 0); +#else + return false; +#endif +} + +#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED +int rtc_io_number_get(gpio_num_t gpio_num) +{ + return rtc_io_num_map[gpio_num]; +} + +#endif // SOC_RTCIO_INPUT_OUTPUT_SUPPORTED diff --git a/components/driver/test/test_sdio.c b/components/driver/test/test_sdio.c index 49c6ae6ddb..a807645745 100644 --- a/components/driver/test/test_sdio.c +++ b/components/driver/test/test_sdio.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -17,6 +17,7 @@ #if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S3) #if SOC_SDMMC_HOST_SUPPORTED && SOC_SDIO_SLAVE_SUPPORTED +#include "soc/sdio_slave_pins.h" #include "driver/sdio_slave.h" #include "driver/sdmmc_host.h" diff --git a/components/driver/test/test_timer.c b/components/driver/test/test_timer.c index c1eaeee4a9..08598fee92 100644 --- a/components/driver/test/test_timer.c +++ b/components/driver/test/test_timer.c @@ -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 */ @@ -542,7 +542,7 @@ TEST_CASE("Timer divider", "[hw_timer]") vTaskDelay(1000 / portTICK_PERIOD_MS); all_timer_get_counter_value(set_timer_val, false, comp_time_val); for (int i = 0; i < TIMER_GROUP_MAX * TIMER_MAX; i++) { - TEST_ASSERT_INT_WITHIN(5000, APB_CLK_FREQ / 2, comp_time_val[i]); + TEST_ASSERT_INT_WITHIN(10000, APB_CLK_FREQ / 2, comp_time_val[i]); } all_timer_pause(); diff --git a/components/driver/twai.c b/components/driver/twai.c index 1e4f3ae1c3..74e6c796d2 100644 --- a/components/driver/twai.c +++ b/components/driver/twai.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -21,6 +21,7 @@ #include "driver/twai.h" #include "soc/soc_caps.h" #include "soc/twai_periph.h" +#include "soc/gpio_sig_map.h" #include "hal/twai_hal.h" #include "esp_rom_gpio.h" diff --git a/components/esp_hw_support/port/esp32s2/spiram_psram.c b/components/esp_hw_support/port/esp32s2/spiram_psram.c index 886e08b045..2b2c345478 100644 --- a/components/esp_hw_support/port/esp32s2/spiram_psram.c +++ b/components/esp_hw_support/port/esp32s2/spiram_psram.c @@ -3,7 +3,7 @@ */ /* - * SPDX-FileCopyrightText: 2013-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2013-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -24,6 +24,7 @@ #include "soc/dport_reg.h" #include "soc/efuse_periph.h" #include "soc/soc_caps.h" +#include "soc/spi_reg.h" #include "soc/io_mux_reg.h" #include "soc/syscon_reg.h" #include "soc/efuse_reg.h" diff --git a/components/esp_hw_support/port/esp32s3/opiram_psram.c b/components/esp_hw_support/port/esp32s3/opiram_psram.c index efcecdbc6b..1f05a386de 100644 --- a/components/esp_hw_support/port/esp32s3/opiram_psram.c +++ b/components/esp_hw_support/port/esp32s3/opiram_psram.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -16,6 +16,7 @@ #include "esp32s3/rom/opi_flash.h" #include "esp32s3/rom/gpio.h" #include "esp32s3/rom/cache.h" +#include "soc/gpio_periph.h" #include "soc/io_mux_reg.h" #include "soc/dport_reg.h" #include "soc/syscon_reg.h" diff --git a/components/esp_lcd/src/esp_lcd_panel_io_i80.c b/components/esp_lcd/src/esp_lcd_panel_io_i80.c index 6cd03c56a3..bc8c3b0fc2 100644 --- a/components/esp_lcd/src/esp_lcd_panel_io_i80.c +++ b/components/esp_lcd/src/esp_lcd_panel_io_i80.c @@ -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 */ @@ -23,6 +23,7 @@ #include "esp_lcd_panel_io.h" #include "esp_rom_gpio.h" #include "soc/soc_caps.h" +#include "soc/rtc.h" // for `rtc_clk_xtal_freq_get()` #include "hal/dma_types.h" #include "hal/gpio_hal.h" #include "esp_private/gdma.h" diff --git a/components/esp_pm/include/esp32/pm.h b/components/esp_pm/include/esp32/pm.h index 8c3682cc7e..4933345f09 100644 --- a/components/esp_pm/include/esp32/pm.h +++ b/components/esp_pm/include/esp32/pm.h @@ -1,30 +1,18 @@ -// Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include #include -#include "esp_err.h" - -#include "soc/rtc.h" #ifdef __cplusplus extern "C" { #endif - /** * @brief Power management config for ESP32 * diff --git a/components/esp_pm/include/esp32c3/pm.h b/components/esp_pm/include/esp32c3/pm.h index 7ceecd12c1..e2d125d89a 100644 --- a/components/esp_pm/include/esp32c3/pm.h +++ b/components/esp_pm/include/esp32c3/pm.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,8 +10,6 @@ #include #include "esp_err.h" -#include "soc/rtc.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_pm/include/esp32h2/pm.h b/components/esp_pm/include/esp32h2/pm.h index ce09d8a2b6..89af67ac8f 100644 --- a/components/esp_pm/include/esp32h2/pm.h +++ b/components/esp_pm/include/esp32h2/pm.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,8 +10,6 @@ #include #include "esp_err.h" -#include "soc/rtc.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_pm/include/esp32s2/pm.h b/components/esp_pm/include/esp32s2/pm.h index dac31e0c9c..8036326ff9 100644 --- a/components/esp_pm/include/esp32s2/pm.h +++ b/components/esp_pm/include/esp32s2/pm.h @@ -1,16 +1,8 @@ -// Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,8 +10,6 @@ #include #include "esp_err.h" -#include "soc/rtc.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_pm/include/esp32s3/pm.h b/components/esp_pm/include/esp32s3/pm.h index 0b29c66aba..51ec7aafb2 100644 --- a/components/esp_pm/include/esp32s3/pm.h +++ b/components/esp_pm/include/esp32s3/pm.h @@ -1,16 +1,8 @@ -// Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,8 +10,6 @@ #include #include "esp_err.h" -#include "soc/rtc.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_pm/include/esp8684/pm.h b/components/esp_pm/include/esp8684/pm.h index 1f3757c2c1..a671e5599a 100644 --- a/components/esp_pm/include/esp8684/pm.h +++ b/components/esp_pm/include/esp8684/pm.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,8 +10,6 @@ #include #include "esp_err.h" -#include "soc/rtc.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_pm/pm_trace.c b/components/esp_pm/pm_trace.c index f3b2d10e22..3100a257ca 100644 --- a/components/esp_pm/pm_trace.c +++ b/components/esp_pm/pm_trace.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -7,6 +7,8 @@ #include "esp_private/pm_trace.h" #include "driver/gpio.h" +#include "soc/soc.h" +#include "soc/gpio_reg.h" /* GPIOs to use for tracing of esp_pm events. * Two entries in the array for each type, one for each CPU. @@ -14,25 +16,25 @@ */ static const int DRAM_ATTR s_trace_io[] = { #if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP8684) - BIT(4), BIT(5), // ESP_PM_TRACE_IDLE - BIT(16), BIT(17), // ESP_PM_TRACE_TICK - BIT(18), BIT(18), // ESP_PM_TRACE_FREQ_SWITCH - BIT(19), BIT(19), // ESP_PM_TRACE_CCOMPARE_UPDATE - BIT(25), BIT(26), // ESP_PM_TRACE_ISR_HOOK - BIT(27), BIT(27), // ESP_PM_TRACE_SLEEP + BIT(4), BIT(5), // ESP_PM_TRACE_IDLE + BIT(16), BIT(17), // ESP_PM_TRACE_TICK + BIT(18), BIT(18), // ESP_PM_TRACE_FREQ_SWITCH + BIT(19), BIT(19), // ESP_PM_TRACE_CCOMPARE_UPDATE + BIT(25), BIT(26), // ESP_PM_TRACE_ISR_HOOK + BIT(27), BIT(27), // ESP_PM_TRACE_SLEEP #else - BIT(2), BIT(3), // ESP_PM_TRACE_IDLE - BIT(4), BIT(5), // ESP_PM_TRACE_TICK - BIT(6), BIT(6), // ESP_PM_TRACE_FREQ_SWITCH - BIT(7), BIT(7), // ESP_PM_TRACE_CCOMPARE_UPDATE - BIT(8), BIT(9), // ESP_PM_TRACE_ISR_HOOK - BIT(18), BIT(18), // ESP_PM_TRACE_SLEEP + BIT(2), BIT(3), // ESP_PM_TRACE_IDLE + BIT(4), BIT(5), // ESP_PM_TRACE_TICK + BIT(6), BIT(6), // ESP_PM_TRACE_FREQ_SWITCH + BIT(7), BIT(7), // ESP_PM_TRACE_CCOMPARE_UPDATE + BIT(8), BIT(9), // ESP_PM_TRACE_ISR_HOOK + BIT(18), BIT(18), // ESP_PM_TRACE_SLEEP #endif }; void esp_pm_trace_init(void) { - for (size_t i = 0; i < sizeof(s_trace_io)/sizeof(s_trace_io[0]); ++i) { + for (size_t i = 0; i < sizeof(s_trace_io) / sizeof(s_trace_io[0]); ++i) { int io = __builtin_ffs(s_trace_io[i]); if (io == 0) { continue; diff --git a/components/esp_pm/test/test_pm.c b/components/esp_pm/test/test_pm.c index fd9774b334..2d7b58d57a 100644 --- a/components/esp_pm/test/test_pm.c +++ b/components/esp_pm/test/test_pm.c @@ -12,6 +12,7 @@ #include "esp_log.h" #include "driver/timer.h" #include "driver/rtc_io.h" +#include "soc/rtc.h" #include "soc/rtc_periph.h" #include "esp_rom_sys.h" #include "esp_private/esp_clk.h" diff --git a/components/esp_rom/include/esp32/rom/ets_sys.h b/components/esp_rom/include/esp32/rom/ets_sys.h index 3485f0d406..3760c84f65 100644 --- a/components/esp_rom/include/esp32/rom/ets_sys.h +++ b/components/esp_rom/include/esp32/rom/ets_sys.h @@ -1,16 +1,8 @@ -// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ROM_ETS_SYS_H_ #define _ROM_ETS_SYS_H_ @@ -21,10 +13,6 @@ #include "sdkconfig.h" -#ifdef CONFIG_LEGACY_INCLUDE_COMMON_HEADERS -#include "soc/soc.h" -#endif - #ifndef CONFIG_IDF_TARGET_ESP32 #error "This header should only be included when building for ESP32" #endif diff --git a/components/esp_rom/include/esp32/rom/gpio.h b/components/esp_rom/include/esp32/rom/gpio.h index ef6e3c512a..d018ecbf00 100644 --- a/components/esp_rom/include/esp32/rom/gpio.h +++ b/components/esp_rom/include/esp32/rom/gpio.h @@ -1,32 +1,17 @@ -// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ROM_GPIO_H_ #define _ROM_GPIO_H_ #include #include - #include "esp_attr.h" - #include "sdkconfig.h" -#ifdef CONFIG_LEGACY_INCLUDE_COMMON_HEADERS -#include "soc/gpio_reg.h" -#include "soc/soc_caps.h" -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_rom/include/esp32/rom/spi_flash.h b/components/esp_rom/include/esp32/rom/spi_flash.h index 2192ca2417..a492c055bc 100644 --- a/components/esp_rom/include/esp32/rom/spi_flash.h +++ b/components/esp_rom/include/esp32/rom/spi_flash.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,10 +12,6 @@ #include "sdkconfig.h" #include "esp_rom_spiflash.h" -#ifdef CONFIG_LEGACY_INCLUDE_COMMON_HEADERS -#include "soc/spi_reg.h" -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/components/freemodbus/common/include/esp_modbus_master.h b/components/freemodbus/common/include/esp_modbus_master.h index 433e143c0f..9f4bd4735a 100644 --- a/components/freemodbus/common/include/esp_modbus_master.h +++ b/components/freemodbus/common/include/esp_modbus_master.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -9,7 +9,6 @@ #include // for standard int types definition #include // for NULL and std defines -#include "soc/soc.h" // for BITN definitions #include "esp_modbus_common.h" // for common types #ifdef __cplusplus diff --git a/components/freemodbus/common/include/esp_modbus_slave.h b/components/freemodbus/common/include/esp_modbus_slave.h index 13fd456928..8e958c4fd9 100644 --- a/components/freemodbus/common/include/esp_modbus_slave.h +++ b/components/freemodbus/common/include/esp_modbus_slave.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ // Public interface header for slave #include // for standard int types definition #include // for NULL and std defines -#include "soc/soc.h" // for BITN definitions #include "freertos/FreeRTOS.h" // for task creation and queues access #include "freertos/event_groups.h" // for event groups #include "esp_modbus_common.h" // for common types diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h index 5c903ccfd9..a6bcaf5234 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h @@ -47,9 +47,6 @@ /* [refactor-todo] These includes are not directly used in this file. They are kept into to prevent a breaking change. Remove these. */ #include -#ifdef CONFIG_LEGACY_INCLUDE_COMMON_HEADERS -#include "soc/soc_memory_layout.h" -#endif #ifdef __cplusplus extern "C" { diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h index 68fc125e4b..00a4b59b83 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h @@ -54,9 +54,6 @@ #include #include #include -#ifdef CONFIG_LEGACY_INCLUDE_COMMON_HEADERS -#include "soc/soc_memory_layout.h" -#endif #ifdef __cplusplus extern "C" { diff --git a/components/hal/include/hal/gpio_hal.h b/components/hal/include/hal/gpio_hal.h index 018b4be128..f31a355cbe 100644 --- a/components/hal/include/hal/gpio_hal.h +++ b/components/hal/include/hal/gpio_hal.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /******************************************************************************* * NOTICE @@ -27,10 +19,6 @@ #include "hal/gpio_ll.h" #include "hal/gpio_types.h" -#ifdef CONFIG_LEGACY_INCLUDE_COMMON_HEADERS -#include "soc/rtc_io_reg.h" -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/components/hal/include/hal/gpio_types.h b/components/hal/include/hal/gpio_types.h index 827132c24e..09abb739b5 100644 --- a/components/hal/include/hal/gpio_types.h +++ b/components/hal/include/hal/gpio_types.h @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once -#include "soc/gpio_periph.h" +#include "sdkconfig.h" #include "soc/soc_caps.h" +#include "esp_bit_defs.h" #ifdef __cplusplus extern "C" { diff --git a/components/hal/include/hal/rtc_hal.h b/components/hal/include/hal/rtc_hal.h index 602f0737ac..14c99b054a 100644 --- a/components/hal/include/hal/rtc_hal.h +++ b/components/hal/include/hal/rtc_hal.h @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include "soc/soc_caps.h" #include "hal/gpio_types.h" #include "hal/rtc_cntl_ll.h" diff --git a/components/hal/include/hal/sdio_slave_types.h b/components/hal/include/hal/sdio_slave_types.h index 60e08456fc..dc48dbeb66 100644 --- a/components/hal/include/hal/sdio_slave_types.h +++ b/components/hal/include/hal/sdio_slave_types.h @@ -1,20 +1,12 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once -#include "soc/soc.h" +#include "esp_bit_defs.h" /// Mask of interrupts sending to the host. typedef enum { diff --git a/components/hal/include/hal/sigmadelta_types.h b/components/hal/include/hal/sigmadelta_types.h index 81023905d6..646729258c 100644 --- a/components/hal/include/hal/sigmadelta_types.h +++ b/components/hal/include/hal/sigmadelta_types.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -47,16 +39,6 @@ typedef enum { SIGMADELTA_CHANNEL_MAX, /*!< Sigma-delta channel max */ } sigmadelta_channel_t; -/** - * @brief Sigma-delta configure struct - */ -typedef struct { - sigmadelta_channel_t channel; /*!< Sigma-delta channel number */ - int8_t sigmadelta_duty; /*!< Sigma-delta duty, duty ranges from -128 to 127. */ - uint8_t sigmadelta_prescale; /*!< Sigma-delta prescale, prescale ranges from 0 to 255. */ - uint8_t sigmadelta_gpio; /*!< Sigma-delta output io number, refer to gpio.h for more details. */ -} sigmadelta_config_t; - #ifdef __cplusplus } #endif diff --git a/components/hal/include/hal/touch_sensor_types.h b/components/hal/include/hal/touch_sensor_types.h index 9085f5eecd..868e79118f 100644 --- a/components/hal/include/hal/touch_sensor_types.h +++ b/components/hal/include/hal/touch_sensor_types.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -7,10 +7,10 @@ #pragma once #include -#include "esp_attr.h" -#include "soc/soc.h" -#include "soc/soc_caps.h" #include "sdkconfig.h" +#include "esp_attr.h" +#include "esp_bit_defs.h" +#include "soc/soc_caps.h" /** Touch pad channel */ typedef enum { diff --git a/components/heap/include/esp_heap_caps_init.h b/components/heap/include/esp_heap_caps_init.h index 74e8cb9016..50aab38493 100644 --- a/components/heap/include/esp_heap_caps_init.h +++ b/components/heap/include/esp_heap_caps_init.h @@ -1,21 +1,12 @@ -// Copyright 2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_err.h" #include "esp_heap_caps.h" -#include "soc/soc_memory_layout.h" #ifdef __cplusplus extern "C" { diff --git a/components/heap/test/test_runtime_heap_reg.c b/components/heap/test/test_runtime_heap_reg.c index 92e81d8fdc..305177bcd5 100644 --- a/components/heap/test/test_runtime_heap_reg.c +++ b/components/heap/test/test_runtime_heap_reg.c @@ -3,10 +3,11 @@ */ #include +#include #include "unity.h" #include "esp_heap_caps_init.h" #include "esp_system.h" -#include +#include "heap_memory_layout.h" /* NOTE: This is not a well-formed unit test, it leaks memory */ diff --git a/components/log/CMakeLists.txt b/components/log/CMakeLists.txt index b57770a234..ff293315f2 100644 --- a/components/log/CMakeLists.txt +++ b/components/log/CMakeLists.txt @@ -7,7 +7,7 @@ if(${target} STREQUAL "linux") list(APPEND srcs "log_linux.c") else() list(APPEND srcs "log_buffers.c") - list(APPEND priv_requires soc) + list(APPEND priv_requires soc hal) endif() idf_component_register(SRCS ${srcs} diff --git a/components/sdmmc/test/test_sd.c b/components/sdmmc/test/test_sd.c index 3a47b9b0a8..ca3f6934d7 100644 --- a/components/sdmmc/test/test_sd.c +++ b/components/sdmmc/test/test_sd.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -24,6 +24,8 @@ #include "esp_heap_caps.h" #include "esp_rom_gpio.h" #include "test_utils.h" +#include "soc/gpio_sig_map.h" +#include "soc/gpio_reg.h" // Currently no runners for S3 #define WITH_SD_TEST (SOC_SDMMC_HOST_SUPPORTED && !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S3)) diff --git a/components/sdmmc/test/test_sdio.c b/components/sdmmc/test/test_sdio.c index ecafb1639c..a71d1f440a 100644 --- a/components/sdmmc/test/test_sdio.c +++ b/components/sdmmc/test/test_sdio.c @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "soc/soc_caps.h" #if SOC_SDMMC_HOST_SUPPORTED @@ -27,6 +19,7 @@ #include "driver/sdmmc_defs.h" #include "sdmmc_cmd.h" #include "unity.h" +#include "soc/gpio_reg.h" /* Second ESP32 board attached as follows: * Master Slave diff --git a/components/tinyusb/additions/src/tinyusb.c b/components/tinyusb/additions/src/tinyusb.c index 72b1b612fc..c5186eb392 100644 --- a/components/tinyusb/additions/src/tinyusb.c +++ b/components/tinyusb/additions/src/tinyusb.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -14,6 +14,7 @@ #include "hal/usb_hal.h" #include "soc/gpio_periph.h" #include "soc/usb_periph.h" +#include "soc/gpio_pins.h" #include "tinyusb.h" #include "descriptors_control.h" #include "tusb.h" @@ -34,7 +35,7 @@ static void configure_pins(usb_hal_context_t *usb) esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false); } else { esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false); - if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH)) { + if ((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT)) { gpio_ll_input_enable(&GPIO, iopin->pin); } } diff --git a/components/ulp/include/esp32/ulp.h b/components/ulp/include/esp32/ulp.h index e5d673a23c..764dd1102e 100644 --- a/components/ulp/include/esp32/ulp.h +++ b/components/ulp/include/esp32/ulp.h @@ -1,24 +1,16 @@ -// Copyright 2016-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include #include #include #include "esp_err.h" -#include "soc/soc.h" #include "ulp_common.h" +#include "soc/reg_base.h" #ifdef __cplusplus extern "C" { diff --git a/components/ulp/include/esp32s2/ulp.h b/components/ulp/include/esp32s2/ulp.h index 04d38c457e..3d92485144 100644 --- a/components/ulp/include/esp32s2/ulp.h +++ b/components/ulp/include/esp32s2/ulp.h @@ -1,24 +1,16 @@ -// Copyright 2016-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include #include #include #include "esp_err.h" -#include "soc/soc.h" #include "ulp_common.h" +#include "soc/reg_base.h" #ifdef __cplusplus extern "C" { diff --git a/components/ulp/include/esp32s2/ulp_riscv.h b/components/ulp/include/esp32s2/ulp_riscv.h index f98f2acdac..dcb539d85c 100644 --- a/components/ulp/include/esp32s2/ulp_riscv.h +++ b/components/ulp/include/esp32s2/ulp_riscv.h @@ -1,23 +1,14 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include #include #include #include "esp_err.h" -#include "soc/soc.h" #include "ulp_common.h" /** diff --git a/components/ulp/include/esp32s3/ulp.h b/components/ulp/include/esp32s3/ulp.h index 9207a00ead..de0fd290bf 100644 --- a/components/ulp/include/esp32s3/ulp.h +++ b/components/ulp/include/esp32s3/ulp.h @@ -1,24 +1,16 @@ -// Copyright 2016-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include #include #include #include "esp_err.h" -#include "soc/soc.h" #include "ulp_common.h" +#include "soc/reg_base.h" #ifdef __cplusplus extern "C" { diff --git a/docs/en/migration-guides/system.rst b/docs/en/migration-guides/system.rst index d9237fa975..4d3bde29ff 100644 --- a/docs/en/migration-guides/system.rst +++ b/docs/en/migration-guides/system.rst @@ -45,3 +45,9 @@ ESP HW Support - The header files ``soc/cpu.h`` have been deleted and deprecated CPU util functions have been removed. ESP-IDF developers should include ``esp_cpu.h`` instead for equivalent functions. - The header file ``esp_intr.h`` has been deleted. Please include ``esp_intr_alloc.h`` to allocate and manipulate interrupts. - The header file ``esp_panic.h`` has been deleted. ESP-IDF developers should include ``esp_private/panic_reason.h`` to get supported panic reasons. And should include ``esp_debug_helpers.h`` to use any debug related helper functions, e.g. print backtrace. + +SOC dependency +-------------- + +- Public API headers who are listed in the Doxyfiles won't expose unstable and unnecessary soc header files like ``soc/soc.h``, ``soc/rtc.h``. That means, the user has to explicitly include them in their code if these "missing" header files are still wanted. +- Kconfig option ``LEGACY_INCLUDE_COMMON_HEADERS`` is also removed. diff --git a/examples/bluetooth/hci/controller_hci_uart_esp32c3/main/uhci_uart_demo.c b/examples/bluetooth/hci/controller_hci_uart_esp32c3/main/uhci_uart_demo.c index 03df6fe779..b824f0a04a 100644 --- a/examples/bluetooth/hci/controller_hci_uart_esp32c3/main/uhci_uart_demo.c +++ b/examples/bluetooth/hci/controller_hci_uart_esp32c3/main/uhci_uart_demo.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -166,7 +166,7 @@ static IRAM_ATTR bool hci_uart_tl_tx_eof_callback(gdma_channel_handle_t dma_chan static void uart_gpio_set(void) { gpio_config_t io_output_conf = { - .intr_type = GPIO_PIN_INTR_DISABLE, //disable interrupt + .intr_type = GPIO_INTR_DISABLE, //disable interrupt .mode = GPIO_MODE_OUTPUT, // output mode .pin_bit_mask = GPIO_OUTPUT_PIN_SEL, // bit mask of the output pins .pull_down_en = 0, // disable pull-down mode @@ -175,7 +175,7 @@ static void uart_gpio_set(void) gpio_config(&io_output_conf); gpio_config_t io_input_conf = { - .intr_type = GPIO_PIN_INTR_DISABLE, //disable interrupt + .intr_type = GPIO_INTR_DISABLE, //disable interrupt .mode = GPIO_MODE_INPUT, // input mode .pin_bit_mask = GPIO_INPUT_PIN_SEL, // bit mask of the input pins .pull_down_en = 0, // disable pull-down mode diff --git a/examples/peripherals/spi_slave/receiver/main/app_main.c b/examples/peripherals/spi_slave/receiver/main/app_main.c index 0ea85cf207..1eca638207 100644 --- a/examples/peripherals/spi_slave/receiver/main/app_main.c +++ b/examples/peripherals/spi_slave/receiver/main/app_main.c @@ -13,27 +13,12 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" -#include "freertos/semphr.h" -#include "freertos/queue.h" -#include "lwip/sockets.h" -#include "lwip/dns.h" -#include "lwip/netdb.h" -#include "lwip/igmp.h" - -#include "esp_wifi.h" -#include "esp_system.h" -#include "esp_event.h" -#include "nvs_flash.h" -#include "soc/rtc_periph.h" -#include "driver/spi_slave.h" #include "esp_log.h" -#include "esp_spi_flash.h" +#include "driver/spi_slave.h" #include "driver/gpio.h" - - /* SPI receiver (slave) example. @@ -85,12 +70,12 @@ Pins in use. The SPI Master can use the GPIO mux, so feel free to change these i //Called after a transaction is queued and ready for pickup by master. We use this to set the handshake line high. void my_post_setup_cb(spi_slave_transaction_t *trans) { - WRITE_PERI_REG(GPIO_OUT_W1TS_REG, (1<