Merge branch 'refactor/make_peripheral_ctrl_as_private_api' into 'master'

global: make periph enable/disable APIs private

Closes IDF-3647

See merge request espressif/esp-idf!15632
This commit is contained in:
morris 2021-11-08 07:31:01 +00:00
commit 490d3fee71
92 changed files with 281 additions and 376 deletions

View File

@ -10,7 +10,7 @@
#ifndef BOOTLOADER_BUILD #ifndef BOOTLOADER_BUILD
#include "esp_system.h" #include "esp_system.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
__attribute__((weak)) void bootloader_fill_random(void *buffer, size_t length) __attribute__((weak)) void bootloader_fill_random(void *buffer, size_t length)
{ {

View File

@ -14,7 +14,7 @@
#include "soc/io_mux_reg.h" #include "soc/io_mux_reg.h"
#ifndef BOOTLOADER_BUILD #ifndef BOOTLOADER_BUILD
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#endif #endif
void bootloader_random_enable(void) void bootloader_random_enable(void)

View File

@ -17,7 +17,7 @@
#include "hal/adc_ll.h" #include "hal/adc_ll.h"
#ifndef BOOTLOADER_BUILD #ifndef BOOTLOADER_BUILD
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#endif #endif
void bootloader_random_enable(void) void bootloader_random_enable(void)

View File

@ -29,7 +29,7 @@
#include "esp_err.h" #include "esp_err.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_pm.h" #include "esp_pm.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "soc/rtc.h" #include "soc/rtc.h"
#include "soc/soc_memory_layout.h" #include "soc/soc_memory_layout.h"
#include "soc/dport_reg.h" #include "soc/dport_reg.h"

View File

@ -28,7 +28,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "esp_pm.h" #include "esp_pm.h"
#include "esp_ipc.h" #include "esp_ipc.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "soc/rtc.h" #include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h" #include "soc/rtc_cntl_reg.h"
#include "soc/soc_memory_layout.h" #include "soc/soc_memory_layout.h"

View File

@ -29,7 +29,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "esp_pm.h" #include "esp_pm.h"
#include "esp_ipc.h" #include "esp_ipc.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "soc/rtc.h" #include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h" #include "soc/rtc_cntl_reg.h"
#include "soc/soc_memory_layout.h" #include "soc/soc_memory_layout.h"

View File

@ -18,7 +18,7 @@ set(srcs
"timer.c" "timer.c"
"uart.c") "uart.c")
set(includes "include" "${target}/include") set(includes "include" "${target}/include" "deprecated")
if(${target} STREQUAL "esp32") if(${target} STREQUAL "esp32")
# SDMMC and MCPWM are in ESP32 only. # SDMMC and MCPWM are in ESP32 only.

View File

@ -21,7 +21,7 @@
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"
#include "hal/cpu_ll.h" #include "hal/cpu_ll.h"
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_rom_gpio.h" #include "esp_rom_gpio.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "driver/dedic_gpio.h" #include "driver/dedic_gpio.h"

View File

@ -0,0 +1,8 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#warning driver/periph_ctrl.h header is no longer used, and will be removed in future versions.
#include "esp_private/periph_ctrl.h"

View File

@ -18,7 +18,7 @@
#include "freertos/timers.h" #include "freertos/timers.h"
#include "freertos/ringbuf.h" #include "freertos/ringbuf.h"
#include "esp32c3/rom/ets_sys.h" #include "esp32c3/rom/ets_sys.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/adc.h" #include "driver/adc.h"
#include "hal/adc_types.h" #include "hal/adc_types.h"

View File

@ -18,7 +18,7 @@
#include "freertos/timers.h" #include "freertos/timers.h"
#include "freertos/ringbuf.h" #include "freertos/ringbuf.h"
#include "esp32h2/rom/ets_sys.h" #include "esp32h2/rom/ets_sys.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/adc.h" #include "driver/adc.h"
#include "hal/adc_types.h" #include "hal/adc_types.h"

View File

@ -16,7 +16,7 @@
#include "freertos/timers.h" #include "freertos/timers.h"
#include "esp_pm.h" #include "esp_pm.h"
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/rtc_io.h" #include "driver/rtc_io.h"
#include "driver/rtc_cntl.h" #include "driver/rtc_cntl.h"
#include "driver/gpio.h" #include "driver/gpio.h"

View File

@ -15,7 +15,7 @@
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_check.h" #include "esp_check.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_private/gdma.h" #include "esp_private/gdma.h"
#include "hal/gdma_hal.h" #include "hal/gdma_hal.h"
#include "hal/gdma_ll.h" #include "hal/gdma_ll.h"

View File

@ -22,7 +22,7 @@
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "soc/i2c_periph.h" #include "soc/i2c_periph.h"
#include "driver/i2c.h" #include "driver/i2c.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_rom_gpio.h" #include "esp_rom_gpio.h"
#include "esp_rom_sys.h" #include "esp_rom_sys.h"
#include <sys/param.h> #include <sys/param.h>

View File

@ -41,6 +41,7 @@
#include "esp_efuse.h" #include "esp_efuse.h"
#include "esp_rom_gpio.h" #include "esp_rom_gpio.h"
#include "esp_private/i2s_platform.h" #include "esp_private/i2s_platform.h"
#include "esp_private/periph_ctrl.h"
#include "sdkconfig.h" #include "sdkconfig.h"

View File

@ -14,7 +14,6 @@
#include "soc/rtc_periph.h" #include "soc/rtc_periph.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"
#include "hal/i2s_types.h" #include "hal/i2s_types.h"
#include "driver/periph_ctrl.h"
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#if SOC_I2S_SUPPORTS_ADC #if SOC_I2S_SUPPORTS_ADC

View File

@ -11,7 +11,6 @@
#include "soc/soc.h" #include "soc/soc.h"
#include "hal/ledc_types.h" #include "hal/ledc_types.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/periph_ctrl.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -1,109 +0,0 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _DRIVER_PERIPH_CTRL_H_
#define _DRIVER_PERIPH_CTRL_H_
#include "soc/periph_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief enable peripheral module
*
* @param[in] periph : Peripheral module name
*
* Clock for the module will be ungated, and reset de-asserted.
*
* @note If periph_module_enable is called a number of times,
* periph_module_disable has to be called the same number of times
* in order to put the peripheral into disabled state.
*
* @return NULL
*
*/
void periph_module_enable(periph_module_t periph);
/**
* @brief disable peripheral module
*
* @param[in] periph : Peripheral module name
*
* Clock for the module will be gated, reset asserted.
*
* @note If periph_module_enable is called a number of times,
* periph_module_disable has to be called the same number of times
* in order to put the peripheral into disabled state.
*
* @return NULL
*
*/
void periph_module_disable(periph_module_t periph);
/**
* @brief reset peripheral module
*
* @param[in] periph : Peripheral module name
*
* Reset will asserted then de-assrted for the peripheral.
*
* Calling this function does not enable or disable the clock for the module.
*
* @return NULL
*
*/
void periph_module_reset(periph_module_t periph);
/**
* @brief enable wifi bt common module
*
* @note If wifi_bt_common_module_enable is called a number of times,
* wifi_bt_common_module_disable has to be called the same number of times
* in order to put the peripheral into disabled state.
*
* @return NULL
*
*/
void wifi_bt_common_module_enable(void);
/**
* @brief disable wifi bt common module
*
* @note If wifi_bt_common_module_enable is called a number of times,
* wifi_bt_common_module_disable has to be called the same number of times
* in order to put the peripheral into disabled state.
*
* @return NULL
*
*/
void wifi_bt_common_module_disable(void);
/**
* @brief enable wifi module
*
* @note Enable wifi module only.
*
* @return NULL
*
*/
void wifi_module_enable(void);
/**
* @brief disable wifi module
*
* @note Disable wifi module only.
*
* @return NULL
*
*/
void wifi_module_disable(void);
#ifdef __cplusplus
}
#endif
#endif /* _DRIVER_PERIPH_CTRL_H_ */

View File

