Merge branch 'change/esp_idf_ulp_add_int_api_5.2' into 'release/v5.2'

change(ulp): add lp periph intr enable apis v5.2

See merge request espressif/esp-idf!49147
This commit is contained in:
Jiang Jiang Jian
2026-06-05 10:50:41 +08:00
2 changed files with 56 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -14,6 +14,7 @@ extern "C" {
#include <stdbool.h>
#include "hal/i2c_types.h"
#include "esp_err.h"
#include "hal/i2c_ll.h"
/**
* @brief Read from I2C device
@@ -99,6 +100,34 @@ esp_err_t lp_core_i2c_master_write_read_device(i2c_port_t lp_i2c_num, uint16_t d
*/
void lp_core_i2c_master_set_ack_check_en(i2c_port_t lp_i2c_num, bool ack_check_en);
#if SOC_LP_I2C_SUPPORTED
/**
* @brief Enable LP I2C master-related interrupts at the peripheral
*
* Enables the same interrupt sources used by the LP I2C master driver (see I2C_LL_MASTER_EVENT_INTR).
*
* @param lp_i2c_num Must be the LP I2C port (e.g. LP_I2C_NUM_0), not an HP I2C port.
* @param mask Interrupt mask needs to be enabled
*/
static inline void ulp_lp_core_lp_i2c_intr_enable(i2c_port_t lp_i2c_num, uint32_t mask)
{
HAL_ASSERT(lp_i2c_num == LP_I2C_NUM_0);
i2c_ll_enable_intr_mask(I2C_LL_GET_HW(lp_i2c_num), mask);
}
/**
* @brief Disable LP I2C master-related interrupts at the peripheral
*
* @param lp_i2c_num Must be the LP I2C port (e.g. LP_I2C_NUM_0), not an HP I2C port.
* @param mask Interrupt mask needs to be disabled
*/
static inline void ulp_lp_core_lp_i2c_intr_disable(i2c_port_t lp_i2c_num, uint32_t mask)
{
HAL_ASSERT(lp_i2c_num == LP_I2C_NUM_0);
i2c_ll_disable_intr_mask(I2C_LL_GET_HW(lp_i2c_num), mask);
}
#endif /* SOC_LP_I2C_SUPPORTED */
#ifdef __cplusplus
}
#endif

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -13,6 +13,31 @@ extern "C" {
#include <stdint.h>
#include "esp_err.h"
#include "hal/uart_types.h"
#include "hal/uart_ll.h"
#if SOC_LP_UART_SUPPORTED
/**
* @brief LP UART peripheral interrupt enable
* @param uart_num UART port number
* @param mask Interrupt mask needs to be enabled
*/
static inline void ulp_lp_core_lp_uart_intr_enable(uart_port_t uart_num, uint32_t mask)
{
HAL_ASSERT(uart_num == LP_UART_NUM_0);
uart_ll_ena_intr_mask(UART_LL_GET_HW(uart_num), mask);
}
/**
* @brief LP UART peripheral interrupt disable
* @param uart_num UART port number
* @param mask Interrupt mask needs to be disabled
*/
static inline void ulp_lp_core_lp_uart_intr_disable(uart_port_t uart_num, uint32_t mask)
{
HAL_ASSERT(uart_num == LP_UART_NUM_0);
uart_ll_disable_intr_mask(UART_LL_GET_HW(uart_num), mask);
}
#endif /* SOC_LP_UART_SUPPORTED */
/**
* @brief Send data to the LP UART port if there is space available in the Tx FIFO