Select one of the symbols to view example projects that use it.
 
Outline
#include "sdkconfig.h"
#include <assert.h>
#include "soc/soc_caps.h"
#include "esp_cpu.h"
intr_desc_t
#define STATE_INTERRUPT_5
#define STATE_INTERRUPT_25
#define STATE_INTERRUPT_5
#define STATE_INTERRUPT_25
#define STATE_INTERRUPT_1
#define STATE_INTERRUPT_7
#define STATE_INTERRUPT_1
#define STATE_INTERRUPT_7
#define CORE_0_INTERRUPT_1
#define CORE_1_INTERRUPT_1
#define CORE_0_INTERRUPT_5
#define CORE_1_INTERRUPT_5
#define CORE_0_INTERRUPT_7
#define CORE_1_INTERRUPT_7
#define CORE_0_INTERRUPT_8
#define CORE_1_INTERRUPT_8
#define CORE_0_INTERRUPT_25
#define CORE_1_INTERRUPT_25
#define CORE_0_INTERRUPT_1
#define CORE_1_INTERRUPT_1
#define CORE_0_INTERRUPT_5
#define CORE_1_INTERRUPT_5
#define CORE_0_INTERRUPT_7
#define CORE_1_INTERRUPT_7
#define CORE_0_INTERRUPT_8
#define CORE_1_INTERRUPT_8
#define CORE_0_INTERRUPT_25
#define CORE_1_INTERRUPT_25
#define CORE_0_INTERRUPT_1
#define CORE_1_INTERRUPT_1
#define CORE_0_INTERRUPT_5
#define CORE_1_INTERRUPT_5
#define CORE_0_INTERRUPT_7
#define CORE_1_INTERRUPT_7
#define CORE_0_INTERRUPT_8
#define CORE_1_INTERRUPT_8
#define CORE_0_INTERRUPT_25
#define CORE_1_INTERRUPT_25
#define CORE_0_INTERRUPT_24
#define CORE_1_INTERRUPT_24
#define CORE_0_INTERRUPT_26
#define CORE_1_INTERRUPT_26
#define CORE_0_INTERRUPT_28
#define CORE_1_INTERRUPT_28
#define CORE_0_INTERRUPT_31
#define CORE_1_INTERRUPT_31
#define CORE_0_INTERRUPT_24
#define CORE_1_INTERRUPT_24
#define CORE_0_INTERRUPT_24
#define CORE_1_INTERRUPT_24
#define CORE_0_INTERRUPT_25
#define CORE_1_INTERRUPT_25
#define CORE_0_INTERRUPT_26
#define CORE_1_INTERRUPT_26
#define CORE_0_INTERRUPT_28
#define CORE_1_INTERRUPT_28
#define CORE_0_INTERRUPT_31
#define CORE_1_INTERRUPT_31
intr_desc_table
esp_cpu_intr_get_desc(int, int, esp_cpu_intr_desc_t *)
Files
ESP-IDF
components
app_trace
app_update
bootloader_support
bt
cmock
console
cxx
driver
efuse
esp_adc
esp_app_format
esp_bootloader_format
esp_coex
esp_common
esp_driver_ana_cmpr
esp_driver_cam
esp_driver_dac
esp_driver_gpio
esp_driver_gptimer
esp_driver_i2c
esp_driver_i2s
esp_driver_jpeg
esp_driver_ledc
esp_driver_mcpwm
esp_driver_parlio
esp_driver_pcnt
esp_driver_rmt
esp_driver_sdio
esp_driver_sdm
esp_driver_sdmmc
esp_driver_sdspi
esp_driver_spi
esp_driver_tsens
esp_driver_uart
esp_driver_usb_serial_jtag
esp_eth
esp_event
esp_gdbstub
esp_hid
esp_http_client
esp_http_server
esp_https_ota
esp_https_server
esp_hw_support
dma
include
ldo
port
esp32
include
include
esp_lcd
esp_local_ctrl
esp_mm
esp_netif
esp_partition
esp_phy
esp_pm
esp_psram
esp_ringbuf
esp_rom
esp_security
esp_system
esp_timer
esp_vfs_console
esp_wifi
esp-tls
espcoredump
hal
heap
http_parser
ieee802154
log
mqtt
newlib
nvs_flash
nvs_sec_provider
openthread
perfmon
protobuf-c
protocomm
pthread
rt
sdmmc
soc
spi_flash
spiffs
tcp_transport
ulp
unity
vfs
wear_levelling
wifi_provisioning
wpa_supplicant
xtensa
examples
lwIP
FreeRTOS
cJSON
mbedTLS
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/esp_hw_support/port/esp32/esp_cpu_intr.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #include "sdkconfig.h" #include <assert.h> #include "soc/soc_caps.h" #include "esp_cpu.h" /* Xtensa core has 3 interrupts dedicated to timers, we can use either timer0 or timer1 depending on the Kconfig, * timer2 is always set to SPECIAL in our configuration array *//* ... */ /** * @brief Type defined for the table below *//* ... */ typedef struct { int priority; esp_cpu_intr_type_t type; uint32_t flags[SOC_CPU_CORES_NUM]; }{ ... } intr_desc_t; /** * @brief Reserve interrupt 5 or 25 for Bluetooth BR/EDR and BLE controller. *//* ... */ #if CONFIG_BTDM_CTRL_HLI #define STATE_INTERRUPT_5 0 #define STATE_INTERRUPT_25 ESP_CPU_INTR_DESC_FLAG_RESVD/* ... */ #else // !CONFIG_BTDM_CTRL_HLI #define STATE_INTERRUPT_5 ESP_CPU_INTR_DESC_FLAG_RESVD #define STATE_INTERRUPT_25 0/* ... */ #endif // CONFIG_BTDM_CTRL_HLI /** * @brief Interrupt 1 is used by UART HCI, regardless of High-Level Interrupt (HLI) configuration *//* ... */ #if CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 #define STATE_INTERRUPT_1 ESP_CPU_INTR_DESC_FLAG_RESVD /* Interrupt 7 being a software interrupt, it is marked as "special" if not used */ #define STATE_INTERRUPT_7 ESP_CPU_INTR_DESC_FLAG_SPECIAL/* ... */ #else // !BTDM_CTRL_HCI_MODE_UART_H4 #define STATE_INTERRUPT_1 0 #define STATE_INTERRUPT_7 ESP_CPU_INTR_DESC_FLAG_RESVD/* ... */ #endif // BTDM_CTRL_HCI_MODE_UART_H4 /** * @brief Reserve the interrupts on the core where Bluetooth will run. * The macro CONFIG_BTDM_CTRL_PINNED_TO_CORE is only defined if Bluetooth controller is enabled. * It is set to the core where it will run. *//* ... */ #ifdef CONFIG_BTDM_CTRL_PINNED_TO_CORE #if CONFIG_BTDM_CTRL_PINNED_TO_CORE == 0 /* Interrupt 1 is used by Bluetooth UART HCI, check code above */ #define CORE_0_INTERRUPT_1 STATE_INTERRUPT_1 #define CORE_1_INTERRUPT_1 0 /* Interrupt 5 may be used by Bluetooth BR/EDR and BLE controller */ #define CORE_0_INTERRUPT_5 STATE_INTERRUPT_5 #define CORE_1_INTERRUPT_5 0 /* Interrupt 7 is used by Bluetooth VHCI software interrupt */ #define CORE_0_INTERRUPT_7 STATE_INTERRUPT_7 #define CORE_1_INTERRUPT_7 ESP_CPU_INTR_DESC_FLAG_SPECIAL /* Interrupt 8 is used by Bluetooth BB */ #define CORE_0_INTERRUPT_8 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_1_INTERRUPT_8 0 /* Interrupt 25 may be used by Bluetooth BR/EDR and BLE controller */ #define CORE_0_INTERRUPT_25 STATE_INTERRUPT_25 #define CORE_1_INTERRUPT_25 010 defines /* ... */ #elif CONFIG_BTDM_CTRL_PINNED_TO_CORE == 1 /* Interrupt 1 is used by Bluetooth UART HCI, check code above */ #define CORE_0_INTERRUPT_1 0 #define CORE_1_INTERRUPT_1 STATE_INTERRUPT_1 /* Interrupt 5 may be used by Bluetooth BR/EDR and BLE controller */ #define CORE_0_INTERRUPT_5 0 #define CORE_1_INTERRUPT_5 STATE_INTERRUPT_5 /* Interrupt 7 is used by Bluetooth VHCI software interrupt */ #define CORE_0_INTERRUPT_7 ESP_CPU_INTR_DESC_FLAG_SPECIAL #define CORE_1_INTERRUPT_7 STATE_INTERRUPT_7 /* Interrupt 8 is used by Bluetooth BB */ #define CORE_0_INTERRUPT_8 0 #define CORE_1_INTERRUPT_8 ESP_CPU_INTR_DESC_FLAG_RESVD /* Interrupt 25 may be used by Bluetooth BR/EDR and BLE controller */ #define CORE_0_INTERRUPT_25 0 #define CORE_1_INTERRUPT_25 STATE_INTERRUPT_2510 defines /* ... */ #endif/* ... */ #else // Bluetooth not enabled #define CORE_0_INTERRUPT_1 0 #define CORE_1_INTERRUPT_1 0 #define CORE_0_INTERRUPT_5 0 #define CORE_1_INTERRUPT_5 0 #define CORE_0_INTERRUPT_7 ESP_CPU_INTR_DESC_FLAG_SPECIAL #define CORE_1_INTERRUPT_7 ESP_CPU_INTR_DESC_FLAG_SPECIAL #define CORE_0_INTERRUPT_8 0 #define CORE_1_INTERRUPT_8 0 #define CORE_0_INTERRUPT_25 0 #define CORE_1_INTERRUPT_25 0/* ... */ #endif /** * @brief The system interrupts (memory access, cache, watchdog, ...) can be allocated on either level 4 or level 5 interrupts. * Check the configuration. *//* ... */ #if CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 #define CORE_0_INTERRUPT_24 0 #define CORE_1_INTERRUPT_24 0 /* If CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is enabled, Bluetooth macros above take care of interrupt 25 */ /* Interrupt 26 reserved for T1 Watchdog, cache and memory access errors */ #define CORE_0_INTERRUPT_26 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_1_INTERRUPT_26 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_0_INTERRUPT_28 0 #define CORE_1_INTERRUPT_28 0 /* Interrupt 31 reserved for IPC ISRs */ #define CORE_0_INTERRUPT_31 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_1_INTERRUPT_31 ESP_CPU_INTR_DESC_FLAG_RESVD/* ... */ #elif CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4 /* Interrupt reserved for T1 Watchdog, make sure it is enabled */ #if CONFIG_ESP_INT_WDT #define CORE_0_INTERRUPT_24 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_1_INTERRUPT_24 ESP_CPU_INTR_DESC_FLAG_RESVD/* ... */ #else // !CONFIG_ESP_INT_WDT #define CORE_0_INTERRUPT_24 0 #define CORE_1_INTERRUPT_24 0/* ... */ #endif /* If CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4 is enabled, Bluetooth HLI is not enabled for sure (guaranteed by Kconfig), * so we can discard the macro previously defined for interrupt 25 *//* ... */ #undef CORE_0_INTERRUPT_25 #undef CORE_1_INTERRUPT_25 /* Interrupt reserved for memory access and cache errors */ #define CORE_0_INTERRUPT_25 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_1_INTERRUPT_25 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_0_INTERRUPT_26 0 #define CORE_1_INTERRUPT_26 0 /* Interrupt reserved for IPC ISRs */ #define CORE_0_INTERRUPT_28 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_1_INTERRUPT_28 ESP_CPU_INTR_DESC_FLAG_RESVD #define CORE_0_INTERRUPT_31 0 #define CORE_1_INTERRUPT_31 08 defines /* ... */#endif // CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 const static intr_desc_t intr_desc_table [SOC_CPU_INTR_NUM] = { /* Interrupt 0 reserved for WMAC (Wifi) */ [0] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { ESP_CPU_INTR_DESC_FLAG_RESVD, ESP_CPU_INTR_DESC_FLAG_RESVD } }, /* Interrupt 1 reserved for BT/BLE Host HCI DMA when CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is enabled */ [1] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { CORE_0_INTERRUPT_1, CORE_1_INTERRUPT_1 } }, [2] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [3] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, /* Interrupt 4 reserved for WBB */ [4] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { ESP_CPU_INTR_DESC_FLAG_RESVD, 0 } }, /* Interrupt 5 reserved for BT/BLE Controller when Bluetooth HLI is enabled */ [5] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { CORE_0_INTERRUPT_5, CORE_1_INTERRUPT_5 } }, #if CONFIG_FREERTOS_CORETIMER_0 [6] = { 1, ESP_CPU_INTR_TYPE_NA, { ESP_CPU_INTR_DESC_FLAG_RESVD, ESP_CPU_INTR_DESC_FLAG_RESVD } }, #else [6] = { 1, ESP_CPU_INTR_TYPE_NA, { ESP_CPU_INTR_DESC_FLAG_SPECIAL, ESP_CPU_INTR_DESC_FLAG_SPECIAL } }, #endif /* Interrupt 7 reserved for Bluetooth VHCI (software interrupt) */ [7] = { 1, ESP_CPU_INTR_TYPE_NA, { CORE_0_INTERRUPT_7, CORE_1_INTERRUPT_7 } }, /* Interrupt 8 reserved for BT/BLE BB(RX/TX) */ [8] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { CORE_0_INTERRUPT_8, CORE_1_INTERRUPT_8 } }, [9] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [10] = { 1, ESP_CPU_INTR_TYPE_EDGE, { 0, 0 } }, [11] = { 3, ESP_CPU_INTR_TYPE_NA, { ESP_CPU_INTR_DESC_FLAG_SPECIAL, ESP_CPU_INTR_DESC_FLAG_SPECIAL } }, [12] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [13] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [14] = { 7, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, // NMI #if CONFIG_FREERTOS_CORETIMER_1 [15] = { 3, ESP_CPU_INTR_TYPE_NA, { ESP_CPU_INTR_DESC_FLAG_RESVD, ESP_CPU_INTR_DESC_FLAG_RESVD } }, #else [15] = { 3, ESP_CPU_INTR_TYPE_NA, { ESP_CPU_INTR_DESC_FLAG_SPECIAL, ESP_CPU_INTR_DESC_FLAG_SPECIAL } }, #endif [16] = { 5, ESP_CPU_INTR_TYPE_NA, { ESP_CPU_INTR_DESC_FLAG_SPECIAL, ESP_CPU_INTR_DESC_FLAG_SPECIAL } }, [17] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [18] = { 1, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [19] = { 2, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [20] = { 2, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [21] = { 2, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, [22] = { 3, ESP_CPU_INTR_TYPE_EDGE, { 0, 0 } }, [23] = { 3, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, /* Interrupt 24 reserved for T1 WDT when CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4 is enabled */ [24] = { 4, ESP_CPU_INTR_TYPE_LEVEL, { CORE_0_INTERRUPT_24, CORE_1_INTERRUPT_24 } }, /* Interrupt 25 reserved for Memory access and cache errors when CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4 is enabled * Reserved for BT/BLE Controller when CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is enabled *//* ... */ [25] = { 4, ESP_CPU_INTR_TYPE_LEVEL, { CORE_0_INTERRUPT_25, CORE_1_INTERRUPT_25 } }, /* Interrupt 26 reserved for T1 WDT, Memory access and cache errors when CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is enabled */ [26] = { 5, ESP_CPU_INTR_TYPE_LEVEL, { CORE_0_INTERRUPT_26, CORE_1_INTERRUPT_26 } }, [27] = { 3, ESP_CPU_INTR_TYPE_LEVEL, { 0, 0 } }, /* Interrupt 28 reserved for IPC when CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4 is enabled */ [28] = { 4, ESP_CPU_INTR_TYPE_EDGE, { CORE_0_INTERRUPT_28, CORE_1_INTERRUPT_28 } }, [29] = { 3, ESP_CPU_INTR_TYPE_NA, { ESP_CPU_INTR_DESC_FLAG_SPECIAL, ESP_CPU_INTR_DESC_FLAG_SPECIAL } }, [30] = { 4, ESP_CPU_INTR_TYPE_EDGE, { 0, 0 } }, /* Interrupt 31 reserved for IPC when CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is enabled */ [31] = { 5, ESP_CPU_INTR_TYPE_LEVEL, { CORE_0_INTERRUPT_31, CORE_1_INTERRUPT_31 } }, }{...}; void esp_cpu_intr_get_desc(int core_id, int intr_num, esp_cpu_intr_desc_t *intr_desc_ret) { assert(core_id >= 0 && core_id < SOC_CPU_CORES_NUM && intr_desc_ret != NULL); intr_desc_ret->priority = intr_desc_table[intr_num].priority; intr_desc_ret->type = intr_desc_table[intr_num].type; intr_desc_ret->flags = intr_desc_table[intr_num].flags[core_id]; }{ ... }
Details