Zephyr Project API  3.2.0
A Scalable Open Source RTOS
cmsis.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
14#ifndef ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_CORTEX_M_CMSIS_H_
15#define ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_CORTEX_M_CMSIS_H_
16
17#include <soc.h>
18
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/* Fill in CMSIS required values for non-CMSIS compliant SoCs.
26 * Use __NVIC_PRIO_BITS as it is required and simple to check, but
27 * ultimately all SoCs will define their own CMSIS types and constants.
28 */
29#ifndef __NVIC_PRIO_BITS
30typedef enum {
34#if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
35 MemoryManagement_IRQn = -12,
36 BusFault_IRQn = -11,
37 UsageFault_IRQn = -10,
38#if defined(CONFIG_ARM_SECURE_FIRMWARE)
39 SecureFault_IRQn = -9,
40#endif /* CONFIG_ARM_SECURE_FIRMWARE */
41#endif /* CONFIG_ARMV7_M_ARMV8_M_MAINLINE */
47} IRQn_Type;
48
49#if defined(CONFIG_CPU_CORTEX_M0)
50#define __CM0_REV 0
51#elif defined(CONFIG_CPU_CORTEX_M0PLUS)
52#define __CM0PLUS_REV 0
53#elif defined(CONFIG_CPU_CORTEX_M1)
54#define __CM1_REV 0
55#elif defined(CONFIG_CPU_CORTEX_M3)
56#define __CM3_REV 0
57#elif defined(CONFIG_CPU_CORTEX_M4)
58#define __CM4_REV 0
59#elif defined(CONFIG_CPU_CORTEX_M7)
60#define __CM7_REV 0
61#elif defined(CONFIG_CPU_CORTEX_M23)
62#define __CM23_REV 0
63#elif defined(CONFIG_CPU_CORTEX_M33)
64#define __CM33_REV 0
65#elif defined(CONFIG_CPU_CORTEX_M55)
66#define __CM55_REV 0
67#else
68#error "Unknown Cortex-M device"
69#endif
70
71#ifndef __MPU_PRESENT
72#define __MPU_PRESENT 0U
73#endif
74#define __NVIC_PRIO_BITS NUM_IRQ_PRIO_BITS
75#define __Vendor_SysTickConfig 0 /* Default to standard SysTick */
76#endif /* __NVIC_PRIO_BITS */
77
78#if __NVIC_PRIO_BITS != NUM_IRQ_PRIO_BITS
79#error "NUM_IRQ_PRIO_BITS and __NVIC_PRIO_BITS are not set to the same value"
80#endif
81
82#ifdef __cplusplus
83}
84#endif
85
86#if defined(CONFIG_CPU_CORTEX_M0)
87#include <core_cm0.h>
88#elif defined(CONFIG_CPU_CORTEX_M0PLUS)
89#include <core_cm0plus.h>
90#elif defined(CONFIG_CPU_CORTEX_M1)
91#include <core_cm1.h>
92#elif defined(CONFIG_CPU_CORTEX_M3)
93#include <core_cm3.h>
94#elif defined(CONFIG_CPU_CORTEX_M4)
95#include <core_cm4.h>
96#elif defined(CONFIG_CPU_CORTEX_M7)
97#include <core_cm7.h>
98#elif defined(CONFIG_CPU_CORTEX_M23)
99#include <core_cm23.h>
100#elif defined(CONFIG_CPU_CORTEX_M33)
101#include <core_cm33.h>
102#elif defined(CONFIG_CPU_CORTEX_M55)
103#include <core_cm55.h>
104#else
105#error "Unknown Cortex-M device"
106#endif
107
108#endif /* ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_CORTEX_M_CMSIS_H_ */
#define CONFIG_NUM_IRQS
Definition: irq.h:93
IRQn_Type
Definition: cmsis.h:30
@ PendSV_IRQn
Definition: cmsis.h:44
@ SVCall_IRQn
Definition: cmsis.h:42
@ Reset_IRQn
Definition: cmsis.h:31
@ SysTick_IRQn
Definition: cmsis.h:45
@ DebugMonitor_IRQn
Definition: cmsis.h:43
@ Max_IRQn
Definition: cmsis.h:46
@ HardFault_IRQn
Definition: cmsis.h:33
@ NonMaskableInt_IRQn
Definition: cmsis.h:32