41
41
ESP_INTR_FLAG_LEVELMASK * = (ESP_INTR_FLAG_LEVEL1 or ESP_INTR_FLAG_LEVEL2 or ESP_INTR_FLAG_LEVEL3 or ESP_INTR_FLAG_LEVEL4 or ESP_INTR_FLAG_LEVEL5 or ESP_INTR_FLAG_LEVEL6 or ESP_INTR_FLAG_NMI ) # # /< Mask for all level flags
42
42
# # *@}
43
43
44
+ type
45
+ InterruptFlags * = enum
46
+ intr_flag_level1 = ESP_INTR_FLAG_LEVEL1 ,
47
+ intr_flag_level2 = ESP_INTR_FLAG_LEVEL2 ,
48
+ intr_flag_level3 = ESP_INTR_FLAG_LEVEL3 ,
49
+ intr_flag_lowmed = ESP_INTR_FLAG_LOWMED ,
50
+ intr_flag_level4 = ESP_INTR_FLAG_LEVEL4 ,
51
+ intr_flag_level5 = ESP_INTR_FLAG_LEVEL5 ,
52
+ intr_flag_level6 = ESP_INTR_FLAG_LEVEL6 ,
53
+ intr_flag_nmi = ESP_INTR_FLAG_NMI ,
54
+ intr_flag_high = ESP_INTR_FLAG_HIGH ,
55
+ intr_flag_levelmask = ESP_INTR_FLAG_LEVELMASK
56
+ intr_flag_shared = ESP_INTR_FLAG_SHARED ,
57
+ intr_flag_edge = ESP_INTR_FLAG_EDGE ,
58
+ intr_flag_iram = ESP_INTR_FLAG_IRAM ,
59
+ intr_flag_intrdisabled = ESP_INTR_FLAG_INTRDISABLED ,
60
+
44
61
# # * @addtogroup Intr_Alloc_Pseudo_Src
45
62
# # @{
46
63
# #
93
110
94
111
proc esp_intr_mark_shared * (intno: cint ; cpu: cint ; is_in_iram: bool ): esp_err_t {.
95
112
importc : " esp_intr_mark_shared" , header : " esp_intr_alloc.h" .}
113
+
114
+
96
115
# # *
97
116
# # @brief Reserve an interrupt to be used outside of this framework
98
117
# #
@@ -108,6 +127,8 @@ proc esp_intr_mark_shared*(intno: cint; cpu: cint; is_in_iram: bool): esp_err_t
108
127
109
128
proc esp_intr_reserve * (intno: cint ; cpu: cint ): esp_err_t {.
110
129
importc : " esp_intr_reserve" , header : " esp_intr_alloc.h" .}
130
+
131
+
111
132
# # *
112
133
# # @brief Allocate an interrupt with the given parameters.
113
134
# #
@@ -145,6 +166,8 @@ proc esp_intr_reserve*(intno: cint; cpu: cint): esp_err_t {.
145
166
proc esp_intr_alloc * (source: cint ; flags: cint ; handler: intr_handler_t; arg: pointer ;
146
167
ret_handle: ptr intr_handle_t): esp_err_t {.
147
168
importc : " esp_intr_alloc" , header : " esp_intr_alloc.h" .}
169
+
170
+
148
171
# # *
149
172
# # @brief Allocate an interrupt with the given parameters.
150
173
# #
@@ -181,10 +204,11 @@ proc esp_intr_alloc*(source: cint; flags: cint; handler: intr_handler_t; arg: po
181
204
# # ESP_OK otherwise
182
205
# #
183
206
184
- proc esp_intr_alloc_intrstatus * (source: cint ; flags: cint ; intrstatusreg: uint32_t ;
185
- intrstatusmask: uint32_t ; handler: intr_handler_t;
207
+ proc esp_intr_alloc_intrstatus * (source: cint ; flags: cint ; intrstatusreg: uint32 ;
208
+ intrstatusmask: uint32 ; handler: intr_handler_t;
186
209
arg: pointer ; ret_handle: ptr intr_handle_t): esp_err_t {.
187
210
importc : " esp_intr_alloc_intrstatus" , header : " esp_intr_alloc.h" .}
211
+
188
212
# # *
189
213
# # @brief Disable and free an interrupt.
190
214
# #
@@ -206,6 +230,8 @@ proc esp_intr_alloc_intrstatus*(source: cint; flags: cint; intrstatusreg: uint32
206
230
207
231
proc esp_intr_free * (handle: intr_handle_t): esp_err_t {.importc : " esp_intr_free" ,
208
232
header : " esp_intr_alloc.h" .}
233
+
234
+
209
235
# # *
210
236
# # @brief Get CPU number an interrupt is tied to
211
237
# #
@@ -216,6 +242,8 @@ proc esp_intr_free*(handle: intr_handle_t): esp_err_t {.importc: "esp_intr_free"
216
242
217
243
proc esp_intr_get_cpu * (handle: intr_handle_t): cint {.importc : " esp_intr_get_cpu" ,
218
244
header : " esp_intr_alloc.h" .}
245
+
246
+
219
247
# # *
220
248
# # @brief Get the allocated interrupt for a certain handle
221
249
# #
@@ -226,6 +254,8 @@ proc esp_intr_get_cpu*(handle: intr_handle_t): cint {.importc: "esp_intr_get_cpu
226
254
227
255
proc esp_intr_get_intno * (handle: intr_handle_t): cint {.
228
256
importc : " esp_intr_get_intno" , header : " esp_intr_alloc.h" .}
257
+
258
+
229
259
# # *
230
260
# # @brief Disable the interrupt associated with the handle
231
261
# #
@@ -245,6 +275,8 @@ proc esp_intr_get_intno*(handle: intr_handle_t): cint {.
245
275
246
276
proc esp_intr_disable * (handle: intr_handle_t): esp_err_t {.
247
277
importc : " esp_intr_disable" , header : " esp_intr_alloc.h" .}
278
+
279
+
248
280
# # *
249
281
# # @brief Enable the interrupt associated with the handle
250
282
# #
@@ -259,6 +291,8 @@ proc esp_intr_disable*(handle: intr_handle_t): esp_err_t {.
259
291
260
292
proc esp_intr_enable * (handle: intr_handle_t): esp_err_t {.
261
293
importc : " esp_intr_enable" , header : " esp_intr_alloc.h" .}
294
+
295
+
262
296
# # *
263
297
# # @brief Set the "in IRAM" status of the handler.
264
298
# #
@@ -274,16 +308,22 @@ proc esp_intr_enable*(handle: intr_handle_t): esp_err_t {.
274
308
275
309
proc esp_intr_set_in_iram * (handle: intr_handle_t; is_in_iram: bool ): esp_err_t {.
276
310
importc : " esp_intr_set_in_iram" , header : " esp_intr_alloc.h" .}
311
+
312
+
277
313
# # *
278
314
# # @brief Disable interrupts that aren't specifically marked as running from IRAM
279
315
# #
280
316
281
317
proc esp_intr_noniram_disable * () {.importc : " esp_intr_noniram_disable" ,
282
318
header : " esp_intr_alloc.h" .}
319
+
320
+
283
321
# # *
284
322
# # @brief Re-enable interrupts disabled by esp_intr_noniram_disable
285
323
# #
286
324
287
325
proc esp_intr_noniram_enable * () {.importc : " esp_intr_noniram_enable" ,
288
326
header : " esp_intr_alloc.h" .}
327
+
328
+
289
329
# # *@}
0 commit comments