refactor(esp_hal_gpio): move some caps definitions to esp_hal_gpio

This commit is contained in:
Song Ruo Jing
2025-12-08 14:33:26 +08:00
parent 62899cbba6
commit 4d3a9b0157
115 changed files with 586 additions and 329 deletions
+2 -1
View File
@@ -26,4 +26,5 @@ endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${includes}
REQUIRES soc hal)
REQUIRES soc hal
PRIV_REQUIRES esp_hal_gpio)
+3 -3
View File
@@ -11,7 +11,7 @@
#include <string.h>
#include <math.h>
#include "soc/soc_caps.h"
#include "hal/gpio_ll.h" //for GPIO_LL_MATRIX_DELAY_NS
#include "hal/gpio_caps.h" //for GPIO_CAPS_GET(MATRIX_DELAY_NS)
#include "hal/spi_flash_hal.h"
#include "hal/assert.h"
#include "hal/log.h"
@@ -66,8 +66,8 @@ static inline int get_dummy_n(bool gpio_is_used, int input_delay_ns, int eff_clk
//calculate how many apb clocks a period has
const int apbclk_n = APB_CLK_FREQ / eff_clk;
int gpio_delay_ns = 0;
#if GPIO_LL_MATRIX_DELAY_NS
gpio_delay_ns = gpio_is_used ? GPIO_LL_MATRIX_DELAY_NS : 0;
#if GPIO_CAPS_GET(MATRIX_DELAY_NS)
gpio_delay_ns = gpio_is_used ? GPIO_CAPS_GET(MATRIX_DELAY_NS) : 0;
#endif
//calculate how many apb clocks the delay is, the 1 is to compensate in case ``input_delay_ns`` is rounded off.