diff options
Diffstat (limited to 'lib/chibios/os/common/startup/e200/devices/SPC56ECxx/intc.h')
-rw-r--r-- | lib/chibios/os/common/startup/e200/devices/SPC56ECxx/intc.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/lib/chibios/os/common/startup/e200/devices/SPC56ECxx/intc.h b/lib/chibios/os/common/startup/e200/devices/SPC56ECxx/intc.h new file mode 100644 index 000000000..bbf3cde88 --- /dev/null +++ b/lib/chibios/os/common/startup/e200/devices/SPC56ECxx/intc.h | |||
@@ -0,0 +1,95 @@ | |||
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 SPC56ECxx/intc.h | ||
19 | * @brief SPC56ECxx INTC module header. | ||
20 | * | ||
21 | * @addtogroup INTC | ||
22 | * @{ | ||
23 | */ | ||
24 | |||
25 | #ifndef INTC_H | ||
26 | #define INTC_H | ||
27 | |||
28 | /*===========================================================================*/ | ||
29 | /* Module constants. */ | ||
30 | /*===========================================================================*/ | ||
31 | |||
32 | /** | ||
33 | * @name INTC addresses | ||
34 | * @{ | ||
35 | */ | ||
36 | #define INTC_BASE 0xFFF48000 | ||
37 | #define INTC_IACKR_ADDR (INTC_BASE + 0x10) | ||
38 | #define INTC_EOIR_ADDR (INTC_BASE + 0x18) | ||
39 | /** @} */ | ||
40 | |||
41 | /** | ||
42 | * @brief INTC priority levels. | ||
43 | */ | ||
44 | #define INTC_PRIORITY_LEVELS 16U | ||
45 | |||
46 | /*===========================================================================*/ | ||
47 | /* Module pre-compile time settings. */ | ||
48 | /*===========================================================================*/ | ||
49 | |||
50 | /*===========================================================================*/ | ||
51 | /* Derived constants and error checks. */ | ||
52 | /*===========================================================================*/ | ||
53 | |||
54 | /*===========================================================================*/ | ||
55 | /* Module data structures and types. */ | ||
56 | /*===========================================================================*/ | ||
57 | |||
58 | /*===========================================================================*/ | ||
59 | /* Module macros. */ | ||
60 | /*===========================================================================*/ | ||
61 | |||
62 | /** | ||
63 | * @name INTC-related macros | ||
64 | * @{ | ||
65 | */ | ||
66 | #define INTC_BCR (*((volatile uint32_t *)(INTC_BASE + 0))) | ||
67 | #define INTC_CPR(n) (*((volatile uint32_t *)(INTC_BASE + 8 + ((n) * sizeof (uint32_t))))) | ||
68 | #define INTC_IACKR(n) (*((volatile uint32_t *)(INTC_BASE + 0x10 + ((n) * sizeof (uint32_t))))) | ||
69 | #define INTC_EOIR(n) (*((volatile uint32_t *)(INTC_BASE + 0x18 + ((n) * sizeof (uint32_t))))) | ||
70 | #define INTC_PSR(n) (*((volatile uint8_t *)(INTC_BASE + 0x40 + ((n) * sizeof (uint8_t))))) | ||
71 | /** @} */ | ||
72 | |||
73 | /** | ||
74 | * @brief Core selection macros for PSR register. | ||
75 | */ | ||
76 | #define INTC_PSR_CORE0 0x00 | ||
77 | #define INTC_PSR_CORE1 0xC0 | ||
78 | #define INTC_PSR_CORES01 0x40 | ||
79 | |||
80 | /** | ||
81 | * @brief PSR register content helper | ||
82 | */ | ||
83 | #define INTC_PSR_ENABLE(cores, prio) ((uint32_t)(cores) | (uint32_t)(prio)) | ||
84 | |||
85 | /*===========================================================================*/ | ||
86 | /* External declarations. */ | ||
87 | /*===========================================================================*/ | ||
88 | |||
89 | /*===========================================================================*/ | ||
90 | /* Module inline functions. */ | ||
91 | /*===========================================================================*/ | ||
92 | |||
93 | #endif /* INTC_H */ | ||
94 | |||
95 | /** @} */ | ||