Merge branch 'refactor/cleanup_hal_files_v6.0' into 'release/v6.0'

refactor(jpeg): Split hal layer for jpeg  (backport v6.0)

See merge request espressif/esp-idf!45514
This commit is contained in:
morris
2026-02-01 18:51:36 +08:00
26 changed files with 37 additions and 44 deletions
@@ -23,6 +23,7 @@ if(CONFIG_SOC_JPEG_CODEC_SUPPORTED)
endif()
endif()
set(requires esp_hal_jpeg)
if(${target} STREQUAL "linux")
set(priv_requires "")
else()
@@ -32,4 +33,5 @@ endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${public_include}
PRIV_REQUIRES "${priv_requires}"
REQUIRES "${requires}"
)
@@ -371,7 +371,6 @@ void i2s_hal_tdm_enable_rx_channel(i2s_hal_context_t *hal);
*/
#define i2s_hal_rx_reset_fifo(hal) i2s_ll_rx_reset_fifo((hal)->dev)
#if !SOC_GDMA_SUPPORTED
/**
* @brief Enable I2S TX DMA
+20
View File
@@ -0,0 +1,20 @@
idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "linux")
return() # This component is not supported by the POSIX/Linux simulator
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include")
list(APPEND includes "${target}/include")
endif()
list(APPEND includes "include")
set(srcs)
# JPEG related source files
if(CONFIG_SOC_JPEG_CODEC_SUPPORTED)
list(APPEND srcs "jpeg_hal.c")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${includes}
REQUIRES soc hal)
+9
View File
@@ -0,0 +1,9 @@
# `esp_hal_jpeg`
⚠️ This HAL component is still under heavy development at the moment, so we don't guarantee the stability and backward-compatibility among versions.
The `esp_hal_jpeg` component provides a **Hardware Abstraction Layer** of JPEG for all targets supported by ESP-IDF.
In a broad sense, the HAL layer consists of two sub-layers: HAL (upper) and Low-Level(bottom). The HAL layer defines the steps and data that is required to operate a peripheral (e.g. initialization, parameter settings). The low-level is a translation layer above the register files under the `soc` component, it only covers general conceptions to register configurations.
The functions in this file mainly provide hardware abstraction for IDF peripheral drivers. For advanced developers, the HAL layer functions can also be directly used to assist in implementing their own drivers. However, it needs to be mentioned again that the interfaces here do not guarantee stability.
@@ -67,7 +67,6 @@ typedef enum {
JPEG_LL_INTR_UNDETECT | \
JPEG_LL_INTR_DECODE_TIMEOUT)
typedef enum {
JPEG_LL_RLE_PARALLEL_ERR = (1 << 1),
JPEG_LL_BS_LAST_BLOCK_EOF = (1 << 12),
@@ -437,7 +436,6 @@ static inline void jpeg_ll_codec_pause(jpeg_dev_t *hw, bool en)
hw->config.pause_en = en;
}
/**
* @brief Apply soft reset, this will reset the hardware fsm and fifo.
*
@@ -13,7 +13,6 @@
extern "C" {
#endif
/*
* @brief Enum to define JPEG marker codes
*/
@@ -73,7 +72,6 @@ typedef enum {
JPEG_M_INV = 0xFFFF, ///< Invalid marker
} __attribute__((packed)) jpeg_marker_code_t;
#ifdef __cplusplus
}
#endif
@@ -9,7 +9,6 @@
#include <stdint.h>
#include <stdio.h>
#include "esp_err.h"
#include "hal/ldo_types.h"
#ifdef __cplusplus
extern "C" {
-4
View File
@@ -72,10 +72,6 @@ elseif(NOT BOOTLOADER_BUILD)
list(APPEND srcs "vbat_hal.c")
endif()
if(CONFIG_SOC_JPEG_CODEC_SUPPORTED)
list(APPEND srcs "jpeg_hal.c")
endif()
if(CONFIG_SOC_SDIO_SLAVE_SUPPORTED)
list(APPEND srcs "sdio_slave_hal.c")
endif()
-28
View File
@@ -1,28 +0,0 @@
/*
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief LDO Unit
*
* @note See datasheet to know LDO, alias includes but not least to `VFB/VOn`
*/
typedef enum {
LDO_UNIT_1 = 1, ///< LDO 1
LDO_UNIT_2, ///< LDO 2
LDO_UNIT_3, ///< LDO 3
LDO_UNIT_4, ///< LDO 4
} ldo_unit_t;
#ifdef __cplusplus
}
#endif
+2 -1
View File
@@ -175,9 +175,11 @@ INPUT = \
$(PROJECT_PATH)/components/esp_hal_timg/include/hal/timer_types.h \
$(PROJECT_PATH)/components/esp_hal_i2c/include/hal/i2c_types.h \
$(PROJECT_PATH)/components/esp_hal_i2s/include/hal/i2s_types.h \
$(PROJECT_PATH)/components/esp_hal_jpeg/include/hal/jpeg_types.h \
$(PROJECT_PATH)/components/esp_hal_lcd/include/hal/lcd_types.h \
$(PROJECT_PATH)/components/esp_hal_ledc/include/hal/ledc_types.h \
$(PROJECT_PATH)/components/esp_hal_parlio/include/hal/parlio_types.h \
$(PROJECT_PATH)/components/esp_hal_mcpwm/include/hal/mcpwm_types.h \
$(PROJECT_PATH)/components/esp_hal_mspi/include/hal/esp_flash_err.h \
$(PROJECT_PATH)/components/esp_hal_mspi/include/hal/spi_flash_types.h \
$(PROJECT_PATH)/components/esp_hal_twai/include/hal/twai_types.h \
@@ -269,7 +271,6 @@ INPUT = \
$(PROJECT_PATH)/components/freertos/FreeRTOS-Kernel/include/freertos/task.h \
$(PROJECT_PATH)/components/freertos/FreeRTOS-Kernel/include/freertos/timers.h \
$(PROJECT_PATH)/components/hal/include/hal/color_types.h \
$(PROJECT_PATH)/components/hal/include/hal/mcpwm_types.h \
$(PROJECT_PATH)/components/hal/include/hal/sdio_slave_types.h \
$(PROJECT_PATH)/components/hal/include/hal/efuse_hal.h \
$(PROJECT_PATH)/components/hal/include/hal/eth_types.h \
-1
View File
@@ -38,7 +38,6 @@ INPUT += \
$(PROJECT_PATH)/components/esp_lcd/dsi/include/esp_lcd_mipi_dsi.h \
$(PROJECT_PATH)/components/esp_lcd/rgb/include/esp_lcd_panel_rgb.h \
$(PROJECT_PATH)/components/esp_hal_cam/include/hal/isp_types.h \
$(PROJECT_PATH)/components/hal/include/hal/jpeg_types.h \
$(PROJECT_PATH)/components/ulp/lp_core/include/lp_core_etm.h \
$(PROJECT_PATH)/components/ulp/lp_core/include/lp_core_i2c.h \
$(PROJECT_PATH)/components/ulp/lp_core/include/lp_core_spi.h \
+1 -1
View File
@@ -465,4 +465,4 @@ API Reference
.. include-build-file:: inc/jpeg_encode.inc
.. include-build-file:: inc/components/esp_driver_jpeg/include/driver/jpeg_types.inc
.. include-build-file:: inc/components/hal/include/hal/jpeg_types.inc
.. include-build-file:: inc/components/esp_hal_jpeg/include/hal/jpeg_types.inc
+1 -1
View File
@@ -1065,7 +1065,7 @@ API Reference
.. include-build-file:: inc/mcpwm_cap.inc
.. include-build-file:: inc/mcpwm_etm.inc
.. include-build-file:: inc/components/esp_driver_mcpwm/include/driver/mcpwm_types.inc
.. include-build-file:: inc/components/hal/include/hal/mcpwm_types.inc
.. include-build-file:: inc/components/esp_hal_mcpwm/include/hal/mcpwm_types.inc
.. [1]
@@ -465,4 +465,4 @@ API 参考
.. include-build-file:: inc/jpeg_encode.inc
.. include-build-file:: inc/components/esp_driver_jpeg/include/driver/jpeg_types.inc
.. include-build-file:: inc/components/hal/include/hal/jpeg_types.inc
.. include-build-file:: inc/components/esp_hal_jpeg/include/hal/jpeg_types.inc
@@ -1065,7 +1065,7 @@ API 参考
.. include-build-file:: inc/mcpwm_cap.inc
.. include-build-file:: inc/mcpwm_etm.inc
.. include-build-file:: inc/components/esp_driver_mcpwm/include/driver/mcpwm_types.inc
.. include-build-file:: inc/components/hal/include/hal/mcpwm_types.inc
.. include-build-file:: inc/components/esp_hal_mcpwm/include/hal/mcpwm_types.inc
.. [1]