@ -0,0 +1,79 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/periph_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enable peripheral module by un-gating the clock and de-asserting the reset signal.
*
* @param[in] periph Peripheral module
*
* @note If @c periph_module_enable() is called a number of times,
* @c periph_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
void periph_module_enable(periph_module_t periph);
/**
* @brief Disable peripheral module by gating the clock and asserting the reset signal.
*
* @param[in] periph Peripheral module
*
* @note If @c periph_module_enable() is called a number of times,
* @c periph_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
void periph_module_disable(periph_module_t periph);
/**
* @brief Reset peripheral module by asserting and de-asserting the reset signal.
*
* @param[in] periph Peripheral module
*
* @note Calling this function does not enable or disable the clock for the module.
*/
void periph_module_reset(periph_module_t periph);
/**
* @brief Enable Wi-Fi and BT common module
*
* @note If @c wifi_bt_common_module_enable() is called a number of times,
* @c wifi_bt_common_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
void wifi_bt_common_module_enable(void);
/**
* @brief Disable Wi-Fi and BT common module
*
* @note If @c wifi_bt_common_module_enable() is called a number of times,
* @c wifi_bt_common_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
void wifi_bt_common_module_disable(void);
/**
* @brief Enable Wi-Fi module
*
* @note Calling this function will only enable Wi-Fi module.
*/
void wifi_module_enable(void);
/**
* @brief Disable Wi-Fi module
*
* @note Calling this function will only disable Wi-Fi module.
*/
void wifi_module_disable(void);
#ifdef __cplusplus
}
#endif

