mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
refactor(gpio): make gpio driver as component, and fix astyle
This commit is contained in:
parent
342535f47c
commit
9461993ec5
@ -64,7 +64,7 @@ idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "${include_dirs}"
|
||||
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
|
||||
# Requires "driver" for GPTimer in "SEGGER_SYSVIEW_Config_FreeRTOS.c"
|
||||
PRIV_REQUIRES soc driver
|
||||
PRIV_REQUIRES soc driver esp_driver_gpio
|
||||
REQUIRES esp_timer
|
||||
LDFRAGMENTS linker.lf)
|
||||
|
||||
|
@ -6,9 +6,6 @@ endif()
|
||||
|
||||
# Always compiled source files
|
||||
set(srcs
|
||||
"gpio/gpio.c"
|
||||
"gpio/gpio_glitch_filter_ops.c"
|
||||
"gpio/rtc_io.c"
|
||||
"spi/spi_bus_lock.c")
|
||||
|
||||
# Always included headers
|
||||
@ -16,7 +13,6 @@ set(includes "include"
|
||||
"deprecated"
|
||||
"analog_comparator/include"
|
||||
"dac/include"
|
||||
"gpio/include"
|
||||
"gptimer/include"
|
||||
"i2c/include"
|
||||
"i2s/include"
|
||||
@ -35,8 +31,7 @@ set(includes "include"
|
||||
"usb_serial_jtag/include")
|
||||
|
||||
# Always included linker fragments
|
||||
set(ldfragments "linker.lf"
|
||||
"gpio/linker.lf")
|
||||
set(ldfragments "linker.lf")
|
||||
|
||||
# ADC related source files (dprecated)
|
||||
if(CONFIG_SOC_ADC_SUPPORTED)
|
||||
@ -71,23 +66,6 @@ if(CONFIG_SOC_PARLIO_SUPPORTED)
|
||||
list(APPEND srcs "parlio/parlio_common.c" "parlio/parlio_tx.c")
|
||||
endif()
|
||||
|
||||
# GPIO related source files
|
||||
if(CONFIG_SOC_DEDICATED_GPIO_SUPPORTED)
|
||||
list(APPEND srcs "gpio/dedic_gpio.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER)
|
||||
list(APPEND srcs "gpio/gpio_pin_glitch_filter.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_GPIO_FLEX_GLITCH_FILTER_NUM GREATER 0)
|
||||
list(APPEND srcs "gpio/gpio_flex_glitch_filter.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_GPIO_SUPPORT_ETM)
|
||||
list(APPEND srcs "gpio/gpio_etm.c")
|
||||
endif()
|
||||
|
||||
# GPTimer related source files
|
||||
if(CONFIG_SOC_GPTIMER_SUPPORTED)
|
||||
list(APPEND srcs "gptimer/gptimer.c"
|
||||
@ -248,7 +226,7 @@ else()
|
||||
REQUIRES esp_pm esp_ringbuf freertos soc hal esp_hw_support
|
||||
# for backward compatibility, the driver component needs to
|
||||
# have a public dependency on other "esp_driver_foo" components
|
||||
esp_driver_pcnt
|
||||
esp_driver_gpio esp_driver_pcnt
|
||||
LDFRAGMENTS ${ldfragments}
|
||||
)
|
||||
endif()
|
||||
|
@ -156,24 +156,6 @@ menu "Driver Configurations"
|
||||
|
||||
orsource "./uart/Kconfig.uart"
|
||||
|
||||
menu "GPIO Configuration"
|
||||
config GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL
|
||||
bool "Support light sleep GPIO pullup/pulldown configuration for ESP32"
|
||||
depends on IDF_TARGET_ESP32
|
||||
help
|
||||
This option is intended to fix the bug that ESP32 is not able to switch to configured
|
||||
pullup/pulldown mode in sleep.
|
||||
If this option is selected, chip will automatically emulate the behaviour of switching,
|
||||
and about 450B of source codes would be placed into IRAM.
|
||||
|
||||
config GPIO_CTRL_FUNC_IN_IRAM
|
||||
bool "Place GPIO control functions into IRAM"
|
||||
default n
|
||||
help
|
||||
Place GPIO control functions (like intr_disable/set_level) into IRAM,
|
||||
so that these functions can be IRAM-safe and able to be called in the other IRAM interrupt context.
|
||||
endmenu # GPIO Configuration
|
||||
|
||||
menu "Sigma Delta Modulator Configuration"
|
||||
depends on SOC_SDM_SUPPORTED
|
||||
config SDM_CTRL_FUNC_IN_IRAM
|
||||
|
@ -16,12 +16,6 @@ components/driver/test_apps/dac_test_apps/legacy_dac_driver:
|
||||
disable:
|
||||
- if: SOC_DAC_SUPPORTED != 1
|
||||
|
||||
components/driver/test_apps/gpio_extensions:
|
||||
disable:
|
||||
- if: IDF_TARGET == "esp32p4"
|
||||
temporary: true
|
||||
reason: not supported yet # TODO: IDF-7551
|
||||
|
||||
components/driver/test_apps/gptimer:
|
||||
disable:
|
||||
- if: SOC_GPTIMER_SUPPORTED != 1
|
||||
@ -97,6 +91,14 @@ components/driver/test_apps/legacy_rtc_temp_driver:
|
||||
disable:
|
||||
- if: SOC_TEMP_SENSOR_SUPPORTED != 1
|
||||
|
||||
components/driver/test_apps/legacy_sigma_delta_driver:
|
||||
disable:
|
||||
- if: SOC_SDM_SUPPORTED != 1
|
||||
depends_filepatterns:
|
||||
- components/driver/deprecated/**/*
|
||||
depends_components:
|
||||
- esp_driver_gpio
|
||||
|
||||
components/driver/test_apps/legacy_timer_driver:
|
||||
disable:
|
||||
- if: SOC_GPTIMER_SUPPORTED != 1
|
||||
@ -119,9 +121,7 @@ components/driver/test_apps/rmt:
|
||||
|
||||
components/driver/test_apps/rs485:
|
||||
disable:
|
||||
- if: IDF_TARGET in ["esp32p4"]
|
||||
temporary: true
|
||||
reason: target(s) is not supported yet # TODO: IDF-6511
|
||||
- if: SOC_UART_SUPPORTED != 1
|
||||
disable_test:
|
||||
- if: IDF_TARGET != "esp32"
|
||||
temporary: true
|
||||
@ -135,6 +135,14 @@ components/driver/test_apps/sdio:
|
||||
temporary: true
|
||||
reason: lack of runners
|
||||
|
||||
components/driver/test_apps/sigma_delta:
|
||||
disable:
|
||||
- if: SOC_SDM_SUPPORTED != 1
|
||||
depends_filepatterns:
|
||||
- components/driver/sigma_delta/**/*
|
||||
depends_components:
|
||||
- esp_driver_gpio
|
||||
|
||||
components/driver/test_apps/spi/master:
|
||||
disable:
|
||||
- if: SOC_GPSPI_SUPPORTED != 1
|
||||
@ -174,17 +182,14 @@ components/driver/test_apps/twai:
|
||||
components/driver/test_apps/uart:
|
||||
disable:
|
||||
- if: SOC_UART_SUPPORTED != 1
|
||||
- if: IDF_TARGET in ["esp32p4"]
|
||||
temporary: true
|
||||
reason: target(s) is not supported yet # TODO: IDF-6511
|
||||
|
||||
components/driver/test_apps/usb_serial_jtag:
|
||||
disable:
|
||||
- if: SOC_USB_SERIAL_JTAG_SUPPORTED != 1
|
||||
depends_filepatterns:
|
||||
- components/driver/gpio/**/*
|
||||
- components/driver/usb_serial_jtag/**/*
|
||||
depends_components:
|
||||
- hal
|
||||
- esp_hw_support # for clock
|
||||
- vfs
|
||||
- esp_driver_gpio
|
||||
|
@ -1,2 +0,0 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
@ -0,0 +1,8 @@
|
||||
# This is the project CMakeLists.txt file for the test subproject
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
|
||||
set(COMPONENTS main)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(legacy_sigma_delta_driver_test)
|
@ -0,0 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |
|
@ -0,0 +1,11 @@
|
||||
set(srcs "test_app_main.c")
|
||||
|
||||
if(CONFIG_SOC_SDM_SUPPORTED)
|
||||
list(APPEND srcs "test_sigma_delta_legacy.c")
|
||||
endif()
|
||||
|
||||
# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
|
||||
# the component can be registered as WHOLE_ARCHIVE
|
||||
idf_component_register(SRCS ${srcs}
|
||||
PRIV_REQUIRES unity driver esp_driver_gpio
|
||||
WHOLE_ARCHIVE)
|
@ -0,0 +1,22 @@
|
||||
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded_idf import IdfDut
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True)
|
||||
def test_legacy_sigma_delta(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(group='sigma_delta')
|
@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
@ -5,13 +5,13 @@ cmake_minimum_required(VERSION 3.16)
|
||||
set(COMPONENTS main)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(gpio_test)
|
||||
project(sigma_delta_test)
|
||||
|
||||
if(CONFIG_COMPILER_DUMP_RTL_FILES)
|
||||
add_custom_target(check_test_app_sections ALL
|
||||
COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py
|
||||
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/
|
||||
--elf-file ${CMAKE_BINARY_DIR}/gpio_test.elf
|
||||
--elf-file ${CMAKE_BINARY_DIR}/sigma_delta_test.elf
|
||||
find-refs
|
||||
--from-sections=.iram0.text
|
||||
--to-sections=.flash.text,.flash.rodata
|
2
components/driver/test_apps/sigma_delta/README.md
Normal file
2
components/driver/test_apps/sigma_delta/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |
|
11
components/driver/test_apps/sigma_delta/main/CMakeLists.txt
Normal file
11
components/driver/test_apps/sigma_delta/main/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
set(srcs "test_app_main.c")
|
||||
|
||||
if(CONFIG_SOC_SDM_SUPPORTED)
|
||||
list(APPEND srcs "test_sdm.c")
|
||||
endif()
|
||||
|
||||
# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
|
||||
# the component can be registered as WHOLE_ARCHIVE
|
||||
idf_component_register(SRCS ${srcs}
|
||||
PRIV_REQUIRES unity driver
|
||||
WHOLE_ARCHIVE)
|
@ -0,0 +1,23 @@
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded_idf import IdfDut
|
||||
|
||||
CONFIGS = [
|
||||
'iram_safe',
|
||||
'release',
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', CONFIGS, indirect=True)
|
||||
def test_sdm(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(group='sdm')
|
@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
@ -42,5 +42,5 @@ endif()
|
||||
|
||||
idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS ${includes}
|
||||
PRIV_REQUIRES driver efuse
|
||||
PRIV_REQUIRES driver esp_driver_gpio efuse esp_pm esp_ringbuf
|
||||
LDFRAGMENTS linker.lf)
|
||||
|
@ -6,8 +6,8 @@ components/esp_adc/test_apps/adc:
|
||||
- if: CONFIG_NAME == "gdma_iram_safe" and IDF_TARGET in ["esp32", "esp32s2", "esp32c2"]
|
||||
depends_components:
|
||||
- esp_adc
|
||||
- esp_driver_gpio
|
||||
- efuse
|
||||
depends_filepatterns:
|
||||
- components/driver/gpio/**/*
|
||||
- components/driver/spi/**/* # ADC continuous driver relies on SPI on ESP32S2
|
||||
- components/driver/i2s/**/* # ADC continuous driver relies on I2S on ESP32
|
||||
|
33
components/esp_driver_gpio/CMakeLists.txt
Normal file
33
components/esp_driver_gpio/CMakeLists.txt
Normal file
@ -0,0 +1,33 @@
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
|
||||
if(${target} STREQUAL "linux")
|
||||
return() # This component is not supported by the POSIX/Linux simulator
|
||||
endif()
|
||||
|
||||
set(srcs "src/gpio.c"
|
||||
"src/gpio_glitch_filter_ops.c"
|
||||
"src/rtc_io.c"
|
||||
)
|
||||
set(public_include "include")
|
||||
|
||||
if(CONFIG_SOC_DEDICATED_GPIO_SUPPORTED)
|
||||
list(APPEND srcs "src/dedic_gpio.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER)
|
||||
list(APPEND srcs "src/gpio_pin_glitch_filter.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_GPIO_FLEX_GLITCH_FILTER_NUM GREATER 0)
|
||||
list(APPEND srcs "src/gpio_flex_glitch_filter.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_GPIO_SUPPORT_ETM)
|
||||
list(APPEND srcs "src/gpio_etm.c")
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS ${public_include}
|
||||
PRIV_REQUIRES esp_pm
|
||||
LDFRAGMENTS "linker.lf"
|
||||
)
|
17
components/esp_driver_gpio/Kconfig
Normal file
17
components/esp_driver_gpio/Kconfig
Normal file
@ -0,0 +1,17 @@
|
||||
menu "ESP-Driver:GPIO Configurations"
|
||||
config GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL
|
||||
bool "Support light sleep GPIO pullup/pulldown configuration for ESP32"
|
||||
depends on IDF_TARGET_ESP32
|
||||
help
|
||||
This option is intended to fix the bug that ESP32 is not able to switch to configured
|
||||
pullup/pulldown mode in sleep.
|
||||
If this option is selected, chip will automatically emulate the behaviour of switching,
|
||||
and about 450B of source codes would be placed into IRAM.
|
||||
|
||||
config GPIO_CTRL_FUNC_IN_IRAM
|
||||
bool "Place GPIO control functions into IRAM"
|
||||
default n
|
||||
help
|
||||
Place GPIO control functions (like intr_disable/set_level) into IRAM,
|
||||
so that these functions can be IRAM-safe and able to be called in the other IRAM interrupt context.
|
||||
endmenu
|
@ -13,7 +13,6 @@
|
||||
#include "hal/rtc_io_types.h"
|
||||
#include "driver/gpio.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
@ -1,9 +1,10 @@
|
||||
[mapping:gpio_driver]
|
||||
archive: libdriver.a
|
||||
archive: libesp_driver_gpio.a
|
||||
entries:
|
||||
if GPIO_CTRL_FUNC_IN_IRAM = y:
|
||||
gpio: gpio_set_level (noflash)
|
||||
gpio: gpio_intr_disable (noflash)
|
||||
gpio: gpio_get_level (noflash)
|
||||
|
||||
[mapping:gpio_hal]
|
||||
archive: libhal.a
|
@ -31,7 +31,6 @@
|
||||
#include "hal/dedic_gpio_ll.h"
|
||||
#endif
|
||||
|
||||
|
||||
static const char *TAG = "dedic_gpio";
|
||||
|
||||
typedef struct dedic_gpio_platform_t dedic_gpio_platform_t;
|
||||
@ -349,7 +348,6 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
esp_err_t dedic_gpio_get_out_offset(dedic_gpio_bundle_handle_t bundle, uint32_t *offset)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
@ -10,8 +10,7 @@
|
||||
#include "esp_heap_caps.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/rtc_io.h"
|
||||
#include "soc/soc.h"
|
||||
#include "soc/periph_defs.h"
|
||||
#include "soc/interrupts.h"
|
||||
#if !CONFIG_FREERTOS_UNICORE
|
||||
#include "esp_ipc.h"
|
||||
#endif
|
||||
@ -166,7 +165,7 @@ esp_err_t gpio_set_intr_type(gpio_num_t gpio_num, gpio_int_type_t intr_type)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t gpio_intr_enable_on_core(gpio_num_t gpio_num, uint32_t core_id)
|
||||
static inline esp_err_t gpio_intr_enable_on_core(gpio_num_t gpio_num, uint32_t core_id)
|
||||
{
|
||||
gpio_hal_intr_enable_on_core(gpio_context.gpio_hal, gpio_num, core_id);
|
||||
return ESP_OK;
|
||||
@ -577,7 +576,6 @@ void gpio_uninstall_isr_service(void)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void gpio_isr_register_on_core_static(void *param)
|
||||
{
|
||||
gpio_isr_alloc_t *p = (gpio_isr_alloc_t *)param;
|
@ -7,7 +7,7 @@
|
||||
#include <sys/cdefs.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "esp_check.h"
|
||||
#include "glitch_filter_priv.h"
|
||||
#include "esp_private/glitch_filter_priv.h"
|
||||
#include "esp_private/io_mux.h"
|
||||
#include "soc/soc_caps.h"
|
||||
#include "hal/gpio_glitch_filter_ll.h"
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "esp_check.h"
|
||||
#include "glitch_filter_priv.h"
|
||||
#include "esp_private/glitch_filter_priv.h"
|
||||
|
||||
static const char *TAG = "gpio-filter";
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_pm.h"
|
||||
#include "glitch_filter_priv.h"
|
||||
#include "esp_private/glitch_filter_priv.h"
|
||||
#include "hal/gpio_ll.h"
|
||||
#include "esp_clk_tree.h"
|
||||
#include "esp_private/io_mux.h"
|
10
components/esp_driver_gpio/test_apps/.build-test-rules.yml
Normal file
10
components/esp_driver_gpio/test_apps/.build-test-rules.yml
Normal file
@ -0,0 +1,10 @@
|
||||
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
|
||||
|
||||
components/esp_driver_gpio/test_apps:
|
||||
depends_components:
|
||||
- esp_driver_gpio
|
||||
|
||||
components/esp_driver_gpio/test_apps/gpio_extensions:
|
||||
enable:
|
||||
- if: SOC_DEDICATED_GPIO_SUPPORTED == 1
|
||||
- if: SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER == 1 or SOC_GPIO_FLEX_GLITCH_FILTER_NUM > 0
|
21
components/esp_driver_gpio/test_apps/gpio/CMakeLists.txt
Normal file
21
components/esp_driver_gpio/test_apps/gpio/CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
# This is the project CMakeLists.txt file for the test subproject
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
|
||||
set(COMPONENTS main)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(gpio_test)
|
||||
|
||||
if(CONFIG_COMPILER_DUMP_RTL_FILES)
|
||||
add_custom_target(check_test_app_sections ALL
|
||||
COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py
|
||||
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gpio/,${CMAKE_BINARY_DIR}/esp-idf/hal/
|
||||
--elf-file ${CMAKE_BINARY_DIR}/gpio_test.elf
|
||||
find-refs
|
||||
--from-sections=.iram0.text
|
||||
--to-sections=.flash.text,.flash.rodata
|
||||
--exit-code
|
||||
DEPENDS ${elf}
|
||||
)
|
||||
endif()
|
@ -1,10 +1,6 @@
|
||||
set(srcs "test_app_main.c"
|
||||
"test_gpio.c")
|
||||
|
||||
if(CONFIG_SOC_SDM_SUPPORTED)
|
||||
list(APPEND srcs "test_sigma_delta_legacy.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_RTCIO_PIN_COUNT GREATER 0)
|
||||
list(APPEND srcs "test_rtcio.c")
|
||||
endif()
|
||||
@ -12,5 +8,5 @@ endif()
|
||||
# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
|
||||
# the component can be registered as WHOLE_ARCHIVE
|
||||
idf_component_register(SRCS ${srcs}
|
||||
PRIV_REQUIRES unity driver spi_flash
|
||||
PRIV_REQUIRES unity esp_driver_gpio spi_flash
|
||||
WHOLE_ARCHIVE)
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "unity.h"
|
||||
#include "unity_test_runner.h"
|
||||
#include "unity_test_utils.h"
|
||||
#include "esp_heap_caps.h"
|
||||
|
||||
// Some resources are lazy allocated in gpio/rtcio driver, the threshold is left for that case
|
||||
#define TEST_MEMORY_LEAK_THRESHOLD (100)
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
unity_utils_record_free_mem();
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
esp_reent_cleanup(); //clean up some of the newlib's lazy allocations
|
||||
unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD);
|
||||
}
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
unity_run_menu();
|
||||
}
|
@ -17,18 +17,6 @@ def test_gpio(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(group='gpio')
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', CONFIGS, indirect=True)
|
||||
def test_legacy_sigma_delta(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(group='sigma_delta')
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
@ -0,0 +1,5 @@
|
||||
CONFIG_PM_ENABLE=y
|
||||
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
|
||||
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
|
@ -0,0 +1,2 @@
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
CONFIG_ESP_TASK_WDT_EN=n
|
@ -10,7 +10,7 @@ project(gpio_extension_test)
|
||||
if(CONFIG_COMPILER_DUMP_RTL_FILES)
|
||||
add_custom_target(check_test_app_sections ALL
|
||||
COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py
|
||||
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/
|
||||
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gpio/,${CMAKE_BINARY_DIR}/esp-idf/hal/
|
||||
--elf-file ${CMAKE_BINARY_DIR}/gpio_extension_test.elf
|
||||
find-refs
|
||||
--from-sections=.iram0.text
|
@ -0,0 +1,2 @@
|
||||
| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
@ -8,10 +8,6 @@ if(CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER OR (CONFIG_SOC_GPIO_FLEX_GLITCH_FIL
|
||||
list(APPEND srcs "test_gpio_filter.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_SDM_SUPPORTED)
|
||||
list(APPEND srcs "test_sdm.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_GPIO_SUPPORT_PIN_HYS_FILTER)
|
||||
list(APPEND srcs "test_hysteresis.c")
|
||||
endif()
|
||||
@ -19,5 +15,5 @@ endif()
|
||||
# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
|
||||
# the component can be registered as WHOLE_ARCHIVE
|
||||
idf_component_register(SRCS ${srcs}
|
||||
PRIV_REQUIRES unity driver
|
||||
PRIV_REQUIRES unity esp_driver_gpio
|
||||
WHOLE_ARCHIVE)
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "unity.h"
|
||||
#include "unity_test_utils.h"
|
||||
#include "esp_heap_caps.h"
|
||||
|
||||
// Some resources are lazy allocated in the driver, the threshold is left for that case
|
||||
#define TEST_MEMORY_LEAK_THRESHOLD (300)
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
unity_utils_record_free_mem();
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
esp_reent_cleanup(); //clean up some of the newlib's lazy allocations
|
||||
unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD);
|
||||
}
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
// ____ ____ ___ ___ _____ _ _____ _
|
||||
// / ___| _ \_ _/ _ \ | ____|_ _| |_ |_ _|__ ___| |_
|
||||
// | | _| |_) | | | | | | _| \ \/ / __| | |/ _ \/ __| __|
|
||||
// | |_| | __/| | |_| | | |___ > <| |_ | | __/\__ \ |_
|
||||
// \____|_| |___\___/ |_____/_/\_\\__| |_|\___||___/\__|
|
||||
printf(" ____ ____ ___ ___ _____ _ _____ _\r\n");
|
||||
printf(" / ___| _ \\_ _/ _ \\ | ____|_ _| |_ |_ _|__ ___| |_\r\n");
|
||||
printf("| | _| |_) | | | | | | _| \\ \\/ / __| | |/ _ \\/ __| __|\r\n");
|
||||
printf("| |_| | __/| | |_| | | |___ > <| |_ | | __/\\__ \\ |_\r\n");
|
||||
printf(" \\____|_| |___\\___/ |_____/_/\\_\\\\__| |_|\\___||___/\\__|\r\n");
|
||||
unity_run_menu();
|
||||
}
|
@ -9,7 +9,6 @@
|
||||
#include "unity.h"
|
||||
#include "driver/gpio.h"
|
||||
|
||||
|
||||
/**
|
||||
* NOTE: To run this special feature test case, a slope analog signal is needed.
|
||||
* A simple RC circuit used here to formate pin switches to continuos slop signal.
|
||||
@ -29,7 +28,6 @@
|
||||
* which enabled the hysteresis feature directly to have a test.
|
||||
**/
|
||||
|
||||
|
||||
static void test_gpio_hysteresis_intr_handler(void *args)
|
||||
{
|
||||
esp_rom_printf("%d\n", ++ * ((uint32_t *)args));
|
||||
@ -43,7 +41,7 @@ TEST_CASE("GPIO Input hysteresis filter", "[gpio_filter][timeout=50][ignore]")
|
||||
uint32_t intr_cnt = 0;
|
||||
|
||||
gpio_config_t gpio_cfg = {
|
||||
.pin_bit_mask = 1 << TEST_WAVE_IO,
|
||||
.pin_bit_mask = (1 << TEST_WAVE_IO),
|
||||
.mode = GPIO_MODE_OUTPUT,
|
||||
.pull_down_en = GPIO_PULLDOWN_ENABLE,
|
||||
};
|
@ -10,19 +10,6 @@ CONFIGS = [
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32s2
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', CONFIGS, indirect=True)
|
||||
def test_sdm(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(group='sdm')
|
||||
|
||||
|
||||
@pytest.mark.esp32c2
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c6
|
@ -0,0 +1,9 @@
|
||||
CONFIG_COMPILER_DUMP_RTL_FILES=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_NONE=y
|
||||
# place non-ISR FreeRTOS functions in Flash
|
||||
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
|
||||
# silent the error check, as the error string are stored in rodata, causing RTL check failure
|
||||
CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
|
||||
# GPIO test uses IPC call, the default stack size of IPC task can satisfy the -O0 optimization
|
||||
CONFIG_ESP_IPC_TASK_STACK_SIZE=2048
|
@ -0,0 +1,5 @@
|
||||
CONFIG_PM_ENABLE=y
|
||||
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
|
||||
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
|
@ -0,0 +1,2 @@
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
CONFIG_ESP_TASK_WDT_EN=n
|
@ -11,7 +11,7 @@ else()
|
||||
idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS ${public_include}
|
||||
PRIV_REQUIRES "esp_pm"
|
||||
"driver" # will be replaced by esp_driver_gpio
|
||||
"esp_driver_gpio"
|
||||
LDFRAGMENTS "linker.lf"
|
||||
)
|
||||
endif()
|
||||
|
@ -67,7 +67,7 @@ endif()
|
||||
|
||||
if(CONFIG_ETH_ENABLED)
|
||||
if(CONFIG_ETH_USE_SPI_ETHERNET)
|
||||
idf_component_optional_requires(PUBLIC driver)
|
||||
idf_component_optional_requires(PUBLIC driver esp_driver_gpio)
|
||||
endif()
|
||||
idf_component_optional_requires(PRIVATE esp_netif esp_pm)
|
||||
endif()
|
||||
|
@ -50,8 +50,11 @@ if(NOT BOOTLOADER_BUILD)
|
||||
list(APPEND srcs "sleep_retention.c" "sleep_system_peripheral.c" "sleep_clock.c")
|
||||
endif()
|
||||
|
||||
# [refactor-todo]: requires "driver" for GPIO and RTC (by sleep_gpio and sleep_modes)
|
||||
list(APPEND priv_requires driver esp_timer)
|
||||
# [refactor-todo]
|
||||
list(APPEND priv_requires driver # for UART (by sleep_modes)
|
||||
esp_driver_gpio # for GPIO and RTC (by sleep_gpio and sleep_modes)
|
||||
esp_timer
|
||||
esp_pm)
|
||||
|
||||
list(APPEND priv_requires esp_mm)
|
||||
|
||||
|
@ -27,5 +27,5 @@ endif()
|
||||
idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS ${includes}
|
||||
PRIV_REQUIRES ${priv_requires}
|
||||
REQUIRES driver
|
||||
REQUIRES driver esp_driver_gpio
|
||||
LDFRAGMENTS linker.lf)
|
||||
|
@ -6,5 +6,5 @@ endif()
|
||||
|
||||
idf_component_register(SRCS "pm_locks.c" "pm_trace.c" "pm_impl.c"
|
||||
INCLUDE_DIRS include
|
||||
PRIV_REQUIRES esp_system driver esp_timer
|
||||
PRIV_REQUIRES esp_system driver esp_driver_gpio esp_timer
|
||||
LDFRAGMENTS linker.lf)
|
||||
|
@ -77,7 +77,7 @@ entries:
|
||||
esp_time_impl:esp_set_time_from_rtc (noflash)
|
||||
|
||||
[mapping:driver_pm]
|
||||
archive: libdriver.a
|
||||
archive: libesp_driver_gpio.a
|
||||
entries:
|
||||
if GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL = y:
|
||||
gpio:gpio_sleep_pupd_config_unapply (noflash)
|
||||
|
@ -30,7 +30,11 @@ idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS ${includes}
|
||||
PRIV_INCLUDE_DIRS ${priv_includes}
|
||||
LDFRAGMENTS linker.lf
|
||||
PRIV_REQUIRES esp_partition spi_flash bootloader_support mbedtls esp_rom soc esp_system driver)
|
||||
PRIV_REQUIRES esp_partition spi_flash bootloader_support mbedtls esp_rom soc esp_system
|
||||
esp_driver_gpio
|
||||
# [refactor-todo] esp_flash_internal.h -> spi_common_internal.h requires cleanup
|
||||
driver
|
||||
)
|
||||
|
||||
if(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::esp_app_format)
|
||||
|
@ -24,7 +24,7 @@ else()
|
||||
|
||||
list(APPEND requires "sdmmc")
|
||||
|
||||
list(APPEND priv_requires "vfs")
|
||||
list(APPEND priv_requires "vfs" "esp_driver_gpio")
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS ${srcs}
|
||||
|
@ -508,6 +508,7 @@ static inline void gpio_ll_set_level(gpio_dev_t *hw, uint32_t gpio_num, uint32_t
|
||||
* - 0 the GPIO input level is 0
|
||||
* - 1 the GPIO input level is 1
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline int gpio_ll_get_level(gpio_dev_t *hw, uint32_t gpio_num)
|
||||
{
|
||||
if (gpio_num < 32) {
|
||||
|
@ -332,6 +332,7 @@ static inline void gpio_ll_set_level(gpio_dev_t *hw, uint32_t gpio_num, uint32_t
|
||||
* - 0 the GPIO input level is 0
|
||||
* - 1 the GPIO input level is 1
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline int gpio_ll_get_level(gpio_dev_t *hw, uint32_t gpio_num)
|
||||
{
|
||||
return (hw->in.in_data_next >> gpio_num) & 0x1;
|
||||
|
@ -344,6 +344,7 @@ static inline void gpio_ll_set_level(gpio_dev_t *hw, uint32_t gpio_num, uint32_t
|
||||
* - 0 the GPIO input level is 0
|
||||
* - 1 the GPIO input level is 1
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline int gpio_ll_get_level(gpio_dev_t *hw, uint32_t gpio_num)
|
||||
{
|
||||
return (hw->in.data >> gpio_num) & 0x1;
|
||||
|
@ -338,6 +338,7 @@ static inline void gpio_ll_set_level(gpio_dev_t *hw, uint32_t gpio_num, uint32_t
|
||||
* - 0 the GPIO input level is 0
|
||||
* - 1 the GPIO input level is 1
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline int gpio_ll_get_level(gpio_dev_t *hw, uint32_t gpio_num)
|
||||
{
|
||||
return (hw->in.in_data_next >> gpio_num) & 0x1;
|
||||
|
@ -380,6 +380,7 @@ static inline void gpio_ll_set_level(gpio_dev_t *hw, gpio_num_t gpio_num, uint32
|
||||
* - 0 the GPIO input level is 0
|
||||
* - 1 the GPIO input level is 1
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline int gpio_ll_get_level(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||
{
|
||||
return (hw->in.in_data_next >> gpio_num) & 0x1;
|
||||
|
@ -411,6 +411,7 @@ static inline void gpio_ll_set_level(gpio_dev_t *hw, uint32_t gpio_num, uint32_t
|
||||
* - 0 the GPIO input level is 0
|
||||
* - 1 the GPIO input level is 1
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline int gpio_ll_get_level(gpio_dev_t *hw, uint32_t gpio_num)
|
||||
{
|
||||
if (gpio_num < 32) {
|
||||
|
@ -351,6 +351,7 @@ static inline void gpio_ll_set_level(gpio_dev_t *hw, uint32_t gpio_num, uint32_t
|
||||
* - 0 the GPIO input level is 0
|
||||
* - 1 the GPIO input level is 1
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline int gpio_ll_get_level(gpio_dev_t *hw, uint32_t gpio_num)
|
||||
{
|
||||
if (gpio_num < 32) {
|
||||
|
@ -367,6 +367,7 @@ static inline void gpio_ll_set_level(gpio_dev_t *hw, uint32_t gpio_num, uint32_t
|
||||
* - 0 the GPIO input level is 0
|
||||
* - 1 the GPIO input level is 1
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline int gpio_ll_get_level(gpio_dev_t *hw, uint32_t gpio_num)
|
||||
{
|
||||
if (gpio_num < 32) {
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "soc/soc.h"
|
||||
#include <stdint.h>
|
||||
//include soc related (generated) definitions
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
|
@ -48,7 +48,9 @@ else()
|
||||
"spi_flash_os_func_noos.c")
|
||||
|
||||
list(APPEND srcs ${cache_srcs})
|
||||
set(priv_requires bootloader_support app_update soc driver esp_mm)
|
||||
set(priv_requires bootloader_support app_update soc esp_mm
|
||||
driver esp_driver_gpio # TODO: IDF-8503 move spi_bus_lock to esp_hw_support component
|
||||
)
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
|
@ -6,13 +6,13 @@ components/spi_flash/test_apps/esp_flash:
|
||||
temporary: true
|
||||
reason: target esp32p4 is not supported yet # TODO: IDF-7499
|
||||
depends_filepatterns:
|
||||
- components/driver/gpio/**/*
|
||||
- components/driver/spi/**/*
|
||||
- components/bootloader_support/bootloader_flash/**/*
|
||||
depends_components:
|
||||
- esp_mm
|
||||
- esp_psram
|
||||
- spi_flash
|
||||
- esp_driver_gpio
|
||||
- esptool_py # Some flash related kconfigs are listed here.
|
||||
|
||||
components/spi_flash/test_apps/flash_encryption:
|
||||
@ -54,11 +54,11 @@ components/spi_flash/test_apps/mspi_test:
|
||||
temporary: true
|
||||
reason: not supported yet #TODO: IDF-7556 for p4
|
||||
depends_filepatterns:
|
||||
- components/driver/gpio/**/*
|
||||
- components/driver/spi/**/*
|
||||
- components/bootloader_support/bootloader_flash/**/*
|
||||
depends_components:
|
||||
- esp_mm
|
||||
- esp_psram
|
||||
- spi_flash
|
||||
- esp_driver_gpio
|
||||
- esptool_py # Some flash related kconfigs are listed here.
|
||||
|
@ -10,7 +10,7 @@ set(priv_include)
|
||||
# As CONFIG_USB_OTG_SUPPORTED comes from Kconfig, it is not evaluated yet
|
||||
# when components are being registered.
|
||||
# Thus, always add the (private) requirements, regardless of Kconfig
|
||||
set(priv_require driver) # usb_phy driver relies on gpio driver API
|
||||
set(priv_require esp_driver_gpio) # usb_phy driver relies on gpio driver API
|
||||
|
||||
if(CONFIG_USB_OTG_SUPPORTED)
|
||||
list(APPEND srcs "hcd_dwc.c"
|
||||
|
@ -79,12 +79,6 @@ INPUT = \
|
||||
$(PROJECT_PATH)/components/driver/dac/include/driver/dac_cosine.h \
|
||||
$(PROJECT_PATH)/components/driver/dac/include/driver/dac_oneshot.h \
|
||||
$(PROJECT_PATH)/components/driver/dac/include/driver/dac_types.h \
|
||||
$(PROJECT_PATH)/components/driver/gpio/include/driver/dedic_gpio.h \
|
||||
$(PROJECT_PATH)/components/driver/gpio/include/driver/gpio.h \
|
||||
$(PROJECT_PATH)/components/driver/gpio/include/driver/gpio_etm.h \
|
||||
$(PROJECT_PATH)/components/driver/gpio/include/driver/gpio_filter.h \
|
||||
$(PROJECT_PATH)/components/driver/gpio/include/driver/lp_io.h \
|
||||
$(PROJECT_PATH)/components/driver/gpio/include/driver/rtc_io.h \
|
||||
$(PROJECT_PATH)/components/driver/gptimer/include/driver/gptimer.h \
|
||||
$(PROJECT_PATH)/components/driver/gptimer/include/driver/gptimer_etm.h \
|
||||
$(PROJECT_PATH)/components/driver/gptimer/include/driver/gptimer_types.h \
|
||||
@ -139,6 +133,12 @@ INPUT = \
|
||||
$(PROJECT_PATH)/components/esp_common/include/esp_check.h \
|
||||
$(PROJECT_PATH)/components/esp_common/include/esp_err.h \
|
||||
$(PROJECT_PATH)/components/esp_common/include/esp_idf_version.h \
|
||||
$(PROJECT_PATH)/components/esp_driver_gpio/include/driver/dedic_gpio.h \
|
||||
$(PROJECT_PATH)/components/esp_driver_gpio/include/driver/gpio.h \
|
||||
$(PROJECT_PATH)/components/esp_driver_gpio/include/driver/gpio_etm.h \
|
||||
$(PROJECT_PATH)/components/esp_driver_gpio/include/driver/gpio_filter.h \
|
||||
$(PROJECT_PATH)/components/esp_driver_gpio/include/driver/lp_io.h \
|
||||
$(PROJECT_PATH)/components/esp_driver_gpio/include/driver/rtc_io.h \
|
||||
$(PROJECT_PATH)/components/esp_driver_pcnt/include/driver/pulse_cnt.h \
|
||||
$(PROJECT_PATH)/components/esp_eth/include/esp_eth_com.h \
|
||||
$(PROJECT_PATH)/components/esp_eth/include/esp_eth_driver.h \
|
||||
|
@ -497,7 +497,7 @@ If you enter ``s`` instead, then debugger will step inside subroutine calls::
|
||||
Target halted. PRO_CPU: PC=0x400DB74B (active) APP_CPU: PC=0x400D1128
|
||||
Target halted. PRO_CPU: PC=0x400DC04C (active) APP_CPU: PC=0x400D1128
|
||||
Target halted. PRO_CPU: PC=0x400DC04F (active) APP_CPU: PC=0x400D1128
|
||||
gpio_set_level (gpio_num=GPIO_NUM_4, level=0) at /home/user-name/esp/esp-idf/components/driver/gpio/gpio.c:183
|
||||
gpio_set_level (gpio_num=GPIO_NUM_4, level=0) at /home/user-name/esp/esp-idf/components/esp_driver_gpio/src/gpio.c:183
|
||||
183 GPIO_CHECK(GPIO_IS_VALID_OUTPUT_GPIO(gpio_num), "GPIO output gpio_num error", ESP_ERR_INVALID_ARG);
|
||||
(gdb)
|
||||
|
||||
|
@ -123,7 +123,7 @@ When writing code, please follow the guidelines below:
|
||||
|
||||
For practical example see :component_file:`nvs_flash/include/nvs.h`.
|
||||
|
||||
4. You may want to go even further and skip some code like repetitive defines or enumerations. In such case, enclose the code within ``/** @cond */`` and ``/** @endcond */`` commands. Example of such implementation is provided in :component_file:`driver/gpio/include/driver/gpio.h`.
|
||||
4. You may want to go even further and skip some code like repetitive defines or enumerations. In such case, enclose the code within ``/** @cond */`` and ``/** @endcond */`` commands. Example of such implementation is provided in :component_file:`esp_driver_gpio/include/driver/gpio.h`.
|
||||
|
||||
5. Use markdown to make your documentation even more readable. You will add headers, links, tables and more. ::
|
||||
|
||||
|
@ -497,7 +497,7 @@
|
||||
Target halted. PRO_CPU: PC=0x400DB74B (active) APP_CPU: PC=0x400D1128
|
||||
Target halted. PRO_CPU: PC=0x400DC04C (active) APP_CPU: PC=0x400D1128
|
||||
Target halted. PRO_CPU: PC=0x400DC04F (active) APP_CPU: PC=0x400D1128
|
||||
gpio_set_level (gpio_num=GPIO_NUM_4, level=0) at /home/user-name/esp/esp-idf/components/driver/gpio/gpio.c:183
|
||||
gpio_set_level (gpio_num=GPIO_NUM_4, level=0) at /home/user-name/esp/esp-idf/components/esp_driver_gpio/src/gpio.c:183
|
||||
183 GPIO_CHECK(GPIO_IS_VALID_OUTPUT_GPIO(gpio_num), "GPIO output gpio_num error", ESP_ERR_INVALID_ARG);
|
||||
(gdb)
|
||||
|
||||
|
@ -123,7 +123,7 @@ Doxygen 支持多种格式,并支持文档内部的多个详情级别,具有
|
||||
|
||||
如需更多应用示例,请参考 :component_file:`nvs_flash/include/nvs.h`。
|
||||
|
||||
4. 如需进一步跳过重复定义或枚举等代码,可使用 ``/** @cond */`` 和 ``/** @endcond */`` 命令附上该代码。相关应用实例,请参考 :component_file:`driver/gpio/include/driver/gpio.h`。
|
||||
4. 如需进一步跳过重复定义或枚举等代码,可使用 ``/** @cond */`` 和 ``/** @endcond */`` 命令附上该代码。相关应用实例,请参考 :component_file:`esp_driver_gpio/include/driver/gpio.h`。
|
||||
|
||||
5. 使用 markdown 添加标题、链接和表格等,增强文档的可读性。 ::
|
||||
|
||||
|
@ -24,8 +24,8 @@ examples/bluetooth/bluedroid/ble:
|
||||
examples/bluetooth/bluedroid/ble/ble_hid_device_demo:
|
||||
disable:
|
||||
- if: SOC_BT_SUPPORTED != 1
|
||||
depends_filepatterns:
|
||||
- components/driver/gpio/**/*
|
||||
depends_components:
|
||||
- esp_driver_gpio
|
||||
|
||||
examples/bluetooth/bluedroid/ble_50:
|
||||
disable:
|
||||
@ -41,11 +41,11 @@ examples/bluetooth/bluedroid/classic_bt:
|
||||
- esp_log
|
||||
- esp_console
|
||||
- vfs
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- components/driver/dac/**/*
|
||||
- components/driver/i2s/**/*
|
||||
- components/driver/uart/**/*
|
||||
- components/driver/gpio/**/*
|
||||
|
||||
examples/bluetooth/bluedroid/coex/a2dp_gatts_coex:
|
||||
<<: *bt_default_depends
|
||||
@ -84,9 +84,9 @@ examples/bluetooth/esp_ble_mesh:
|
||||
- vfs
|
||||
- mbedtls
|
||||
- touch_element
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- examples/bluetooth/esp_ble_mesh/common_components/**/*
|
||||
- components/driver/gpio/**/*
|
||||
|
||||
examples/bluetooth/esp_ble_mesh/aligenie_demo:
|
||||
enable:
|
||||
@ -99,9 +99,9 @@ examples/bluetooth/esp_ble_mesh/aligenie_demo:
|
||||
- vfs
|
||||
- mbedtls
|
||||
- driver
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- examples/bluetooth/esp_ble_mesh/common_components/**/*
|
||||
- components/driver/gpio/**/*
|
||||
|
||||
examples/bluetooth/esp_ble_mesh/coex_test:
|
||||
enable:
|
||||
@ -117,9 +117,9 @@ examples/bluetooth/esp_ble_mesh/coex_test:
|
||||
- esp_coex
|
||||
- esp_wifi
|
||||
- esp_netif
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- examples/bluetooth/esp_ble_mesh/common_components/**/*
|
||||
- components/driver/gpio/**/*
|
||||
|
||||
examples/bluetooth/esp_ble_mesh/wifi_coexist:
|
||||
disable:
|
||||
@ -134,9 +134,9 @@ examples/bluetooth/esp_ble_mesh/wifi_coexist:
|
||||
- esp_coex
|
||||
- esp_wifi
|
||||
- esp_netif
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- examples/bluetooth/esp_ble_mesh/common_components/**/*
|
||||
- components/driver/gpio/**/*
|
||||
|
||||
examples/bluetooth/hci:
|
||||
<<: *bt_default_depends
|
||||
@ -271,8 +271,9 @@ examples/bluetooth/nimble/throughput_app:
|
||||
<<: *bt_default_depends
|
||||
disable:
|
||||
- if: SOC_BLE_SUPPORTED != 1
|
||||
depends_components:
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- examples/bluetooth/nimble/common/**/*
|
||||
- examples/bluetooth/nimble/throughput_app/blecent_throughput/components/**/*
|
||||
- components/driver/uart/**/*
|
||||
- components/driver/gpio/**/*
|
||||
|
@ -1,3 +1,3 @@
|
||||
idf_component_register(SRCS "button.c" "button_obj.cpp"
|
||||
INCLUDE_DIRS "." "include"
|
||||
PRIV_REQUIRES driver esp_timer)
|
||||
PRIV_REQUIRES esp_driver_gpio esp_timer)
|
||||
|
@ -7,6 +7,6 @@ set(COMPONENT_SRCS
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ". include")
|
||||
|
||||
# requirements can't depend on config
|
||||
set(COMPONENT_REQUIRES example_nvs driver)
|
||||
set(COMPONENT_REQUIRES example_nvs driver esp_driver_gpio)
|
||||
|
||||
register_component()
|
||||
|
@ -8,8 +8,8 @@ examples/ethernet/basic:
|
||||
- esp_netif
|
||||
- lwip
|
||||
- esp_event
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- components/driver/gpio/**/*
|
||||
- components/driver/spi/**/*
|
||||
|
||||
examples/ethernet/enc28j60:
|
||||
@ -22,8 +22,8 @@ examples/ethernet/enc28j60:
|
||||
- esp_netif
|
||||
- lwip
|
||||
- esp_event
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- components/driver/gpio/**/*
|
||||
- components/driver/spi/**/*
|
||||
|
||||
examples/ethernet/iperf:
|
||||
@ -37,8 +37,8 @@ examples/ethernet/iperf:
|
||||
- lwip
|
||||
- esp_event
|
||||
- console
|
||||
- esp_driver_gpio
|
||||
depends_filepatterns:
|
||||
- components/driver/gpio/**/*
|
||||
- components/driver/spi/**/*
|
||||
- examples/common_components/iperf/**/*
|
||||
- examples/common_components/protocol_examples_common/**/*
|
||||
|
@ -27,6 +27,10 @@ examples/peripherals/dac:
|
||||
disable:
|
||||
- if: SOC_DAC_SUPPORTED != 1
|
||||
|
||||
examples/peripherals/gpio:
|
||||
depends_components:
|
||||
- esp_driver_gpio
|
||||
|
||||
examples/peripherals/gpio/matrix_keyboard:
|
||||
enable:
|
||||
- if: IDF_TARGET == "esp32s2"
|
||||
|
@ -5,20 +5,23 @@
|
||||
[mapping:eeprom]
|
||||
archive: libeeprom.a
|
||||
entries:
|
||||
if EXAMPLE_USE_SPI1_PINS = y:
|
||||
* (noflash)
|
||||
|
||||
[mapping:ext_driver]
|
||||
archive: libdriver.a
|
||||
archive: libesp_driver_gpio.a
|
||||
entries:
|
||||
# gpio_set_level, gpio_get_level, gpio_context, _gpio_hal, etc...
|
||||
gpio (noflash)
|
||||
if EXAMPLE_USE_SPI1_PINS = y:
|
||||
gpio: gpio_intr_enable (noflash)
|
||||
|
||||
[mapping:ext_soc]
|
||||
archive: libhal.a
|
||||
entries:
|
||||
gpio_hal (noflash)
|
||||
if EXAMPLE_USE_SPI1_PINS = y:
|
||||
gpio_hal: gpio_hal_intr_enable_on_core (noflash)
|
||||
|
||||
[mapping:ext_newlib]
|
||||
archive: libnewlib.a
|
||||
entries:
|
||||
if EXAMPLE_USE_SPI1_PINS = y:
|
||||
time:usleep (noflash)
|
||||
|
@ -51,16 +51,6 @@ typedef struct eeprom_context_t eeprom_context_t;
|
||||
|
||||
static const char TAG[] = "eeprom";
|
||||
|
||||
// Workaround: The driver depends on some data in the flash and cannot be placed to DRAM easily for
|
||||
// now. Using the version in LL instead.
|
||||
#define gpio_set_level gpio_set_level_patch
|
||||
#include "hal/gpio_ll.h"
|
||||
static inline esp_err_t gpio_set_level_patch(gpio_num_t gpio_num, uint32_t level)
|
||||
{
|
||||
gpio_ll_set_level(&GPIO, gpio_num, level);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t eeprom_simple_cmd(eeprom_context_t *ctx, uint16_t cmd)
|
||||
{
|
||||
spi_transaction_t t = {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user