Refactor to use new protocol module and sipo.
[bertos.git] / bertos / cpu / cortex-m3 / io / sam3_ints.h
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2010,2011 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \brief SAM3 interrupt definitions.
34  */
35
36 #ifndef SAM3_INTS_H
37 #define SAM3_INTS_H
38
39 /**
40  * Defines for the fault assignments.
41  */
42 /*\{*/
43 #define FAULT_NMI               2           ///< NMI fault
44 #define FAULT_HARD              3           ///< Hard fault
45 #define FAULT_MPU               4           ///< MPU fault
46 #define FAULT_BUS               5           ///< Bus fault
47 #define FAULT_USAGE             6           ///< Usage fault
48 #define FAULT_SVCALL            11          ///< SVCall
49 #define FAULT_DEBUG             12          ///< Debug monitor
50 #define FAULT_PENDSV            14          ///< PendSV
51 #define FAULT_SYSTICK           15          ///< System Tick
52 /*\}*/
53
54 /**
55  * Defines for the interrupt assignments.
56  */
57 /*\{*/
58 #define INT_PERIPH_BASE  16
59
60 #if CPU_CM3_SAM3N
61         #define INT_SUPC        (INT_PERIPH_BASE + SUPC_ID)
62         #define INT_RSTC        (INT_PERIPH_BASE + RSTC_ID)
63         #define INT_RTC         (INT_PERIPH_BASE + RTC_ID)
64         #define INT_RTT         (INT_PERIPH_BASE + RTT_ID)
65         #define INT_WDT         (INT_PERIPH_BASE + WDT_ID)
66         #define INT_PMC         (INT_PERIPH_BASE + PMC_ID)
67         #define INT_EFC         (INT_PERIPH_BASE + EFC_ID)
68         #define INT_UART0       (INT_PERIPH_BASE + UART0_ID)
69         #define INT_UART1       (INT_PERIPH_BASE + UART1_ID)
70         #define INT_PIOA        (INT_PERIPH_BASE + PIOA_ID)
71         #define INT_PIOB        (INT_PERIPH_BASE + PIOB_ID)
72         #define INT_PIOC        (INT_PERIPH_BASE + PIOC_ID)
73         #define INT_US0         (INT_PERIPH_BASE + US0_ID)
74         #define INT_US1         (INT_PERIPH_BASE + US1_ID)
75         #define INT_TWI0        (INT_PERIPH_BASE + TWI0_ID)
76         #define INT_TWI1        (INT_PERIPH_BASE + TWI1_ID)
77         #define INT_SPI0        (INT_PERIPH_BASE + SPI0_ID)
78         #define INT_TC0         (INT_PERIPH_BASE + TC0_ID)
79         #define INT_TC1         (INT_PERIPH_BASE + TC1_ID)
80         #define INT_TC2         (INT_PERIPH_BASE + TC2_ID)
81         #define INT_TC3         (INT_PERIPH_BASE + TC3_ID)
82         #define INT_TC4         (INT_PERIPH_BASE + TC4_ID)
83         #define INT_TC5         (INT_PERIPH_BASE + TC5_ID)
84         #define INT_ADC         (INT_PERIPH_BASE + ADC_ID)
85         #define INT_DACC        (INT_PERIPH_BASE + DACC_ID)
86         #define INT_PWM         (INT_PERIPH_BASE + PWM_ID)
87
88         // Total number of interrupts.
89         #define NUM_INTERRUPTS  48
90
91 #elif CPU_CM3_SAM3X
92         #define INT_SUPC        (INT_PERIPH_BASE + SUPC_ID)
93         #define INT_RSTC        (INT_PERIPH_BASE + RSTC_ID)
94         #define INT_RTC         (INT_PERIPH_BASE + RTC_ID)
95         #define INT_RTT         (INT_PERIPH_BASE + RTT_ID)
96         #define INT_WDT         (INT_PERIPH_BASE + WDT_ID)
97         #define INT_PMC         (INT_PERIPH_BASE + PMC_ID)
98         #define INT_EEFC0       (INT_PERIPH_BASE + EEFC0_ID)
99         #define INT_EEFC1       (INT_PERIPH_BASE + EEFC1_ID)
100         #define INT_UART0       (INT_PERIPH_BASE + UART0_ID)
101         #define INT_SMC_SDRAMC  (INT_PERIPH_BASE + SMC_SDRAMC_ID)
102         #define INT_SDRAMC      (INT_PERIPH_BASE + SDRAMC_ID)
103         #define INT_PIOA        (INT_PERIPH_BASE + PIOA_ID)
104         #define INT_PIOB        (INT_PERIPH_BASE + PIOB_ID)
105         #define INT_PIOC        (INT_PERIPH_BASE + PIOC_ID)
106         #define INT_PIOD        (INT_PERIPH_BASE + PIOD_ID)
107         #define INT_PIOE        (INT_PERIPH_BASE + PIOE_ID)
108         #define INT_PIOF        (INT_PERIPH_BASE + PIOF_ID)
109         #define INT_US0         (INT_PERIPH_BASE + US0_ID)
110         #define INT_US1         (INT_PERIPH_BASE + US1_ID)
111         #define INT_US2         (INT_PERIPH_BASE + US2_ID)
112         #define INT_US3         (INT_PERIPH_BASE + US3_ID)
113         #define INT_HSMCI       (INT_PERIPH_BASE + HSMCI_ID)
114         #define INT_TWI0        (INT_PERIPH_BASE + TWI0_ID)
115         #define INT_TWI1        (INT_PERIPH_BASE + TWI1_ID)
116         #define INT_SPI0        (INT_PERIPH_BASE + SPI0_ID)
117         #define INT_SPI1        (INT_PERIPH_BASE + SPI1_ID)
118         #define INT_SSC         (INT_PERIPH_BASE + SSC_ID)
119         #define INT_TC0         (INT_PERIPH_BASE + TC0_ID)
120         #define INT_TC1         (INT_PERIPH_BASE + TC1_ID)
121         #define INT_TC2         (INT_PERIPH_BASE + TC2_ID)
122         #define INT_TC3         (INT_PERIPH_BASE + TC3_ID)
123         #define INT_TC4         (INT_PERIPH_BASE + TC4_ID)
124         #define INT_TC5         (INT_PERIPH_BASE + TC5_ID)
125         #define INT_TC6         (INT_PERIPH_BASE + TC6_ID)
126         #define INT_TC7         (INT_PERIPH_BASE + TC7_ID)
127         #define INT_TC8         (INT_PERIPH_BASE + TC8_ID)
128         #define INT_PWM         (INT_PERIPH_BASE + PWM_ID)
129         #define INT_ADC         (INT_PERIPH_BASE + ADC_ID)
130         #define INT_DACC        (INT_PERIPH_BASE + DACC_ID)
131         #define INT_DMAC        (INT_PERIPH_BASE + DMAC_ID)
132         #define INT_UOTGHS      (INT_PERIPH_BASE + UOTGHS_ID)
133         #define INT_TRNG        (INT_PERIPH_BASE + TRNG_ID)
134         #define INT_EMAC        (INT_PERIPH_BASE + EMAC_ID)
135         #define INT_CAN0        (INT_PERIPH_BASE + CAN0_ID)
136         #define INT_CAN1        (INT_PERIPH_BASE + CAN1_ID)
137
138         // Total number of interrupts.
139         #define NUM_INTERRUPTS  61
140
141 #else
142         #error Peripheral IDs undefined
143 #endif
144 /*\}*/
145
146 #endif /* SAM3_INTS_H */