Zephyr Project API
3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
intc_esp32c3.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_DRIVERS_ESP_INTR_ALLOC_H__
8
#define ZEPHYR_INCLUDE_DRIVERS_ESP_INTR_ALLOC_H__
9
10
#include <
stdint.h
>
11
#include <
stdbool.h
>
12
#include <soc.h>
13
/*
14
* Interrupt allocation flags - These flags can be used to specify
15
* which interrupt qualities the code calling esp_intr_alloc* needs.
16
*/
17
18
/* Keep the LEVELx values as they are here; they match up with (1<<level) */
19
#define ESP_INTR_FLAG_LEVEL1 (1<<1)
/* Accept a Level 1 int vector, lowest priority */
20
#define ESP_INTR_FLAG_LEVEL2 (1<<2)
/* Accept a Level 2 int vector */
21
#define ESP_INTR_FLAG_LEVEL3 (1<<3)
/* Accept a Level 3 int vector */
22
#define ESP_INTR_FLAG_LEVEL4 (1<<4)
/* Accept a Level 4 int vector */
23
#define ESP_INTR_FLAG_LEVEL5 (1<<5)
/* Accept a Level 5 int vector */
24
#define ESP_INTR_FLAG_LEVEL6 (1<<6)
/* Accept a Level 6 int vector */
25
#define ESP_INTR_FLAG_NMI (1<<7)
/* Accept a Level 7 int vector, highest priority */
26
#define ESP_INTR_FLAG_SHARED (1<<8)
/* Interrupt can be shared between ISRs */
27
#define ESP_INTR_FLAG_EDGE (1<<9)
/* Edge-triggered interrupt */
28
#define ESP_INTR_FLAG_IRAM (1<<10)
/* ISR can be called if cache is disabled */
29
#define ESP_INTR_FLAG_INTRDISABLED (1<<11)
/* Return with this interrupt disabled */
30
31
/* Low and medium prio interrupts. These can be handled in C. */
32
#define ESP_INTR_FLAG_LOWMED (ESP_INTR_FLAG_LEVEL1|ESP_INTR_FLAG_LEVEL2|ESP_INTR_FLAG_LEVEL3)
33
34
/* High level interrupts. Need to be handled in assembly. */
35
#define ESP_INTR_FLAG_HIGH (ESP_INTR_FLAG_LEVEL4|ESP_INTR_FLAG_LEVEL5|ESP_INTR_FLAG_LEVEL6| \
36
ESP_INTR_FLAG_NMI)
37
38
/* Mask for all level flags */
39
#define ESP_INTR_FLAG_LEVELMASK (ESP_INTR_FLAG_LEVEL1|ESP_INTR_FLAG_LEVEL2|ESP_INTR_FLAG_LEVEL3| \
40
ESP_INTR_FLAG_LEVEL4|ESP_INTR_FLAG_LEVEL5|ESP_INTR_FLAG_LEVEL6| \
41
ESP_INTR_FLAG_NMI)
42
43
/* Function prototype for interrupt handler function */
44
typedef
void (*
isr_handler_t
)(
const
void
*arg);
45
49
void
esp_intr_initialize
(
void
);
50
76
int
esp_intr_alloc
(
int
source,
77
int
flags
,
78
isr_handler_t
handler
,
79
void
*arg,
80
void
**ret_handle);
81
90
int
esp_intr_disable
(
int
source);
91
99
int
esp_intr_enable
(
int
source);
100
107
uint32_t
esp_intr_get_enabled_intmask
(
int
status_mask_number);
108
109
#endif
esp_intr_alloc
int esp_intr_alloc(int source, int flags, isr_handler_t handler, void *arg, void **ret_handle)
Allocate an interrupt with the given parameters.
esp_intr_disable
int esp_intr_disable(int source)
Disable the interrupt associated with the source.
esp_intr_get_enabled_intmask
uint32_t esp_intr_get_enabled_intmask(int status_mask_number)
Gets the current enabled interrupts.
isr_handler_t
void(* isr_handler_t)(const void *arg)
Definition
intc_esp32c3.h:44
esp_intr_initialize
void esp_intr_initialize(void)
Initializes interrupt table to its defaults.
esp_intr_enable
int esp_intr_enable(int source)
Enable the interrupt associated with the source.
flags
flags
Definition
parser.h:96
stdbool.h
stdint.h
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
handler
static void handler(struct k_timer *timer)
Definition
main.c:19
include
zephyr
drivers
interrupt_controller
intc_esp32c3.h
Generated on Sun Sep 15 2024 17:01:30 for Zephyr Project API by
1.9.8