mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(intr_alloc): Fix ISR allocate methods in several drivers
This commit is contained in:
@@ -1534,7 +1534,15 @@ esp_err_t ledc_fade_func_install(int intr_alloc_flags)
|
||||
{
|
||||
LEDC_CHECK(s_ledc_fade_isr_handle == NULL, "fade function already installed", ESP_ERR_INVALID_STATE);
|
||||
//OR intr_alloc_flags with ESP_INTR_FLAG_IRAM because the fade isr is in IRAM
|
||||
return ledc_isr_register(ledc_fade_isr, NULL, intr_alloc_flags | ESP_INTR_FLAG_IRAM, &s_ledc_fade_isr_handle);
|
||||
return esp_intr_alloc_intrstatus(
|
||||
ETS_LEDC_INTR_SOURCE,
|
||||
intr_alloc_flags | ESP_INTR_FLAG_IRAM,
|
||||
(uint32_t)ledc_hal_get_fade_end_intr_addr(&(p_ledc_obj[0]->ledc_hal)),
|
||||
LEDC_LL_FADE_END_INTR_MASK,
|
||||
ledc_fade_isr,
|
||||
NULL,
|
||||
&s_ledc_fade_isr_handle
|
||||
);
|
||||
}
|
||||
|
||||
void ledc_fade_func_uninstall(void)
|
||||
|
||||
@@ -358,15 +358,20 @@ esp_err_t sdio_slave_initialize(sdio_slave_config_t *config)
|
||||
esp_err_t r;
|
||||
intr_handle_t intr_handle = NULL;
|
||||
const int flags = 0;
|
||||
r = esp_intr_alloc(ETS_SLC0_INTR_SOURCE, flags, sdio_intr, NULL, &intr_handle);
|
||||
if (r != ESP_OK) {
|
||||
return r;
|
||||
}
|
||||
|
||||
r = init_context(config);
|
||||
if (r != ESP_OK) {
|
||||
return r;
|
||||
}
|
||||
SDIO_SLAVE_CHECK(r == ESP_OK, "context initialization failed", r);
|
||||
|
||||
r = esp_intr_alloc_intrstatus(
|
||||
ETS_SLC0_INTR_SOURCE,
|
||||
flags,
|
||||
(uint32_t)sdio_slave_hal_get_intr_status_reg(context.hal),
|
||||
sdio_slave_ll_intr_status_mask,
|
||||
sdio_intr,
|
||||
NULL,
|
||||
&intr_handle
|
||||
);
|
||||
SDIO_SLAVE_CHECK(r == ESP_OK, "interrupt allocation failed", r);
|
||||
context.intr_handle = intr_handle;
|
||||
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "esp_err.h"
|
||||
#include "driver/sdmmc_types.h"
|
||||
#include "driver/sdmmc_default_configs.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "soc/gpio_num.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -820,7 +820,7 @@ esp_err_t spi_bus_initialize(spi_host_device_t host_id, const spi_bus_config_t *
|
||||
#elif SOC_GDMA_SUPPORTED
|
||||
SPI_CHECK(dma_chan == SPI_DMA_DISABLED || dma_chan == SPI_DMA_CH_AUTO, "invalid dma channel, chip only support spi dma channel auto-alloc", ESP_ERR_INVALID_ARG);
|
||||
#endif
|
||||
SPI_CHECK((bus_config->intr_flags & (ESP_INTR_FLAG_HIGH | ESP_INTR_FLAG_EDGE | ESP_INTR_FLAG_INTRDISABLED)) == 0, "intr flag not allowed", ESP_ERR_INVALID_ARG);
|
||||
SPI_CHECK((bus_config->intr_flags & (ESP_INTR_FLAG_HIGH | ESP_INTR_FLAG_EDGE | ESP_INTR_FLAG_SHARED | ESP_INTR_FLAG_INTRDISABLED)) == 0, "intr flag not allowed", ESP_ERR_INVALID_ARG);
|
||||
#ifndef CONFIG_SPI_MASTER_ISR_IN_IRAM
|
||||
SPI_CHECK((bus_config->intr_flags & ESP_INTR_FLAG_IRAM) == 0, "ESP_INTR_FLAG_IRAM should be disabled when CONFIG_SPI_MASTER_ISR_IN_IRAM is not set.", ESP_ERR_INVALID_ARG);
|
||||
#endif
|
||||
|
||||
@@ -148,7 +148,7 @@ esp_err_t spi_slave_initialize(spi_host_device_t host, const spi_bus_config_t *b
|
||||
#elif SOC_GDMA_SUPPORTED
|
||||
SPI_CHECK(dma_chan == SPI_DMA_DISABLED || dma_chan == SPI_DMA_CH_AUTO, "invalid dma channel, chip only support spi dma channel auto-alloc", ESP_ERR_INVALID_ARG);
|
||||
#endif
|
||||
SPI_CHECK((bus_config->intr_flags & (ESP_INTR_FLAG_HIGH | ESP_INTR_FLAG_EDGE | ESP_INTR_FLAG_INTRDISABLED)) == 0, "intr flag not allowed", ESP_ERR_INVALID_ARG);
|
||||
SPI_CHECK((bus_config->intr_flags & (ESP_INTR_FLAG_HIGH | ESP_INTR_FLAG_EDGE | ESP_INTR_FLAG_SHARED | ESP_INTR_FLAG_INTRDISABLED)) == 0, "intr flag not allowed", ESP_ERR_INVALID_ARG);
|
||||
#ifndef CONFIG_SPI_SLAVE_ISR_IN_IRAM
|
||||
SPI_CHECK((bus_config->intr_flags & ESP_INTR_FLAG_IRAM) == 0, "ESP_INTR_FLAG_IRAM should be disabled when CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set.", ESP_ERR_INVALID_ARG);
|
||||
#endif
|
||||
|
||||
@@ -1976,9 +1976,15 @@ esp_err_t uart_driver_install(uart_port_t uart_num, int rx_buffer_size, int tx_b
|
||||
uart_hal_disable_intr_mask(&(uart_context[uart_num].hal), UART_LL_INTR_MASK);
|
||||
uart_hal_clr_intsts_mask(&(uart_context[uart_num].hal), UART_LL_INTR_MASK);
|
||||
|
||||
ret = esp_intr_alloc(uart_periph_signal[uart_num].irq, intr_alloc_flags,
|
||||
uart_rx_intr_handler_default, p_uart_obj[uart_num],
|
||||
&p_uart_obj[uart_num]->intr_handle);
|
||||
ret = esp_intr_alloc_intrstatus(
|
||||
uart_periph_signal[uart_num].irq,
|
||||
intr_alloc_flags,
|
||||
(uint32_t)uart_hal_get_intr_status_reg(&(uart_context[uart_num].hal)),
|
||||
UART_LL_INTR_MASK,
|
||||
uart_rx_intr_handler_default,
|
||||
p_uart_obj[uart_num],
|
||||
&p_uart_obj[uart_num]->intr_handle
|
||||
);
|
||||
ESP_GOTO_ON_ERROR(ret, err, UART_TAG, "Could not allocate an interrupt for UART");
|
||||
|
||||
uart_intr_config_t uart_intr = {
|
||||
|
||||
@@ -26,6 +26,8 @@ extern "C" {
|
||||
#define LEDC_LL_HPOINT_VAL_MAX (LEDC_HPOINT_LSCH0_V)
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0xffffUL << LEDC_DUTY_CHNG_END_HSCH0_INT_ENA_S)
|
||||
|
||||
#define LEDC_LL_GLOBAL_CLOCKS { \
|
||||
LEDC_SLOW_CLK_APB, \
|
||||
@@ -524,7 +526,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, high-speed mode or low-speed mode
|
||||
* @param channel_num LEDC channel index (0-7), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -536,6 +537,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -36,6 +36,8 @@ extern "C" {
|
||||
#define sdio_slave_ll_get_host(ID) (&HOST)
|
||||
/// Get address of the only HINF registers for ESP32
|
||||
#define sdio_slave_ll_get_hinf(ID) (&HINF)
|
||||
/// Get the mask of the interrupt status.
|
||||
#define sdio_slave_ll_intr_status_mask (0xff | SLC_SLC0_RX_DONE_INT_ST | SLC_SLC0_RX_EOF_INT_ST | SLC_SLC0_TX_DONE_INT_ST)
|
||||
|
||||
/*
|
||||
* SLC2 DMA Desc struct, aka sdio_slave_ll_desc_t
|
||||
@@ -543,6 +545,17 @@ static inline void sdio_slave_ll_slvint_fetch_clear(slc_dev_t *slc, sdio_slave_l
|
||||
slc->slc0_int_clr.val = slv_int;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address of the interrupt status register.
|
||||
*
|
||||
* @param slc Address of the SLC registers
|
||||
* @return Address of the interrupt status register
|
||||
*/
|
||||
static inline volatile void* sdio_slave_ll_get_intr_status_reg(slc_dev_t *slc)
|
||||
{
|
||||
return &slc->slc0_int_st.val;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -287,6 +287,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -26,6 +26,8 @@ extern "C" {
|
||||
#define LEDC_LL_HPOINT_VAL_MAX (LEDC_HPOINT_CH0_V)
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0x3fUL << LEDC_DUTY_CHNG_END_CH0_INT_ENA_S)
|
||||
|
||||
#define LEDC_LL_GLOBAL_CLOCKS { \
|
||||
LEDC_SLOW_CLK_PLL_DIV, \
|
||||
@@ -498,7 +500,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, high-speed mode or low-speed mode
|
||||
* @param channel_num LEDC channel index (0-7), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -510,6 +511,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -298,6 +298,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -27,6 +27,8 @@ extern "C" {
|
||||
#define LEDC_LL_HPOINT_VAL_MAX (LEDC_HPOINT_LSCH0_V)
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0x3fUL << LEDC_DUTY_CHNG_END_LSCH0_INT_ENA_S)
|
||||
|
||||
#define LEDC_LL_GLOBAL_CLOCKS { \
|
||||
LEDC_SLOW_CLK_APB, \
|
||||
@@ -499,7 +501,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, high-speed mode or low-speed mode
|
||||
* @param channel_num LEDC channel index (0-7), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -511,6 +512,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -303,6 +303,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -30,6 +30,8 @@ extern "C" {
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
#define LEDC_LL_GLOBAL_CLOCKS SOC_LEDC_CLKS
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0x3fUL << LEDC_DUTY_CHNG_END_CH0_INT_ENA_S)
|
||||
|
||||
/**
|
||||
* @brief Enable peripheral register clock
|
||||
@@ -504,7 +506,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, low-speed mode only
|
||||
* @param channel_num LEDC channel index (0-5), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -516,6 +517,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -519,6 +519,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -31,6 +31,8 @@ extern "C" {
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
#define LEDC_LL_GLOBAL_CLOCKS SOC_LEDC_CLKS
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0x3fUL << LEDC_DUTY_CHNG_END_CH0_INT_ENA_S)
|
||||
|
||||
#define LEDC_LL_GLOBAL_CLK_DEFAULT LEDC_SLOW_CLK_RC_FAST
|
||||
|
||||
@@ -625,7 +627,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, low-speed mode only
|
||||
* @param channel_num LEDC channel index (0-5), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -637,6 +638,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -36,6 +36,8 @@ extern "C" {
|
||||
#define sdio_slave_ll_get_host(ID) (&HOST)
|
||||
/// Get address of the only HINF registers
|
||||
#define sdio_slave_ll_get_hinf(ID) (&HINF)
|
||||
/// Get the mask of the interrupt status.
|
||||
#define sdio_slave_ll_intr_status_mask (0xff | SDIO_SLC0_RX_DONE_INT_ST | SDIO_SLC0_RX_EOF_INT_ST | SDIO_SLC0_TX_DONE_INT_ST)
|
||||
|
||||
/*
|
||||
* SLC2 DMA Desc struct, aka sdio_slave_ll_desc_t
|
||||
@@ -532,6 +534,17 @@ static inline void sdio_slave_ll_slvint_fetch_clear(slc_dev_t *slc, sdio_slave_l
|
||||
slc->slc0int_clr.val = slv_int;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the address of the interrupt status register.
|
||||
*
|
||||
* @param slc Address of the SLC registers
|
||||
* @return Address of the interrupt status register
|
||||
*/
|
||||
static inline volatile void* sdio_slave_ll_get_intr_status_reg(slc_dev_t *slc)
|
||||
{
|
||||
return &slc->slc0int_st.val;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -500,6 +500,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -30,6 +30,8 @@ extern "C" {
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
#define LEDC_LL_GLOBAL_CLOCKS SOC_LEDC_CLKS
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0x3fUL << LEDC_DUTY_CHNG_END_CH0_INT_ENA_S)
|
||||
|
||||
/**
|
||||
* @brief Enable peripheral register clock
|
||||
@@ -504,7 +506,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, low-speed mode only
|
||||
* @param channel_num LEDC channel index (0-5), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -516,6 +517,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -347,6 +347,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -31,6 +31,8 @@ extern "C" {
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
#define LEDC_LL_GLOBAL_CLOCKS SOC_LEDC_CLKS
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0x3fUL << LEDC_DUTY_CHNG_END_CH0_INT_ENA_S)
|
||||
|
||||
/**
|
||||
* @brief Enable peripheral register clock
|
||||
@@ -623,7 +625,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, low-speed mode only
|
||||
* @param channel_num LEDC channel index (0-5), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -635,6 +636,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -326,6 +326,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -30,6 +30,8 @@ extern "C" {
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
#define LEDC_LL_GLOBAL_CLOCKS SOC_LEDC_CLKS
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0xffUL << LEDC_DUTY_CHNG_END_CH0_INT_ENA_S)
|
||||
|
||||
/**
|
||||
* @brief Enable peripheral register clock
|
||||
@@ -517,7 +519,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, low-speed mode only
|
||||
* @param channel_num LEDC channel index (0-5), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -529,6 +530,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -623,6 +623,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -282,7 +282,8 @@ static inline void cache_ll_resume_cache(uint32_t cache_level, cache_type_t type
|
||||
* @return true: enabled; false: disabled
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline bool cache_ll_l1_is_icache_enabled(uint32_t cache_id){
|
||||
static inline bool cache_ll_l1_is_icache_enabled(uint32_t cache_id)
|
||||
{
|
||||
HAL_ASSERT(cache_id <= CACHE_LL_ID_ALL);
|
||||
|
||||
bool enabled;
|
||||
|
||||
@@ -27,6 +27,8 @@ extern "C" {
|
||||
#define LEDC_LL_HPOINT_VAL_MAX (LEDC_HPOINT_LSCH0_V)
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0xffUL << LEDC_DUTY_CHNG_END_LSCH0_INT_ENA_S)
|
||||
|
||||
#define LEDC_LL_GLOBAL_CLOCKS { \
|
||||
LEDC_SLOW_CLK_APB, \
|
||||
@@ -538,7 +540,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, high-speed mode or low-speed mode
|
||||
* @param channel_num LEDC channel index (0-7), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -550,6 +551,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -276,6 +276,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intsts_mask(uart_dev_t *hw)
|
||||
return hw->int_st.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the UART interrupt status based on the given mask.
|
||||
*
|
||||
|
||||
@@ -27,6 +27,8 @@ extern "C" {
|
||||
#define LEDC_LL_HPOINT_VAL_MAX (LEDC_HPOINT_LSCH0_V)
|
||||
#define LEDC_LL_FRACTIONAL_BITS (8)
|
||||
#define LEDC_LL_FRACTIONAL_MAX ((1 << LEDC_LL_FRACTIONAL_BITS) - 1)
|
||||
/// Get the mask of the fade end interrupt status register.
|
||||
#define LEDC_LL_FADE_END_INTR_MASK (0xffUL << LEDC_DUTY_CHNG_END_LSCH0_INT_ENA_S)
|
||||
|
||||
#define LEDC_LL_GLOBAL_CLOCKS { \
|
||||
LEDC_SLOW_CLK_APB, \
|
||||
@@ -499,7 +501,6 @@ static inline void ledc_ll_set_fade_end_intr(ledc_dev_t *hw, ledc_mode_t speed_m
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param speed_mode LEDC speed_mode, high-speed mode or low-speed mode
|
||||
* @param channel_num LEDC channel index (0-7), select from ledc_channel_t
|
||||
* @param intr_status The fade end interrupt status
|
||||
*
|
||||
* @return None
|
||||
@@ -511,6 +512,18 @@ static inline void ledc_ll_get_fade_end_intr_status(ledc_dev_t *hw, ledc_mode_t
|
||||
*intr_status = (value >> int_en_base) & 0xff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
static inline volatile void* ledc_ll_get_fade_end_intr_addr(ledc_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Clear fade end interrupt status
|
||||
*
|
||||
|
||||
@@ -333,6 +333,11 @@ FORCE_INLINE_ATTR uint32_t uart_ll_get_intr_ena_status(uart_dev_t *hw)
|
||||
return hw->int_ena.val;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR volatile void* uart_ll_get_intr_status_reg(uart_dev_t *hw)
|
||||
{
|
||||
return &hw->int_st.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the UART rxfifo.
|
||||
*
|
||||
|
||||
@@ -396,6 +396,14 @@ void ledc_hal_get_fade_end_intr_status(ledc_hal_context_t *hal, uint32_t *intr_s
|
||||
*/
|
||||
void ledc_hal_clear_fade_end_intr_status(ledc_hal_context_t *hal, ledc_channel_t channel_num);
|
||||
|
||||
/**
|
||||
* @brief Get the address of the fade end interrupt status register.
|
||||
*
|
||||
* @param hal Context of the HAL layer
|
||||
* @return Pointer to the fade end interrupt status register.
|
||||
*/
|
||||
volatile void* ledc_hal_get_fade_end_intr_addr(ledc_hal_context_t *hal);
|
||||
|
||||
/**
|
||||
* @brief Get clock config of LEDC timer
|
||||
*
|
||||
|
||||
@@ -532,6 +532,14 @@ uint8_t sdio_slave_hal_host_get_reg(sdio_slave_context_t *hal, int pos);
|
||||
*/
|
||||
void sdio_slave_hal_host_set_reg(sdio_slave_context_t *hal, int pos, uint8_t reg);
|
||||
|
||||
/**
|
||||
* Get the address of the interrupt status register.
|
||||
*
|
||||
* @param hal Context of the HAL layer.
|
||||
* @return Address of the interrupt status register
|
||||
*/
|
||||
volatile void* sdio_slave_hal_get_intr_status_reg(sdio_slave_context_t *hal);
|
||||
|
||||
#endif // SOC_SDIO_SLAVE_SUPPORTED
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -106,6 +106,16 @@ typedef struct {
|
||||
*/
|
||||
#define uart_hal_get_intr_ena_status(hal) uart_ll_get_intr_ena_status((hal)->dev)
|
||||
|
||||
/**
|
||||
* @brief Get the pointer to the UART interrupt status register
|
||||
*
|
||||
* @param hal Context of the HAL layer
|
||||
*
|
||||
* @return UART interrupt status register
|
||||
*/
|
||||
#define uart_hal_get_intr_status_reg(hal) uart_ll_get_intr_status_reg((hal)->dev)
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get the UART pattern char configuration
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -75,3 +75,8 @@ void ledc_hal_clear_fade_end_intr_status(ledc_hal_context_t *hal, ledc_channel_t
|
||||
{
|
||||
ledc_ll_clear_fade_end_intr_status(hal->dev, hal->speed_mode, channel_num);
|
||||
}
|
||||
|
||||
volatile void* ledc_hal_get_fade_end_intr_addr(ledc_hal_context_t *hal)
|
||||
{
|
||||
return ledc_ll_get_fade_end_intr_addr(hal->dev);
|
||||
}
|
||||
|
||||
@@ -721,3 +721,8 @@ void sdio_slave_hal_slvint_fetch_clear(sdio_slave_context_t *hal, sdio_slave_ll_
|
||||
{
|
||||
sdio_slave_ll_slvint_fetch_clear(hal->slc, out_int_mask);
|
||||
}
|
||||
|
||||
volatile void* sdio_slave_hal_get_intr_status_reg(sdio_slave_context_t *hal)
|
||||
{
|
||||
return sdio_slave_ll_get_intr_status_reg(hal->slc);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user