]> git.sur5r.net Git - freertos/blob - Demo/AVR32_UC3A_GCC/Atmel_SW_Framework/DRIVERS/INTC/intc.h
035f0a9ed0009050428e77d8aa85813f6db548d1
[freertos] / Demo / AVR32_UC3A_GCC / Atmel_SW_Framework / DRIVERS / INTC / intc.h
1 /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */\r
2
3 /*This file is prepared for Doxygen automatic documentation generation.*/\r
4 /*! \file *********************************************************************\r
5  *\r
6  * \brief INTC driver for AVR32 UC3.\r
7  *\r
8  * AVR32 Interrupt Controller driver module.\r
9  *\r
10  * - Compiler:           IAR EWAVR32 and GNU GCC for AVR32\r
11  * - Supported devices:  All AVR32 devices with an INTC module can be used.\r
12  * - AppNote:\r
13  *\r
14  * \author               Atmel Corporation: http://www.atmel.com \n\r
15  *                       Support and FAQ: http://support.atmel.no/\r
16  *\r
17  ******************************************************************************/\r
18 \r
19 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.\r
20  *\r
21  * Redistribution and use in source and binary forms, with or without\r
22  * modification, are permitted provided that the following conditions are met:\r
23  *\r
24  * 1. Redistributions of source code must retain the above copyright notice, this\r
25  * list of conditions and the following disclaimer.\r
26  *\r
27  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
28  * this list of conditions and the following disclaimer in the documentation\r
29  * and/or other materials provided with the distribution.\r
30  *\r
31  * 3. The name of Atmel may not be used to endorse or promote products derived\r
32  * from this software without specific prior written permission.\r
33  *\r
34  * 4. This software may only be redistributed and used in connection with an Atmel\r
35  * AVR product.\r
36  *\r
37  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED\r
38  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
39  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
40  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR\r
41  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
42  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
43  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
45  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
46  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\r
47  *\r
48  */\r
49 \r
50 #ifndef _INTC_H_\r
51 #define _INTC_H_\r
52 \r
53 #include "compiler.h"\r
54 \r
55 \r
56 //! Maximal number of interrupt request lines per group.\r
57 #define AVR32_INTC_MAX_NUM_IRQS_PER_GRP             32\r
58 \r
59 //! Number of interrupt priority levels.\r
60 #define AVR32_INTC_NUM_INT_LEVELS                   (1 << AVR32_INTC_IPR_INTLEVEL_SIZE)\r
61 \r
62 \r
63 #ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.\r
64 \r
65 //! Pointer to interrupt handler.\r
66 #if (defined __GNUC__)\r
67 typedef void (*__int_handler)(void);\r
68 #elif (defined __ICCAVR32__)\r
69 typedef void (__interrupt *__int_handler)(void);\r
70 #endif\r
71 \r
72 \r
73 /*! \brief Initializes the hardware interrupt controller driver.\r
74  *\r
75  * \note Taken and adapted from Newlib.\r
76  */\r
77 extern void INTC_init_interrupts(void);\r
78 \r
79 /*! \brief Registers an interrupt handler.\r
80  *\r
81  * \param handler   Interrupt handler to register.\r
82  * \param irq       IRQ of the interrupt handler to register.\r
83  * \param int_level Interrupt priority level to assign to the group of this IRQ.\r
84  *\r
85  * \warning The interrupt handler must manage the `rete' instruction, what can\r
86  *          be done thanks to pure assembly, inline assembly or the\r
87  *          `__attribute__((__interrupt__))' C function attribute.\r
88  *\r
89  * \warning If several interrupt handlers of a same group are registered with\r
90  *          different priority levels, only the latest priority level set will\r
91  *          be effective.\r
92  *\r
93  * \note Taken and adapted from Newlib.\r
94  */\r
95 extern void INTC_register_interrupt(__int_handler handler, unsigned int irq, unsigned int int_level);\r
96 \r
97 #endif  // __AVR32_ABI_COMPILER__\r
98 \r
99 \r
100 #endif  // _INTC_H_\r