View File

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#include <string.h> #include <string.h>
#include <esp_types.h> #include "esp_types.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/semphr.h" #include "freertos/semphr.h"
#include "esp_log.h" #include "esp_log.h"
@ -19,8 +19,9 @@
#include "esp_rom_gpio.h" #include "esp_rom_gpio.h"
#include "esp_rom_sys.h" #include "esp_rom_sys.h"
#include "soc/clk_ctrl_os.h" #include "soc/clk_ctrl_os.h"
#include "esp_private/periph_ctrl.h"
static const char* LEDC_TAG = "ledc"; static const char *LEDC_TAG = "ledc";
#define LEDC_CHECK(a, str, ret_val) ESP_RETURN_ON_FALSE(a, ret_val, LEDC_TAG, "%s", str) #define LEDC_CHECK(a, str, ret_val) ESP_RETURN_ON_FALSE(a, ret_val, LEDC_TAG, "%s", str)
#define LEDC_ARG_CHECK(a, param) ESP_RETURN_ON_FALSE(a, ESP_ERR_INVALID_ARG, LEDC_TAG, param " argument is invalid") #define LEDC_ARG_CHECK(a, param) ESP_RETURN_ON_FALSE(a, ESP_ERR_INVALID_ARG, LEDC_TAG, param " argument is invalid")
@ -127,7 +128,7 @@ static esp_err_t ledc_enable_intr_type(ledc_mode_t speed_mode, ledc_channel_t ch
static void _ledc_fade_hw_acquire(ledc_mode_t mode, ledc_channel_t channel) static void _ledc_fade_hw_acquire(ledc_mode_t mode, ledc_channel_t channel)
{ {
ledc_fade_t* fade = s_ledc_fade_rec[mode][channel]; ledc_fade_t *fade = s_ledc_fade_rec[mode][channel];
if (fade) { if (fade) {
xSemaphoreTake(fade->ledc_fade_sem, portMAX_DELAY); xSemaphoreTake(fade->ledc_fade_sem, portMAX_DELAY);
ledc_enable_intr_type(mode, channel, LEDC_INTR_DISABLE); ledc_enable_intr_type(mode, channel, LEDC_INTR_DISABLE);
@ -136,7 +137,7 @@ static void _ledc_fade_hw_acquire(ledc_mode_t mode, ledc_channel_t channel)
static void _ledc_fade_hw_release(ledc_mode_t mode, ledc_channel_t channel) static void _ledc_fade_hw_release(ledc_mode_t mode, ledc_channel_t channel)
{ {
ledc_fade_t* fade = s_ledc_fade_rec[mode][channel]; ledc_fade_t *fade = s_ledc_fade_rec[mode][channel];
if (fade) { if (fade) {
xSemaphoreGive(fade->ledc_fade_sem); xSemaphoreGive(fade->ledc_fade_sem);
} }
@ -144,7 +145,7 @@ static void _ledc_fade_hw_release(ledc_mode_t mode, ledc_channel_t channel)
static void _ledc_op_lock_acquire(ledc_mode_t mode, ledc_channel_t channel) static void _ledc_op_lock_acquire(ledc_mode_t mode, ledc_channel_t channel)
{ {
ledc_fade_t* fade = s_ledc_fade_rec[mode][channel]; ledc_fade_t *fade = s_ledc_fade_rec[mode][channel];
if (fade) { if (fade) {
xSemaphoreTake(fade->ledc_fade_mux, portMAX_DELAY); xSemaphoreTake(fade->ledc_fade_mux, portMAX_DELAY);
} }
@ -152,7 +153,7 @@ static void _ledc_op_lock_acquire(ledc_mode_t mode, ledc_channel_t channel)
static void _ledc_op_lock_release(ledc_mode_t mode, ledc_channel_t channel) static void _ledc_op_lock_release(ledc_mode_t mode, ledc_channel_t channel)
{ {
ledc_fade_t* fade = s_ledc_fade_rec[mode][channel]; ledc_fade_t *fade = s_ledc_fade_rec[mode][channel];
if (fade) { if (fade) {
xSemaphoreGive(fade->ledc_fade_mux); xSemaphoreGive(fade->ledc_fade_mux);
} }
@ -167,7 +168,7 @@ static uint32_t ledc_get_max_duty(ledc_mode_t speed_mode, ledc_channel_t channel
} }
esp_err_t ledc_timer_set(ledc_mode_t speed_mode, ledc_timer_t timer_sel, uint32_t clock_divider, uint32_t duty_resolution, esp_err_t ledc_timer_set(ledc_mode_t speed_mode, ledc_timer_t timer_sel, uint32_t clock_divider, uint32_t duty_resolution,
ledc_clk_src_t clk_src) ledc_clk_src_t clk_src)
{ {
LEDC_ARG_CHECK(speed_mode < LEDC_SPEED_MODE_MAX, "speed_mode"); LEDC_ARG_CHECK(speed_mode < LEDC_SPEED_MODE_MAX, "speed_mode");
LEDC_ARG_CHECK(timer_sel < LEDC_TIMER_MAX, "timer_select"); LEDC_ARG_CHECK(timer_sel < LEDC_TIMER_MAX, "timer_select");
@ -182,7 +183,7 @@ esp_err_t ledc_timer_set(ledc_mode_t speed_mode, ledc_timer_t timer_sel, uint32_
} }
static IRAM_ATTR esp_err_t ledc_duty_config(ledc_mode_t speed_mode, ledc_channel_t channel, int hpoint_val, int duty_val, static IRAM_ATTR esp_err_t ledc_duty_config(ledc_mode_t speed_mode, ledc_channel_t channel, int hpoint_val, int duty_val,
ledc_duty_direction_t duty_direction, uint32_t duty_num, uint32_t duty_cycle, uint32_t duty_scale) ledc_duty_direction_t duty_direction, uint32_t duty_num, uint32_t duty_cycle, uint32_t duty_scale)
{ {
portENTER_CRITICAL(&ledc_spinlock); portENTER_CRITICAL(&ledc_spinlock);
if (hpoint_val >= 0) { if (hpoint_val >= 0) {
@ -248,7 +249,7 @@ esp_err_t ledc_timer_resume(ledc_mode_t speed_mode, ledc_timer_t timer_sel)
return ESP_OK; return ESP_OK;
} }
esp_err_t ledc_isr_register(void (*fn)(void*), void * arg, int intr_alloc_flags, ledc_isr_handle_t *handle) esp_err_t ledc_isr_register(void (*fn)(void *), void *arg, int intr_alloc_flags, ledc_isr_handle_t *handle)
{ {
esp_err_t ret; esp_err_t ret;
LEDC_ARG_CHECK(fn, "fn"); LEDC_ARG_CHECK(fn, "fn");
@ -267,7 +268,7 @@ static esp_err_t ledc_set_timer_div(ledc_mode_t speed_mode, ledc_timer_t timer_n
// Calculate the divisor // Calculate the divisor
// User specified source clock(RTC8M_CLK) for low speed channel // User specified source clock(RTC8M_CLK) for low speed channel
if ((speed_mode == LEDC_LOW_SPEED_MODE) && (clk_cfg == LEDC_USE_RTC8M_CLK)) { if ((speed_mode == LEDC_LOW_SPEED_MODE) && (clk_cfg == LEDC_USE_RTC8M_CLK)) {
if(s_ledc_slow_clk_8M == 0) { if (s_ledc_slow_clk_8M == 0) {
if (ledc_slow_clk_calibrate() == false) { if (ledc_slow_clk_calibrate() == false) {
goto error; goto error;
} }
@ -286,7 +287,7 @@ static esp_err_t ledc_set_timer_div(ledc_mode_t speed_mode, ledc_timer_t timer_n
// divisor is too low // divisor is too low
goto error; goto error;
} }
// User specified source clock(LEDC_APB_CLK_HZ or LEDC_REF_TICK) // User specified source clock(LEDC_APB_CLK_HZ or LEDC_REF_TICK)
} else { } else {
timer_clk_src = (clk_cfg == LEDC_USE_REF_TICK) ? LEDC_REF_TICK : LEDC_APB_CLK; timer_clk_src = (clk_cfg == LEDC_USE_REF_TICK) ? LEDC_REF_TICK : LEDC_APB_CLK;
uint32_t src_clk_freq = ledc_get_src_clk_freq(clk_cfg); uint32_t src_clk_freq = ledc_get_src_clk_freq(clk_cfg);
@ -308,11 +309,11 @@ static esp_err_t ledc_set_timer_div(ledc_mode_t speed_mode, ledc_timer_t timer_n
return ESP_OK; return ESP_OK;
error: error:
ESP_LOGE(LEDC_TAG, "requested frequency and duty resolution can not be achieved, try reducing freq_hz or duty_resolution. div_param=%d", ESP_LOGE(LEDC_TAG, "requested frequency and duty resolution can not be achieved, try reducing freq_hz or duty_resolution. div_param=%d",
(uint32_t ) div_param); (uint32_t ) div_param);
return ESP_FAIL; return ESP_FAIL;
} }
esp_err_t ledc_timer_config(const ledc_timer_config_t* timer_conf) esp_err_t ledc_timer_config(const ledc_timer_config_t *timer_conf)
{ {
LEDC_ARG_CHECK(timer_conf != NULL, "timer_conf"); LEDC_ARG_CHECK(timer_conf != NULL, "timer_conf");
uint32_t freq_hz = timer_conf->freq_hz; uint32_t freq_hz = timer_conf->freq_hz;
@ -331,7 +332,7 @@ esp_err_t ledc_timer_config(const ledc_timer_config_t* timer_conf)
return ESP_ERR_INVALID_ARG; return ESP_ERR_INVALID_ARG;
} }
if(p_ledc_obj[speed_mode] == NULL) { if (p_ledc_obj[speed_mode] == NULL) {
p_ledc_obj[speed_mode] = (ledc_obj_t *) heap_caps_calloc(1, sizeof(ledc_obj_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); p_ledc_obj[speed_mode] = (ledc_obj_t *) heap_caps_calloc(1, sizeof(ledc_obj_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
if (p_ledc_obj[speed_mode] == NULL) { if (p_ledc_obj[speed_mode] == NULL) {
return ESP_ERR_NO_MEM; return ESP_ERR_NO_MEM;
@ -353,7 +354,7 @@ esp_err_t ledc_set_pin(int gpio_num, ledc_mode_t speed_mode, ledc_channel_t ledc
return ESP_OK; return ESP_OK;
} }
esp_err_t ledc_channel_config(const ledc_channel_config_t* ledc_conf) esp_err_t ledc_channel_config(const ledc_channel_config_t *ledc_conf)
{ {
LEDC_ARG_CHECK(ledc_conf, "ledc_conf"); LEDC_ARG_CHECK(ledc_conf, "ledc_conf");
uint32_t speed_mode = ledc_conf->speed_mode; uint32_t speed_mode = ledc_conf->speed_mode;
@ -373,7 +374,7 @@ esp_err_t ledc_channel_config(const ledc_channel_config_t* ledc_conf)
periph_module_enable(PERIPH_LEDC_MODULE); periph_module_enable(PERIPH_LEDC_MODULE);
esp_err_t ret = ESP_OK; esp_err_t ret = ESP_OK;
if(p_ledc_obj[speed_mode] == NULL) { if (p_ledc_obj[speed_mode] == NULL) {
p_ledc_obj[speed_mode] = (ledc_obj_t *) heap_caps_calloc(1, sizeof(ledc_obj_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); p_ledc_obj[speed_mode] = (ledc_obj_t *) heap_caps_calloc(1, sizeof(ledc_obj_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
if (p_ledc_obj[speed_mode] == NULL) { if (p_ledc_obj[speed_mode] == NULL) {
return ESP_ERR_NO_MEM; return ESP_ERR_NO_MEM;
@ -392,8 +393,8 @@ esp_err_t ledc_channel_config(const ledc_channel_config_t* ledc_conf)
/*set interrupt type*/ /*set interrupt type*/
ledc_enable_intr_type(speed_mode, ledc_channel, intr_type); ledc_enable_intr_type(speed_mode, ledc_channel, intr_type);
ESP_LOGD(LEDC_TAG, "LEDC_PWM CHANNEL %1u|GPIO %02u|Duty %04u|Time %01u", ESP_LOGD(LEDC_TAG, "LEDC_PWM CHANNEL %1u|GPIO %02u|Duty %04u|Time %01u",
ledc_channel, gpio_num, duty, timer_select ledc_channel, gpio_num, duty, timer_select
); );
/*set LEDC signal in gpio matrix*/ /*set LEDC signal in gpio matrix*/
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_num], PIN_FUNC_GPIO); gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_num], PIN_FUNC_GPIO);
gpio_set_direction(gpio_num, GPIO_MODE_OUTPUT); gpio_set_direction(gpio_num, GPIO_MODE_OUTPUT);
@ -430,7 +431,7 @@ esp_err_t ledc_stop(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t idl
} }
esp_err_t ledc_set_fade(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, ledc_duty_direction_t fade_direction, esp_err_t ledc_set_fade(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, ledc_duty_direction_t fade_direction,
uint32_t step_num, uint32_t duty_cyle_num, uint32_t duty_scale) uint32_t step_num, uint32_t duty_cyle_num, uint32_t duty_scale)
{ {
LEDC_ARG_CHECK(speed_mode < LEDC_SPEED_MODE_MAX, "speed_mode"); LEDC_ARG_CHECK(speed_mode < LEDC_SPEED_MODE_MAX, "speed_mode");
LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel"); LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel");
@ -448,7 +449,7 @@ esp_err_t ledc_set_fade(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t
step_num, //uint32_t duty_num, step_num, //uint32_t duty_num,
duty_cyle_num, //uint32_t duty_cycle, duty_cyle_num, //uint32_t duty_cycle,
duty_scale //uint32_t duty_scale duty_scale //uint32_t duty_scale
); );
_ledc_fade_hw_release(speed_mode, channel); _ledc_fade_hw_release(speed_mode, channel);
return ESP_OK; return ESP_OK;
} }
@ -469,7 +470,7 @@ esp_err_t ledc_set_duty_with_hpoint(ledc_mode_t speed_mode, ledc_channel_t chann
1, //uint32_t duty_num, 1, //uint32_t duty_num,
1, //uint32_t duty_cycle, 1, //uint32_t duty_cycle,
0 //uint32_t duty_scale 0 //uint32_t duty_scale
); );
_ledc_fade_hw_release(speed_mode, channel); _ledc_fade_hw_release(speed_mode, channel);
return ESP_OK; return ESP_OK;
} }
@ -489,7 +490,7 @@ esp_err_t ledc_set_duty(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t
1, //uint32_t duty_num, 1, //uint32_t duty_num,
1, //uint32_t duty_cycle, 1, //uint32_t duty_cycle,
0 //uint32_t duty_scale 0 //uint32_t duty_scale
); );
_ledc_fade_hw_release(speed_mode, channel); _ledc_fade_hw_release(speed_mode, channel);
return ESP_OK; return ESP_OK;
} }
@ -551,7 +552,7 @@ static inline void ledc_calc_fade_end_channel(uint32_t *fade_end_status, uint32_
*channel = i; *channel = i;
} }
void IRAM_ATTR ledc_fade_isr(void* arg) void IRAM_ATTR ledc_fade_isr(void *arg)
{ {
bool cb_yield = false; bool cb_yield = false;
portBASE_TYPE HPTaskAwoken = pdFALSE; portBASE_TYPE HPTaskAwoken = pdFALSE;
@ -564,7 +565,7 @@ void IRAM_ATTR ledc_fade_isr(void* arg)
continue; continue;
} }
ledc_hal_get_fade_end_intr_status(&(p_ledc_obj[speed_mode]->ledc_hal), &intr_status); ledc_hal_get_fade_end_intr_status(&(p_ledc_obj[speed_mode]->ledc_hal), &intr_status);
while(intr_status) { while (intr_status) {
ledc_calc_fade_end_channel(&intr_status, &channel); ledc_calc_fade_end_channel(&intr_status, &channel);
// clear interrupt // clear interrupt
@ -671,8 +672,8 @@ static esp_err_t ledc_fade_channel_init_check(ledc_mode_t speed_mode, ledc_chann
xSemaphoreGive(s_ledc_fade_rec[speed_mode][channel]->ledc_fade_sem); xSemaphoreGive(s_ledc_fade_rec[speed_mode][channel]->ledc_fade_sem);
} }
if (s_ledc_fade_rec[speed_mode][channel] if (s_ledc_fade_rec[speed_mode][channel]
&& s_ledc_fade_rec[speed_mode][channel]->ledc_fade_mux && s_ledc_fade_rec[speed_mode][channel]->ledc_fade_mux
&& s_ledc_fade_rec[speed_mode][channel]->ledc_fade_sem) { && s_ledc_fade_rec[speed_mode][channel]->ledc_fade_sem) {
return ESP_OK; return ESP_OK;
} else { } else {
ledc_fade_channel_deinit(speed_mode, channel); ledc_fade_channel_deinit(speed_mode, channel);
@ -712,7 +713,7 @@ static esp_err_t _ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t
if (scale > 0 && step_num > 0) { if (scale > 0 && step_num > 0) {
ledc_duty_config(speed_mode, channel, LEDC_VAL_NO_CHANGE, duty_cur, dir, step_num, cycle_num, scale); ledc_duty_config(speed_mode, channel, LEDC_VAL_NO_CHANGE, duty_cur, dir, step_num, cycle_num, scale);
ESP_LOGD(LEDC_TAG, "cur duty: %d; target: %d, step: %d, cycle: %d; scale: %d; dir: %d\n", ESP_LOGD(LEDC_TAG, "cur duty: %d; target: %d, step: %d, cycle: %d; scale: %d; dir: %d\n",
duty_cur, target_duty, step_num, cycle_num, scale, dir); duty_cur, target_duty, step_num, cycle_num, scale, dir);
} else { } else {
ledc_duty_config(speed_mode, channel, LEDC_VAL_NO_CHANGE, target_duty, dir, 0, 1, 0); ledc_duty_config(speed_mode, channel, LEDC_VAL_NO_CHANGE, target_duty, dir, 0, 1, 0);
ESP_LOGD(LEDC_TAG, "Set to target duty: %d", target_duty); ESP_LOGD(LEDC_TAG, "Set to target duty: %d", target_duty);
@ -775,7 +776,7 @@ esp_err_t ledc_set_fade_with_time(ledc_mode_t speed_mode, ledc_channel_t channel
LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel"); LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel");
LEDC_ARG_CHECK(target_duty <= ledc_get_max_duty(speed_mode, channel), "target_duty"); LEDC_ARG_CHECK(target_duty <= ledc_get_max_duty(speed_mode, channel), "target_duty");
LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE); LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE);
LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK , LEDC_FADE_INIT_ERROR_STR, ESP_FAIL); LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK, LEDC_FADE_INIT_ERROR_STR, ESP_FAIL);
_ledc_fade_hw_acquire(speed_mode, channel); _ledc_fade_hw_acquire(speed_mode, channel);
_ledc_set_fade_with_time(speed_mode, channel, target_duty, max_fade_time_ms); _ledc_set_fade_with_time(speed_mode, channel, target_duty, max_fade_time_ms);
@ -791,7 +792,7 @@ esp_err_t ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel
LEDC_ARG_CHECK((cycle_num > 0) && (cycle_num <= LEDC_DUTY_CYCLE_MAX), "cycle_num"); LEDC_ARG_CHECK((cycle_num > 0) && (cycle_num <= LEDC_DUTY_CYCLE_MAX), "cycle_num");
LEDC_ARG_CHECK(target_duty <= ledc_get_max_duty(speed_mode, channel), "target_duty"); LEDC_ARG_CHECK(target_duty <= ledc_get_max_duty(speed_mode, channel), "target_duty");
LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE); LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE);
LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK , LEDC_FADE_INIT_ERROR_STR, ESP_FAIL); LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK, LEDC_FADE_INIT_ERROR_STR, ESP_FAIL);
_ledc_fade_hw_acquire(speed_mode, channel); _ledc_fade_hw_acquire(speed_mode, channel);
_ledc_set_fade_with_step(speed_mode, channel, target_duty, scale, cycle_num); _ledc_set_fade_with_step(speed_mode, channel, target_duty, scale, cycle_num);
@ -840,7 +841,7 @@ esp_err_t ledc_cb_register(ledc_mode_t speed_mode, ledc_channel_t channel, ledc_
LEDC_ARG_CHECK(speed_mode < LEDC_SPEED_MODE_MAX, "speed_mode"); LEDC_ARG_CHECK(speed_mode < LEDC_SPEED_MODE_MAX, "speed_mode");
LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel"); LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel");
LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE); LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE);
LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK , LEDC_FADE_INIT_ERROR_STR, ESP_FAIL); LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK, LEDC_FADE_INIT_ERROR_STR, ESP_FAIL);
s_ledc_fade_rec[speed_mode][channel]->ledc_fade_callback = cbs->fade_cb; s_ledc_fade_rec[speed_mode][channel]->ledc_fade_callback = cbs->fade_cb;
s_ledc_fade_rec[speed_mode][channel]->cb_user_arg = user_arg; s_ledc_fade_rec[speed_mode][channel]->cb_user_arg = user_arg;
return ESP_OK; return ESP_OK;
@ -856,7 +857,7 @@ esp_err_t ledc_set_duty_and_update(ledc_mode_t speed_mode, ledc_channel_t channe
LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel"); LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel");
LEDC_ARG_CHECK(duty <= ledc_get_max_duty(speed_mode, channel), "target_duty"); LEDC_ARG_CHECK(duty <= ledc_get_max_duty(speed_mode, channel), "target_duty");
LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE); LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE);
LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK , LEDC_FADE_INIT_ERROR_STR, ESP_FAIL); LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK, LEDC_FADE_INIT_ERROR_STR, ESP_FAIL);
_ledc_op_lock_acquire(speed_mode, channel); _ledc_op_lock_acquire(speed_mode, channel);
_ledc_fade_hw_acquire(speed_mode, channel); _ledc_fade_hw_acquire(speed_mode, channel);
_ledc_set_fade_with_step(speed_mode, channel, duty, 0, 1); _ledc_set_fade_with_step(speed_mode, channel, duty, 0, 1);
@ -872,7 +873,7 @@ esp_err_t ledc_set_fade_time_and_start(ledc_mode_t speed_mode, ledc_channel_t ch
LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel"); LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel");
LEDC_ARG_CHECK(fade_mode < LEDC_FADE_MAX, "fade_mode"); LEDC_ARG_CHECK(fade_mode < LEDC_FADE_MAX, "fade_mode");
LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE); LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE);
LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK , LEDC_FADE_INIT_ERROR_STR, ESP_FAIL); LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK, LEDC_FADE_INIT_ERROR_STR, ESP_FAIL);
LEDC_ARG_CHECK(target_duty <= ledc_get_max_duty(speed_mode, channel), "target_duty"); LEDC_ARG_CHECK(target_duty <= ledc_get_max_duty(speed_mode, channel), "target_duty");
_ledc_op_lock_acquire(speed_mode, channel); _ledc_op_lock_acquire(speed_mode, channel);
_ledc_fade_hw_acquire(speed_mode, channel); _ledc_fade_hw_acquire(speed_mode, channel);
@ -891,7 +892,7 @@ esp_err_t ledc_set_fade_step_and_start(ledc_mode_t speed_mode, ledc_channel_t ch
LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel"); LEDC_ARG_CHECK(channel < LEDC_CHANNEL_MAX, "channel");
LEDC_ARG_CHECK(fade_mode < LEDC_FADE_MAX, "fade_mode"); LEDC_ARG_CHECK(fade_mode < LEDC_FADE_MAX, "fade_mode");
LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE); LEDC_CHECK(p_ledc_obj[speed_mode] != NULL, LEDC_NOT_INIT, ESP_ERR_INVALID_STATE);
LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK , LEDC_FADE_INIT_ERROR_STR, ESP_FAIL); LEDC_CHECK(ledc_fade_channel_init_check(speed_mode, channel) == ESP_OK, LEDC_FADE_INIT_ERROR_STR, ESP_FAIL);
LEDC_ARG_CHECK((scale > 0) && (scale <= LEDC_DUTY_SCALE_MAX), "fade scale"); LEDC_ARG_CHECK((scale > 0) && (scale <= LEDC_DUTY_SCALE_MAX), "fade scale");
LEDC_ARG_CHECK((cycle_num > 0) && (cycle_num <= LEDC_DUTY_CYCLE_MAX), "cycle_num"); LEDC_ARG_CHECK((cycle_num > 0) && (cycle_num <= LEDC_DUTY_CYCLE_MAX), "cycle_num");
LEDC_ARG_CHECK(target_duty <= ledc_get_max_duty(speed_mode, channel), "target_duty"); LEDC_ARG_CHECK(target_duty <= ledc_get_max_duty(speed_mode, channel), "target_duty");

View File

@ -20,7 +20,7 @@
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "hal/mcpwm_ll.h" #include "hal/mcpwm_ll.h"
#include "driver/mcpwm.h" #include "driver/mcpwm.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
static const char *TAG = "mcpwm"; static const char *TAG = "mcpwm";

View File

@ -8,7 +8,7 @@
#include "esp_check.h" #include "esp_check.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"
#if SOC_PCNT_SUPPORTED #if SOC_PCNT_SUPPORTED
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/pcnt.h" #include "driver/pcnt.h"
#include "hal/pcnt_hal.h" #include "hal/pcnt_hal.h"
#include "hal/pcnt_ll.h" #include "hal/pcnt_ll.h"

View File

@ -6,7 +6,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "hal/clk_gate_ll.h" #include "hal/clk_gate_ll.h"
#include "esp_attr.h" #include "esp_attr.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
static portMUX_TYPE periph_spinlock = portMUX_INITIALIZER_UNLOCKED; static portMUX_TYPE periph_spinlock = portMUX_INITIALIZER_UNLOCKED;

View File

@ -12,7 +12,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "esp_check.h" #include "esp_check.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/rmt.h" #include "driver/rmt.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"

View File

@ -86,7 +86,7 @@ The driver of FIFOs works as below:
#include "soc/gpio_periph.h" #include "soc/gpio_periph.h"
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"
#include "freertos/semphr.h" #include "freertos/semphr.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "hal/sdio_slave_hal.h" #include "hal/sdio_slave_hal.h"
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"

View File

@ -16,7 +16,7 @@
#include "esp_rom_sys.h" #include "esp_rom_sys.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/sdmmc_host.h" #include "driver/sdmmc_host.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "sdmmc_private.h" #include "sdmmc_private.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/semphr.h" #include "freertos/semphr.h"

View File

@ -18,7 +18,7 @@
#include "soc/soc_pins.h" #include "soc/soc_pins.h"
#include "soc/lldesc.h" #include "soc/lldesc.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"
#include "driver/spi_common_internal.h" #include "driver/spi_common_internal.h"
#include "stdatomic.h" #include "stdatomic.h"

View File

@ -20,7 +20,7 @@
#include "soc/i2c_periph.h" #include "soc/i2c_periph.h"
#include "esp_system.h" #include "esp_system.h"
#include "soc/uart_struct.h" #include "soc/uart_struct.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_rom_gpio.h" #include "esp_rom_gpio.h"
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "hal/uart_ll.h" #include "hal/uart_ll.h"

View File

@ -21,7 +21,6 @@
#include "freertos/queue.h" #include "freertos/queue.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"
#if SOC_PCNT_SUPPORTED #if SOC_PCNT_SUPPORTED
#include "driver/periph_ctrl.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/pcnt.h" #include "driver/pcnt.h"
#include "driver/ledc.h" #include "driver/ledc.h"

View File

@ -11,7 +11,7 @@
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "driver/timer.h" #include "driver/timer.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "hal/timer_hal.h" #include "hal/timer_hal.h"
#include "hal/timer_ll.h" #include "hal/timer_ll.h"
#include "hal/check.h" #include "hal/check.h"

View File

@ -17,7 +17,7 @@
#include "esp_attr.h" #include "esp_attr.h"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/twai.h" #include "driver/twai.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"
#include "soc/twai_periph.h" #include "soc/twai_periph.h"

View File

@ -21,7 +21,7 @@
#include "driver/uart.h" #include "driver/uart.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/uart_select.h" #include "driver/uart_select.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "sdkconfig.h" #include "sdkconfig.h"
#include "esp_rom_gpio.h" #include "esp_rom_gpio.h"

View File

@ -1,20 +1,12 @@
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "esp_attr.h" #include "esp_attr.h"
#include "esp_log.h" #include "esp_log.h"

View File

@ -8,7 +8,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "esp_log.h" #include "esp_log.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/timer.h" #include "driver/timer.h"
#include "esp_event.h" #include "esp_event.h"

View File

@ -7,7 +7,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "esp_log.h" #include "esp_log.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/timer.h" #include "driver/timer.h"
#include "esp_event.h" #include "esp_event.h"

View File

@ -10,7 +10,7 @@
#include "soc/soc_caps.h" #include "soc/soc_caps.h"
#include "hal/gdma_ll.h" #include "hal/gdma_ll.h"
#include "hal/gdma_hal.h" #include "hal/gdma_hal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_attr.h" #include "esp_attr.h"
#include "esp_err.h" #include "esp_err.h"

View File

@ -27,7 +27,7 @@
#include "driver/gpio.h" #include "driver/gpio.h"
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "driver/spi_common_internal.h" #include "driver/spi_common_internal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_common.h" #include "bootloader_common.h"
#include "esp_rom_gpio.h" #include "esp_rom_gpio.h"
#include "bootloader_flash_config.h" #include "bootloader_flash_config.h"

View File

@ -10,7 +10,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_crypto_lock.h" #include "esp_crypto_lock.h"
#include "hal/ds_hal.h" #include "hal/ds_hal.h"
#include "hal/ds_ll.h" #include "hal/ds_ll.h"

View File

@ -5,7 +5,7 @@
*/ */
#include <string.h> #include <string.h>
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp32c3/rom/hmac.h" #include "esp32c3/rom/hmac.h"
#include "esp32c3/rom/ets_sys.h" #include "esp32c3/rom/ets_sys.h"
#include "esp_efuse.h" #include "esp_efuse.h"

View File

@ -10,7 +10,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_crypto_lock.h" #include "esp_crypto_lock.h"
#include "hal/ds_hal.h" #include "hal/ds_hal.h"
#include "hal/ds_ll.h" #include "hal/ds_ll.h"

View File

@ -5,7 +5,7 @@
*/ */
#include <string.h> #include <string.h>
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp32c3/rom/hmac.h" #include "esp32c3/rom/hmac.h"
#include "esp32c3/rom/ets_sys.h" #include "esp32c3/rom/ets_sys.h"
#include "esp_efuse.h" #include "esp_efuse.h"

View File

@ -31,7 +31,7 @@
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/spi_common_internal.h" #include "driver/spi_common_internal.h"
#include "driver/spi_common.h" #include "driver/spi_common.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_common.h" #include "bootloader_common.h"
#if CONFIG_SPIRAM #if CONFIG_SPIRAM

View File

@ -10,7 +10,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_crypto_lock.h" #include "esp_crypto_lock.h"
#include "hal/ds_hal.h" #include "hal/ds_hal.h"
#include "hal/ds_ll.h" #include "hal/ds_ll.h"

View File

@ -5,7 +5,7 @@
*/ */
#include <string.h> #include <string.h>
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp32s3/rom/efuse.h" #include "esp32s3/rom/efuse.h"
#include "esp32s3/rom/hmac.h" #include "esp32s3/rom/hmac.h"
#include "esp32s3/rom/ets_sys.h" #include "esp32s3/rom/ets_sys.h"

View File

@ -23,7 +23,7 @@
#include "soc/efuse_reg.h" #include "soc/efuse_reg.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/spi_common.h" #include "driver/spi_common.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#if CONFIG_SPIRAM_MODE_OCT #if CONFIG_SPIRAM_MODE_OCT
#include "soc/rtc.h" #include "soc/rtc.h"

View File

@ -34,7 +34,7 @@
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "driver/spi_common_internal.h" #include "driver/spi_common_internal.h"
#include "driver/spi_common.h" #include "driver/spi_common.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_common.h" #include "bootloader_common.h"
#if CONFIG_SPIRAM_MODE_QUAD #if CONFIG_SPIRAM_MODE_QUAD

View File

@ -12,7 +12,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "esp32/rom/lldesc.h" #include "esp32/rom/lldesc.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"

View File

@ -16,7 +16,7 @@
#include "freertos/queue.h" #include "freertos/queue.h"
#include "unity.h" #include "unity.h"
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "driver/timer.h" #include "driver/timer.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"
#include "soc/spi_periph.h" #include "soc/spi_periph.h"

View File

@ -12,7 +12,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "esp32/rom/lldesc.h" #include "esp32/rom/lldesc.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"

View File

@ -32,7 +32,7 @@
#include "hal/dma_types.h" #include "hal/dma_types.h"
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#if SOC_I2S_LCD_I80_VARIANT #if SOC_I2S_LCD_I80_VARIANT
#include "esp_private/i2s_platform.h" #include "esp_private/i2s_platform.h"
#include "soc/lcd_periph.h" #include "soc/lcd_periph.h"

View File

@ -27,7 +27,7 @@
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "esp_private/gdma.h" #include "esp_private/gdma.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#if SOC_LCDCAM_SUPPORTED #if SOC_LCDCAM_SUPPORTED
#include "esp_lcd_common.h" #include "esp_lcd_common.h"
#include "soc/lcd_periph.h" #include "soc/lcd_periph.h"

View File

@ -29,7 +29,7 @@
#include "hal/gpio_hal.h" #include "hal/gpio_hal.h"
#include "esp_private/gdma.h" #include "esp_private/gdma.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#if CONFIG_SPIRAM #if CONFIG_SPIRAM
#include "spiram.h" #include "spiram.h"
#endif #endif

View File

@ -23,7 +23,7 @@
#include "phy.h" #include "phy.h"
#include "phy_init_data.h" #include "phy_init_data.h"
#include "esp_coexist_internal.h" #include "esp_coexist_internal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_private/wifi.h" #include "esp_private/wifi.h"
#include "esp_rom_crc.h" #include "esp_rom_crc.h"
#include "esp_rom_sys.h" #include "esp_rom_sys.h"

View File

@ -1,23 +1,15 @@
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <string.h> #include <string.h>
#include <sys/param.h> #include <sys/param.h>
#include "esp_log.h" #include "esp_log.h"
#include "esp_check.h" #include "esp_check.h"
#include "driver/spi_master.h" #include "driver/spi_master.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "essl_internal.h" #include "essl_internal.h"
#include "essl_spi.h" #include "essl_spi.h"
#include "essl_spi/esp32s2_defs.h" #include "essl_spi/esp32s2_defs.h"

View File

@ -18,7 +18,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "esp_freertos_hooks.h" #include "esp_freertos_hooks.h"
#include "soc/timer_periph.h" #include "soc/timer_periph.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_int_wdt.h" #include "esp_int_wdt.h"
#include "esp_private/system_internal.h" #include "esp_private/system_internal.h"
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"

View File

@ -1,24 +1,16 @@
// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include "soc/rtc.h" #include "soc/rtc.h"
#include "soc/dport_reg.h" #include "soc/dport_reg.h"
#include "soc/dport_access.h" #include "soc/dport_access.h"
#include "soc/i2s_reg.h" #include "soc/i2s_reg.h"
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_clock.h" #include "bootloader_clock.h"
#include "hal/wdt_hal.h" #include "hal/wdt_hal.h"

View File

@ -1,16 +1,8 @@
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <stdint.h> #include <stdint.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
@ -31,7 +23,7 @@
#include "soc/i2s_reg.h" #include "soc/i2s_reg.h"
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"
#include "hal/wdt_hal.h" #include "hal/wdt_hal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_clock.h" #include "bootloader_clock.h"
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"
#include "esp_rom_uart.h" #include "esp_rom_uart.h"

View File

@ -1,16 +1,8 @@
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <stdint.h> #include <stdint.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
@ -32,7 +24,7 @@
#include "soc/i2s_reg.h" #include "soc/i2s_reg.h"
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"
#include "hal/wdt_hal.h" #include "hal/wdt_hal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_clock.h" #include "bootloader_clock.h"
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"
#include "esp_rom_uart.h" #include "esp_rom_uart.h"

View File

@ -1,17 +1,9 @@
// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <stdint.h> #include <stdint.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
@ -32,7 +24,7 @@
#include "soc/i2s_reg.h" #include "soc/i2s_reg.h"
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"
#include "hal/wdt_hal.h" #include "hal/wdt_hal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_clock.h" #include "bootloader_clock.h"
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"
#include "hal/clk_gate_ll.h" #include "hal/clk_gate_ll.h"

View File

@ -1,17 +1,9 @@
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <stdint.h> #include <stdint.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
@ -32,7 +24,7 @@
#include "soc/i2s_reg.h" #include "soc/i2s_reg.h"
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"
#include "hal/wdt_hal.h" #include "hal/wdt_hal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_clock.h" #include "bootloader_clock.h"
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"

View File

@ -23,7 +23,7 @@
#include "soc/rtc_periph.h" #include "soc/rtc_periph.h"
#include "hal/cpu_hal.h" #include "hal/cpu_hal.h"
#include "hal/wdt_hal.h" #include "hal/wdt_hal.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "bootloader_clock.h" #include "bootloader_clock.h"
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"
#include "esp_rom_uart.h" #include "esp_rom_uart.h"

View File

@ -22,7 +22,7 @@
#include "esp_freertos_hooks.h" #include "esp_freertos_hooks.h"
#include "soc/timer_periph.h" #include "soc/timer_periph.h"
#include "esp_log.h" #include "esp_log.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_task_wdt.h" #include "esp_task_wdt.h"
#include "esp_private/system_internal.h" #include "esp_private/system_internal.h"
#include "esp_private/crosscore_int.h" #include "esp_private/crosscore_int.h"

View File

@ -14,7 +14,7 @@
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp32/clk.h" #include "esp32/clk.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "soc/soc.h" #include "soc/soc.h"
#include "soc/timer_group_reg.h" #include "soc/timer_group_reg.h"
#include "soc/rtc.h" #include "soc/rtc.h"

View File

@ -1,16 +1,8 @@
// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
@ -42,7 +34,7 @@
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"
#include "hal/interrupt_controller_hal.h" #include "hal/interrupt_controller_hal.h"
#include "phy_init_data.h" #include "phy_init_data.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "nvs.h" #include "nvs.h"
#include "os.h" #include "os.h"
#include "esp_smartconfig.h" #include "esp_smartconfig.h"

View File

@ -36,7 +36,7 @@
#include "soc/rtc.h" #include "soc/rtc.h"
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"
#include "phy_init_data.h" #include "phy_init_data.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "nvs.h" #include "nvs.h"
#include "os.h" #include "os.h"
#include "esp_smartconfig.h" #include "esp_smartconfig.h"

View File

@ -36,7 +36,7 @@
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"
#include "hal/interrupt_controller_hal.h" #include "hal/interrupt_controller_hal.h"
#include "phy_init_data.h" #include "phy_init_data.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "nvs.h" #include "nvs.h"
#include "os.h" #include "os.h"
#include "esp_smartconfig.h" #include "esp_smartconfig.h"

View File

@ -1,16 +1,8 @@
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
@ -44,7 +36,7 @@
#include "soc/syscon_reg.h" #include "soc/syscon_reg.h"
#include "hal/interrupt_controller_hal.h" #include "hal/interrupt_controller_hal.h"
#include "phy_init_data.h" #include "phy_init_data.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "nvs.h" #include "nvs.h"
#include "os.h" #include "os.h"
#include "esp_smartconfig.h" #include "esp_smartconfig.h"

View File

@ -38,7 +38,7 @@
#include "soc/cpu.h" #include "soc/cpu.h"
#include <stdio.h> #include <stdio.h>
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
/* AES uses a spinlock mux not a lock as the underlying block operation /* AES uses a spinlock mux not a lock as the underlying block operation

View File

@ -29,7 +29,7 @@
#include <string.h> #include <string.h>
#include "mbedtls/aes.h" #include "mbedtls/aes.h"
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_log.h" #include "esp_log.h"
#include "soc/lldesc.h" #include "soc/lldesc.h"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"

View File

@ -23,7 +23,7 @@
#include "soc/hwcrypto_periph.h" #include "soc/hwcrypto_periph.h"
#include "soc/dport_reg.h" #include "soc/dport_reg.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include <mbedtls/bignum.h> #include <mbedtls/bignum.h>
#include "bignum_impl.h" #include "bignum_impl.h"
#include <sys/param.h> #include <sys/param.h>

View File

@ -23,7 +23,7 @@
#include <string.h> #include <string.h>
#include <sys/param.h> #include <sys/param.h>
#include "soc/hwcrypto_periph.h" #include "soc/hwcrypto_periph.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "mbedtls/bignum.h" #include "mbedtls/bignum.h"
#include "bignum_impl.h" #include "bignum_impl.h"
#include "soc/system_reg.h" #include "soc/system_reg.h"

View File

@ -23,7 +23,7 @@
#include <string.h> #include <string.h>
#include <sys/param.h> #include <sys/param.h>
#include "soc/hwcrypto_periph.h" #include "soc/hwcrypto_periph.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "mbedtls/bignum.h" #include "mbedtls/bignum.h"
#include "bignum_impl.h" #include "bignum_impl.h"
#include "soc/system_reg.h" #include "soc/system_reg.h"

View File

@ -21,7 +21,7 @@
* *
*/ */
#include "soc/hwcrypto_periph.h" #include "soc/hwcrypto_periph.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include <mbedtls/bignum.h> #include <mbedtls/bignum.h>
#include "bignum_impl.h" #include "bignum_impl.h"
#include "soc/dport_reg.h" #include "soc/dport_reg.h"

View File

@ -21,7 +21,7 @@
* *
*/ */
#include "soc/hwcrypto_periph.h" #include "soc/hwcrypto_periph.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include <mbedtls/bignum.h> #include <mbedtls/bignum.h>
#include "bignum_impl.h" #include "bignum_impl.h"
#include "soc/dport_reg.h" #include "soc/dport_reg.h"

View File

@ -38,7 +38,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/semphr.h" #include "freertos/semphr.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "sys/param.h" #include "sys/param.h"
#include "sha/sha_dma.h" #include "sha/sha_dma.h"

View File

@ -37,7 +37,7 @@
#include "hal/sha_types.h" #include "hal/sha_types.h"
#include "sha/sha_parallel_engine.h" #include "sha/sha_parallel_engine.h"
#include "soc/hwcrypto_periph.h" #include "soc/hwcrypto_periph.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
/* /*
Single spinlock for SHA engine memory block Single spinlock for SHA engine memory block

View File

@ -1,20 +1,12 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
#include "sdkconfig.h" #include "sdkconfig.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_check.h" #include "esp_check.h"
#include "esp_rom_gpio.h" #include "esp_rom_gpio.h"

@ -1 +1 @@
Subproject commit c4badd394eda18199c0196ed0be1e2d635f0a5f6 Subproject commit 68f6ef679000f9cd22b20af7473d7f0480d2862e

View File

@ -19,7 +19,7 @@
#include "hal/usb_types_private.h" #include "hal/usb_types_private.h"
#include "soc/gpio_pins.h" #include "soc/gpio_pins.h"
#include "soc/gpio_sig_map.h" #include "soc/gpio_sig_map.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "hcd.h" #include "hcd.h"
#include "usb_private.h" #include "usb_private.h"
#include "usb/usb_types_ch9.h" #include "usb/usb_types_ch9.h"

View File

@ -9,7 +9,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_check.h" #include "esp_check.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "esp_private/usb_phy.h" #include "esp_private/usb_phy.h"
#include "soc/usb_phy_periph.h" #include "soc/usb_phy_periph.h"
#include "hal/usb_phy_hal.h" #include "hal/usb_phy_hal.h"

View File

@ -62,6 +62,7 @@ This is the documentation for Espressif IoT Development Framework (`esp-idf <htt
API Reference <api-reference/index> API Reference <api-reference/index>
H/W Reference <hw-reference/index> H/W Reference <hw-reference/index>
API Guides <api-guides/index> API Guides <api-guides/index>
ESP-IDF 5.0 Migration Guides <migration-guides/index>
Libraries and Frameworks <libraries-and-frameworks/index> Libraries and Frameworks <libraries-and-frameworks/index>
Contribute <contribute/index> Contribute <contribute/index>
Versions <versions> Versions <versions>

View File

@ -0,0 +1,8 @@
ESP-IDF 5.0 Migration Guides
****************************
:link_to_translation:`zh_CN:[中文]`
.. toctree::
:maxdepth: 1
Peripherals <peripherals>

View File

@ -0,0 +1,9 @@
Migrate Peripherals to ESP-IDF 5.0
==================================
Peripheral Clock Gating
-----------------------
As usual, peripheral clock gating is still handled by driver itself, users don't need to take care of the peripheral module clock gating.
However, for advanced users who implement their own drivers based on ``hal`` and ``soc`` components, the previous clock gating include path has been changed from ``driver/periph_ctrl.h`` to ``esp_private/periph_ctrl.h``.

View File

@ -62,6 +62,7 @@ ESP-IDF 编程指南
API 参考 <api-reference/index> API 参考 <api-reference/index>
H/W 参考 <hw-reference/index> H/W 参考 <hw-reference/index>
API 指南 <api-guides/index> API 指南 <api-guides/index>
ESP-IDF 5.0 迁移指南 <migration-guides/index>
Libraries and Frameworks <libraries-and-frameworks/index> Libraries and Frameworks <libraries-and-frameworks/index>
贡献代码 <contribute/index> 贡献代码 <contribute/index>
版本 <versions> 版本 <versions>

View File

@ -0,0 +1,8 @@
ESP-IDF 5.0 迁移指南
********************
:link_to_translation:`zh_CN:[中文]`
.. toctree::
:maxdepth: 1
外设 <peripherals>

View File

@ -0,0 +1 @@
.. include:: ../../en/migration-guides/peripherals.rst

View File

@ -14,7 +14,6 @@
#include "soc/ledc_reg.h" #include "soc/ledc_reg.h"
#include "soc/timer_group_struct.h" #include "soc/timer_group_struct.h"
#include "soc/ledc_struct.h" #include "soc/ledc_struct.h"
#include "driver/periph_ctrl.h"
#include "driver/timer.h" #include "driver/timer.h"
#include "driver/ledc.h" #include "driver/ledc.h"
#include "iot_light.h" #include "iot_light.h"

View File

@ -10,7 +10,7 @@
#include "esp_bt.h" #include "esp_bt.h"
#include "soc/uhci_periph.h" #include "soc/uhci_periph.h"
#include "driver/uart.h" #include "driver/uart.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h" // for enabling UHCI module, remove it after UHCI driver is released
#include "esp_log.h" #include "esp_log.h"
static const char *tag = "CONTROLLER_UART_HCI"; static const char *tag = "CONTROLLER_UART_HCI";

View File

@ -7,7 +7,7 @@
*/ */
#include <string.h> #include <string.h>
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h" // for enabling UHCI module, remove it after UHCI driver is released
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/uart.h" #include "driver/uart.h"
#include "soc/lldesc.h" #include "soc/lldesc.h"

View File

@ -592,7 +592,6 @@ components/esp_eth/include/eth_phy_regs_struct.h
components/esp_eth/src/dm9051.h components/esp_eth/src/dm9051.h
components/esp_eth/src/esp_eth.c components/esp_eth/src/esp_eth.c
components/esp_eth/src/esp_eth_mac_dm9051.c components/esp_eth/src/esp_eth_mac_dm9051.c
components/esp_eth/src/esp_eth_mac_esp.c
components/esp_eth/src/esp_eth_mac_openeth.c components/esp_eth/src/esp_eth_mac_openeth.c
components/esp_eth/src/esp_eth_mac_w5500.c components/esp_eth/src/esp_eth_mac_w5500.c
components/esp_eth/src/esp_eth_netif_glue.c components/esp_eth/src/esp_eth_netif_glue.c
@ -906,7 +905,6 @@ components/esp_rom/test/test_tjpgd.c
components/esp_serial_slave_link/essl.c components/esp_serial_slave_link/essl.c
components/esp_serial_slave_link/essl_internal.h components/esp_serial_slave_link/essl_internal.h
components/esp_serial_slave_link/essl_sdio.c components/esp_serial_slave_link/essl_sdio.c
components/esp_serial_slave_link/essl_spi.c
components/esp_serial_slave_link/include/esp_serial_slave_link/essl.h components/esp_serial_slave_link/include/esp_serial_slave_link/essl.h
components/esp_serial_slave_link/include/esp_serial_slave_link/essl_sdio.h components/esp_serial_slave_link/include/esp_serial_slave_link/essl_sdio.h
components/esp_serial_slave_link/include/esp_serial_slave_link/essl_spi.h components/esp_serial_slave_link/include/esp_serial_slave_link/essl_spi.h
@ -941,30 +939,25 @@ components/esp_system/port/public_compat/cache_err_int.h
components/esp_system/port/public_compat/trax.h components/esp_system/port/public_compat/trax.h
components/esp_system/port/soc/esp32/cache_err_int.c components/esp_system/port/soc/esp32/cache_err_int.c
components/esp_system/port/soc/esp32/cache_err_int.h components/esp_system/port/soc/esp32/cache_err_int.h
components/esp_system/port/soc/esp32/clk.c
components/esp_system/port/soc/esp32/intr.c components/esp_system/port/soc/esp32/intr.c
components/esp_system/port/soc/esp32/reset_reason.c components/esp_system/port/soc/esp32/reset_reason.c
components/esp_system/port/soc/esp32/system_internal.c components/esp_system/port/soc/esp32/system_internal.c
components/esp_system/port/soc/esp32c3/apb_backup_dma.c components/esp_system/port/soc/esp32c3/apb_backup_dma.c
components/esp_system/port/soc/esp32c3/cache_err_int.c components/esp_system/port/soc/esp32c3/cache_err_int.c
components/esp_system/port/soc/esp32c3/cache_err_int.h components/esp_system/port/soc/esp32c3/cache_err_int.h
components/esp_system/port/soc/esp32c3/clk.c
components/esp_system/port/soc/esp32c3/reset_reason.c components/esp_system/port/soc/esp32c3/reset_reason.c
components/esp_system/port/soc/esp32c3/system_internal.c components/esp_system/port/soc/esp32c3/system_internal.c
components/esp_system/port/soc/esp32h2/apb_backup_dma.c components/esp_system/port/soc/esp32h2/apb_backup_dma.c
components/esp_system/port/soc/esp32h2/cache_err_int.c components/esp_system/port/soc/esp32h2/cache_err_int.c
components/esp_system/port/soc/esp32h2/cache_err_int.h components/esp_system/port/soc/esp32h2/cache_err_int.h
components/esp_system/port/soc/esp32h2/clk.c
components/esp_system/port/soc/esp32h2/reset_reason.c components/esp_system/port/soc/esp32h2/reset_reason.c
components/esp_system/port/soc/esp32h2/system_internal.c components/esp_system/port/soc/esp32h2/system_internal.c
components/esp_system/port/soc/esp32s2/cache_err_int.c components/esp_system/port/soc/esp32s2/cache_err_int.c
components/esp_system/port/soc/esp32s2/cache_err_int.h components/esp_system/port/soc/esp32s2/cache_err_int.h
components/esp_system/port/soc/esp32s2/clk.c
components/esp_system/port/soc/esp32s2/reset_reason.c components/esp_system/port/soc/esp32s2/reset_reason.c
components/esp_system/port/soc/esp32s2/system_internal.c components/esp_system/port/soc/esp32s2/system_internal.c
components/esp_system/port/soc/esp32s2/usb_console.c components/esp_system/port/soc/esp32s2/usb_console.c
components/esp_system/port/soc/esp32s3/cache_err_int.h components/esp_system/port/soc/esp32s3/cache_err_int.h
components/esp_system/port/soc/esp32s3/clk.c
components/esp_system/port/soc/esp32s3/reset_reason.c components/esp_system/port/soc/esp32s3/reset_reason.c
components/esp_system/port/soc/esp32s3/system_internal.c components/esp_system/port/soc/esp32s3/system_internal.c
components/esp_system/port/soc/esp32s3/usb_console.c components/esp_system/port/soc/esp32s3/usb_console.c
@ -987,8 +980,6 @@ components/esp_timer/test/test_ets_timer.c
components/esp_websocket_client/esp_websocket_client.c components/esp_websocket_client/esp_websocket_client.c
components/esp_websocket_client/include/esp_websocket_client.h components/esp_websocket_client/include/esp_websocket_client.h
components/esp_websocket_client/test/test_websocket_client.c components/esp_websocket_client/test/test_websocket_client.c
components/esp_wifi/esp32/esp_adapter.c
components/esp_wifi/esp32s3/esp_adapter.c
components/esp_wifi/include/esp_coexist_adapter.h components/esp_wifi/include/esp_coexist_adapter.h
components/esp_wifi/include/esp_mesh.h components/esp_wifi/include/esp_mesh.h
components/esp_wifi/include/esp_mesh_internal.h components/esp_wifi/include/esp_mesh_internal.h
@ -2434,7 +2425,6 @@ components/tinyusb/additions/include_private/descriptors_control.h
components/tinyusb/additions/include_private/usb_descriptors.h components/tinyusb/additions/include_private/usb_descriptors.h
components/tinyusb/additions/src/cdc.c components/tinyusb/additions/src/cdc.c
components/tinyusb/additions/src/descriptors_control.c components/tinyusb/additions/src/descriptors_control.c
components/tinyusb/additions/src/tinyusb.c
components/tinyusb/additions/src/tusb_cdc_acm.c components/tinyusb/additions/src/tusb_cdc_acm.c
components/tinyusb/additions/src/tusb_console.c components/tinyusb/additions/src/tusb_console.c
components/tinyusb/additions/src/tusb_tasks.c components/tinyusb/additions/src/tusb_tasks.c
@ -3753,7 +3743,6 @@ tools/unit-test-app/components/test_utils/ccomp_timer_impl_xtensa.c
tools/unit-test-app/components/test_utils/include/ccomp_timer.h tools/unit-test-app/components/test_utils/include/ccomp_timer.h
tools/unit-test-app/components/test_utils/include/test_utils.h tools/unit-test-app/components/test_utils/include/test_utils.h
tools/unit-test-app/components/test_utils/private_include/ccomp_timer_impl.h tools/unit-test-app/components/test_utils/private_include/ccomp_timer_impl.h
tools/unit-test-app/components/test_utils/ref_clock_impl_rmt_pcnt.c
tools/unit-test-app/components/test_utils/test/ccomp_timer_test_api.c tools/unit-test-app/components/test_utils/test/ccomp_timer_test_api.c
tools/unit-test-app/components/test_utils/test/ccomp_timer_test_data.c tools/unit-test-app/components/test_utils/test/ccomp_timer_test_data.c
tools/unit-test-app/components/test_utils/test/ccomp_timer_test_inst.c tools/unit-test-app/components/test_utils/test/ccomp_timer_test_inst.c

View File

@ -1,16 +1,8 @@
// Copyright 2017-2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// 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.
/** /**
* Some unit test cases need to have access to reliable timestamps even when CPU and APB clock frequencies change over time. * Some unit test cases need to have access to reliable timestamps even when CPU and APB clock frequencies change over time.
@ -31,7 +23,7 @@
#include "test_utils.h" #include "test_utils.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "soc/gpio_sig_map.h" #include "soc/gpio_sig_map.h"
#include "soc/gpio_periph.h" #include "soc/gpio_periph.h"
#include "soc/soc_caps.h" #include "soc/soc_caps.h"

View File

@ -5,7 +5,7 @@
*/ */
#include "test_utils.h" #include "test_utils.h"
#include "driver/periph_ctrl.h" #include "esp_private/periph_ctrl.h"
#include "soc/periph_defs.h" #include "soc/periph_defs.h"
#include "hal/timer_hal.h" #include "hal/timer_hal.h"
#include "hal/timer_ll.h" #include "hal/timer_ll.h"