CMSIS2000  0.0.7
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
interrupt.h
Go to the documentation of this file.
1 /*
2  * CMSIS2000
3  * CMSIS-like sources for LPC2xxx series MCUs
4  *
5  * (C) Copyright 2011-2012, Dmitriy Cherepanov, All Rights Reserved
6  *
7  * Version: 0.0.7
8  * Date of the Last Update: 2013-03-04
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a copy
11  * of this software and associated documentation files (the "Software"), to
12  * deal in the Software without restriction, including without limitation the
13  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14  * sell copies of the Software, and to permit persons to whom the Software is
15  * furnished to do so, subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be included in
18  * all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26  * IN THE SOFTWARE.
27  *
28  * Do not be lasy! For the latest version see http://irtos.sourceforge.net .
29  *
30  *
31 #*/
32 /** \file
33  *\if russian_lng
34  * Файл определяющий макросы прерываний и исключений
35  *\else
36  * This file is used to define exeptions and interrupt subroutines macroses
37  *\endif
38  * \note need to insert iConfig.h or FreeRTOSConfig.h before for ISR_IRQ_OS_PROTO macroses
39  */
40 #ifndef _iARCH_INTERRUPT_H_
41 #define _iARCH_INTERRUPT_H_ 1
42 
43 #include "iArch.h"
44 /*-----------Документация Doxygen -- Doxygen documentation -----------------*/
45 
46 #if defined(DOXYGEN_SHOULD_SKIP_THIS)
47 /**\ingroup xgc_port
48 
49 *\if russian_lng
50  * \defgroup arch_interrupts Макросы для прерываний
51  * \brief Платфоромнезависимое создание и объявление обработчиков прерываний и исключений
52  *
53  *
54  * \note для правильной работы ISR_IRQ_OS_PROTO надо вставить iConfig.h или FreeRTOSConfig.h перед макросом
55  *\else
56  * \defgroup arch_interrupts Interrupt macroses
57  * \brief Arch independent interrupt and exceptions handlers declaration and creation
58  *
59  * \note need to insert iConfig.h or FreeRTOSConfig.h before for ISR_IRQ_OS_PROTO macroses
60  *\endif
61  */
62 
63 /* the base is ISR_HANDLER
64 dot {
65  ISR_HANDLER -> ISR_EXCEPTION ;
66 // ISR_EXCEPTION -> ISR_EXCEPTION_OS;
67  ISR_HANDLER -> ISR_IRQ -> ISR_IRQ_OS;
68 }
69 */
70 
71 
72 /** \def ISR_EXCEPTION_PROTO(name)
73  \ingroup arch_interrupts
74  \code #include "arch/interrupt.h" \endcode
75  \~russian Макрос объявляющий функции-обработчика исключений
76  \~english Exception SubRoutine function macros
77 
78  \~
79  \param name The name of exeption (restart IRQ FIQ and etc.)
80 */
81 #define ISR_EXCEPTION_PROTO(name)
82 /** \def ISR_EXCEPTION(name)
83  \ingroup arch_interrupts
84  \code #include "arch/interrupt.h" \endcode
85  \~russian Макрос функции-обработчика исключений
86  \~english Exception SubRoutine function macros
87 
88  \~
89  \param name The name of exeption (restart IRQ FIQ and etc.)
90 */
91 #define ISR_EXCEPTION(name)
92 /** \def ISR_IRQ_PROTO(name)
93  \ingroup arch_interrupts
94  \code #include "arch/interrupt.h" \endcode
95  \~russian Макрос объявляющий функцию-обработчика прерываний
96  \~english Interrupt SubRoutine function macros
97 
98  \~
99  \param name The name of device or interrupt vector (ex. UART0 SPI1 I2C2 and etc)
100  \note in arm DO function name##_IRQHandler accoding to CMSIS SPECIFICATION
101 */
102 #define ISR_IRQ(name)
103 /** \def ISR_IRQ(name)
104  \ingroup arch_interrupts
105  \code #include "arch/interrupt.h" \endcode
106  \~russian Макрос функции-обработчика прерываний
107  \~english Interrupt SubRoutine function macros
108 
109  \~
110  \param name The name of device or interrupt vector (ex. UART0 SPI1 I2C2 and etc)
111  \note in arm DO function name##_IRQHandler accoding to CMSIS SPECIFICATION
112 */
113 #define ISR_IRQ_OS_PROTO(name)
114 /** \def ISR_IRQ_OS_PROTO(name)
115  \ingroup arch_interrupts
116  \code #include "arch/interrupt.h" \endcode
117  \~russian Макрос объявляющий функцию-обработчика прерываний c поддержкой ОС
118  \~english Interrupt SubRoutine function macros with OS support
119 
120  \~
121  \param name The name of device or interrupt vector (ex. UART0 SPI1 I2C2 and etc)
122  \note in arm DO function name##_IRQHandler accoding to CMSIS SPECIFICATION
123 */
124 #define ISR_IRQ_OS(name)
125 /** \def ISR_IRQ_OS(name)
126  \ingroup arch_interrupts
127  \code #include "arch/interrupt.h" \endcode
128  \~russian Макрос функции-обработчика прерываний c поддержкой ОС
129  \~english Interrupt SubRoutine function macros with OS support
130 
131  \~
132  \param name The name of device or interrupt vector (ex. UART0 SPI1 I2C2 and etc)
133  \note in arm DO function name##_IRQHandler according to CMSIS SPECIFICATION
134 */
135 #else
136 /*----------------------------------------------------------------------------*/
137 #ifndef i_ARCH
138  #error Wrong definition: i_ARCH should be defined \
139  usally it definded in bsp_board_def.h. or mcu_id.h
140 #endif
141 /*----------------------------------------------------------------------------*/
142 
143 #if i_ARCH_CHECK(POSIX_GENERIC)
144  #include "posix/interrupt.h"
145 #endif
146 #if i_ARCH_CHECK(AVR_MEGA)
147  #include "avr/interrupt.h"
148 #endif
149 #if i_ARCH_CHECK(ARM7)
150  #include "arm/interrupt.h"
151 #endif
152 #if (i_ARCH_CHECK(CM0) || i_ARCH_CHECK(CM3) || i_ARCH_CHECK(CM4) )
153  #include "arm/interrupt_cortex.h"
154 #endif
155 
156 #if i_ARCH_CHECK(WIN_NT)
157  #include "winnt/iArch.h"
158 #endif
159 /*----------- THE DEFAULT PROTOTYPING OF THIS HANDLERS -----------------------*/
160 #ifndef ISR_HANDLER
161  #define ISR_HANDLER(name) void name(void)
162 #endif
163 
164 #ifndef ISR_HANDLER_PROTO
165  #define ISR_HANDLER_PROTO(name) ISR_HANDLER(name)
166 #endif
167 
168 /*----------------ISR_EXCEPTION ----------------------------------------------*/
169 #ifndef ISR_EXCEPTION_PROTO
170  #define ISR_EXCEPTION_PROTO(name) ISR_HANDLER_PROTO(name)
171 #endif
172 #ifndef ISR_EXCEPTION
173  #define ISR_EXCEPTION(name) ISR_HANDLER(name)
174 #endif
175 /*----------------ISR_IRQ ----------------------------------------------------*/
176 #ifndef ISR_IRQ_PROTO
177  #define ISR_IRQ_PROTO(name) ISR_HANDLER_PROTO(name)
178 #endif
179 #ifndef ISR_IRQ
180  #define ISR_IRQ(name) ISR_HANDLER(name)
181 #endif
182 /*----------------ISR_IRQ_OS -------------------------------------------------*/
183 #ifndef ISR_IRQ_OS_PROTO
184  #define ISR_IRQ_OS_PROTO(name) ISR_IRQ_PROTO(name)
185 #endif
186 #ifndef ISR_IRQ_OS
187  #define ISR_IRQ_OS(name) ISR_IRQ(name)
188 #endif
189 
190 #endif /*defined(__DOXYGEN__) */
191 /*----------------------------------------------------------------------------*/
192 /**\brief ISR_ptr_type is the type of pointer to ISR HANDLER
193  * \ingroup arch_interrupts
194  */
195 typedef ISR_HANDLER((*ISR_ptr_type));/*typedef void * (*ISR_ptr_type)(void);*/
196 //typedef void (*ISR_ptr_type) (void);/*typedef void * (*ISR_ptr_type)(void);*/
197 
198 
199 #endif /* _iARCH_INTERRUPT_H_ */