source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/arduino/avr/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/DRIVERS/INTC/intc.h @ 4837

Last change on this file since 4837 was 4837, checked in by daduve, 2 years ago

Adding new version

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