]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/asf/common/utils/interrupt.h
Add demo for SAM3S-EK2.
[freertos] / FreeRTOS / Demo / CORTEX_ATSAM3S-EK2_Atmel_Studio / src / asf / common / utils / interrupt.h
1 /**\r
2  * \file\r
3  *\r
4  * \brief Global interrupt management for 8- and 32-bit AVR\r
5  *\r
6  * Copyright (c) 2010-2012 Atmel Corporation. All rights reserved.\r
7  *\r
8  * \asf_license_start\r
9  *\r
10  * \page License\r
11  *\r
12  * Redistribution and use in source and binary forms, with or without\r
13  * modification, are permitted provided that the following conditions are met:\r
14  *\r
15  * 1. Redistributions of source code must retain the above copyright notice,\r
16  *    this list of conditions and the following disclaimer.\r
17  *\r
18  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
19  *    this list of conditions and the following disclaimer in the documentation\r
20  *    and/or other materials provided with the distribution.\r
21  *\r
22  * 3. The name of Atmel may not be used to endorse or promote products derived\r
23  *    from this software without specific prior written permission.\r
24  *\r
25  * 4. This software may only be redistributed and used in connection with an\r
26  *    Atmel microcontroller product.\r
27  *\r
28  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED\r
29  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
31  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR\r
32  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\r
36  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
37  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
38  * POSSIBILITY OF SUCH DAMAGE.\r
39  *\r
40  * \asf_license_stop\r
41  *\r
42  */\r
43 #ifndef UTILS_INTERRUPT_H\r
44 #define UTILS_INTERRUPT_H\r
45 \r
46 #include <parts.h>\r
47 \r
48 #if XMEGA || MEGA\r
49 #  include "interrupt/interrupt_avr8.h"\r
50 #elif UC3\r
51 #  include "interrupt/interrupt_avr32.h"\r
52 #elif SAM3S || SAM3N || SAM3XA || SAM3U || SAM4S\r
53 #  include "interrupt/interrupt_sam_nvic.h"\r
54 #else\r
55 #  error Unsupported device.\r
56 #endif\r
57 \r
58 /**\r
59  * \defgroup interrupt_group Global interrupt management\r
60  *\r
61  * This is a driver for global enabling and disabling of interrupts.\r
62  *\r
63  * @{\r
64  */\r
65 \r
66 #if defined(__DOXYGEN__)\r
67 /**\r
68  * \def CONFIG_INTERRUPT_FORCE_INTC\r
69  * \brief Force usage of the ASF INTC driver\r
70  *\r
71  * Predefine this symbol when preprocessing to force the use of the ASF INTC driver.\r
72  * This is useful to ensure compatibilty accross compilers and shall be used only when required\r
73  * by the application needs.\r
74  */\r
75 #  define CONFIG_INTERRUPT_FORCE_INTC\r
76 #endif\r
77 \r
78 //! \name Global interrupt flags\r
79 //@{\r
80 /**\r
81  * \typedef irqflags_t\r
82  * \brief Type used for holding state of interrupt flag\r
83  */\r
84 \r
85 /**\r
86  * \def cpu_irq_enable\r
87  * \brief Enable interrupts globally\r
88  */\r
89 \r
90 /**\r
91  * \def cpu_irq_disable\r
92  * \brief Disable interrupts globally\r
93  */\r
94 \r
95 /**\r
96  * \fn irqflags_t cpu_irq_save(void)\r
97  * \brief Get and clear the global interrupt flags\r
98  *\r
99  * Use in conjunction with \ref cpu_irq_restore.\r
100  *\r
101  * \return Current state of interrupt flags.\r
102  *\r
103  * \note This function leaves interrupts disabled.\r
104  */\r
105 \r
106 /**\r
107  * \fn void cpu_irq_restore(irqflags_t flags)\r
108  * \brief Restore global interrupt flags\r
109  *\r
110  * Use in conjunction with \ref cpu_irq_save.\r
111  *\r
112  * \param flags State to set interrupt flag to.\r
113  */\r
114 \r
115 /**\r
116  * \fn bool cpu_irq_is_enabled_flags(irqflags_t flags)\r
117  * \brief Check if interrupts are globally enabled in supplied flags\r
118  *\r
119  * \param flags Currents state of interrupt flags.\r
120  *\r
121  * \return True if interrupts are enabled.\r
122  */\r
123 \r
124 /**\r
125  * \def cpu_irq_is_enabled\r
126  * \brief Check if interrupts are globally enabled\r
127  *\r
128  * \return True if interrupts are enabled.\r
129  */\r
130 //@}\r
131 \r
132 //! @}\r
133 \r
134 /**\r
135  * \ingroup interrupt_group\r
136  * \defgroup interrupt_deprecated_group Deprecated interrupt definitions\r
137  */\r
138 \r
139 #endif /* UTILS_INTERRUPT_H */\r