diff options
author | Akshay <[email protected]> | 2022-04-10 12:13:40 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2022-04-10 12:13:40 +0100 |
commit | dc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch) | |
tree | 4ccb8fa5886b66fa9d480edef74236c27f035e16 /lib/chibios/os/hal/ports/common/ARMCMx/nvic.h |
Diffstat (limited to 'lib/chibios/os/hal/ports/common/ARMCMx/nvic.h')
-rw-r--r-- | lib/chibios/os/hal/ports/common/ARMCMx/nvic.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/ports/common/ARMCMx/nvic.h b/lib/chibios/os/hal/ports/common/ARMCMx/nvic.h new file mode 100644 index 000000000..bbbb0c0ba --- /dev/null +++ b/lib/chibios/os/hal/ports/common/ARMCMx/nvic.h | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | /** | ||
18 | * @file common/ARMCMx/nvic.h | ||
19 | * @brief Cortex-Mx NVIC support macros and structures. | ||
20 | * | ||
21 | * @addtogroup COMMON_ARMCMx_NVIC | ||
22 | * @{ | ||
23 | */ | ||
24 | |||
25 | #ifndef NVIC_H | ||
26 | #define NVIC_H | ||
27 | |||
28 | /*===========================================================================*/ | ||
29 | /* Driver constants. */ | ||
30 | /*===========================================================================*/ | ||
31 | |||
32 | /** | ||
33 | * @name System vectors numbers | ||
34 | * @{ | ||
35 | */ | ||
36 | #define HANDLER_MEM_MANAGE 0 /**< MEM MANAGE vector id. */ | ||
37 | #define HANDLER_BUS_FAULT 1 /**< BUS FAULT vector id. */ | ||
38 | #define HANDLER_USAGE_FAULT 2 /**< USAGE FAULT vector id. */ | ||
39 | #define HANDLER_RESERVED_3 3 | ||
40 | #define HANDLER_RESERVED_4 4 | ||
41 | #define HANDLER_RESERVED_5 5 | ||
42 | #define HANDLER_RESERVED_6 6 | ||
43 | #define HANDLER_SVCALL 7 /**< SVCALL vector id. */ | ||
44 | #define HANDLER_DEBUG_MONITOR 8 /**< DEBUG MONITOR vector id. */ | ||
45 | #define HANDLER_RESERVED_9 9 | ||
46 | #define HANDLER_PENDSV 10 /**< PENDSV vector id. */ | ||
47 | #define HANDLER_SYSTICK 11 /**< SYS TCK vector id. */ | ||
48 | /** @} */ | ||
49 | |||
50 | /*===========================================================================*/ | ||
51 | /* Driver pre-compile time settings. */ | ||
52 | /*===========================================================================*/ | ||
53 | |||
54 | /*===========================================================================*/ | ||
55 | /* Derived constants and error checks. */ | ||
56 | /*===========================================================================*/ | ||
57 | |||
58 | /*===========================================================================*/ | ||
59 | /* Driver data structures and types. */ | ||
60 | /*===========================================================================*/ | ||
61 | |||
62 | /*===========================================================================*/ | ||
63 | /* Driver macros. */ | ||
64 | /*===========================================================================*/ | ||
65 | |||
66 | /** | ||
67 | * @brief Priority level to priority mask conversion macro. | ||
68 | */ | ||
69 | #define NVIC_PRIORITY_MASK(prio) ((prio) << (8U - (unsigned)__NVIC_PRIO_BITS)) | ||
70 | |||
71 | /*===========================================================================*/ | ||
72 | /* External declarations. */ | ||
73 | /*===========================================================================*/ | ||
74 | |||
75 | #ifdef __cplusplus | ||
76 | extern "C" { | ||
77 | #endif | ||
78 | void nvicEnableVector(uint32_t n, uint32_t prio); | ||
79 | void nvicDisableVector(uint32_t n); | ||
80 | void nvicSetSystemHandlerPriority(uint32_t handler, uint32_t prio); | ||
81 | void nvicClearPending(uint32_t n); | ||
82 | #ifdef __cplusplus | ||
83 | } | ||
84 | #endif | ||
85 | |||
86 | #endif /* NVIC_H */ | ||
87 | |||
88 | /** @} */ | ||