sam3n port: revert to our custom made register definition includes.
[bertos.git] / bertos / cpu / cortex-m3 / io / sam3.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 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \author Stefano Fedrigo <aleph@develer.com>
34  */
35
36 #ifndef SAM3_H
37 #define SAM3_H
38
39 #include <cpu/detect.h>
40 #include <cfg/compiler.h>
41
42 /*
43  * Peripherals IDs, same as interrupt numbers.
44  */
45 #define SUPC_ID    INT_SUPC     ///< Supply Controller (SUPC)
46 #define RSTC_ID    INT_RSTC     ///< Reset Controller (RSTC)
47 #define RTC_ID     INT_RTC      ///< Real Time Clock (RTC)
48 #define RTT_ID     INT_RTT      ///< Real Time Timer (RTT)
49 #define WDT_ID     INT_WDT      ///< Watchdog Timer (WDT)
50 #define PMC_ID     INT_PMC      ///< Power Management Controller (PMC)
51 #define EFC_ID     INT_EFC      ///< Enhanced Flash Controller (EFC)
52 #define UART0_ID   INT_UART0    ///< UART 0 (UART0)
53 #define UART1_ID   INT_UART1    ///< UART 1 (UART1)
54 #define UART2_ID   INT_UART2    ///< UART 0 (UART0)
55 #define UART3_ID   INT_UART3    ///< UART 1 (UART1)
56 #define PIOA_ID    INT_PIOA     ///< Parallel I/O Controller A (PIOA)
57 #define PIOB_ID    INT_PIOB     ///< Parallel I/O Controller B (PIOB)
58 #define PIOC_ID    INT_PIOC     ///< Parallel I/O Controller C (PIOC)
59 #define US0_ID     INT_USART0   ///< USART 0 (USART0)
60 #define US1_ID     INT_USART1   ///< USART 1 (USART1)
61 #define TWI0_ID    INT_TWI0     ///< Two Wire Interface 0 (TWI0)
62 #define TWI1_ID    INT_TWI1     ///< Two Wire Interface 1 (TWI1)
63 #define SPI0_ID    INT_SPI      ///< Serial Peripheral Interface (SPI)
64 #define TC0_ID     INT_TC0      ///< Timer/Counter 0 (TC0)
65 #define TC1_ID     INT_TC1      ///< Timer/Counter 1 (TC1)
66 #define TC2_ID     INT_TC2      ///< Timer/Counter 2 (TC2)
67 #define TC3_ID     INT_TC3      ///< Timer/Counter 3 (TC3)
68 #define TC4_ID     INT_TC4      ///< Timer/Counter 4 (TC4)
69 #define TC5_ID     INT_TC5      ///< Timer/Counter 5 (TC5)
70 #define ADC_ID     INT_ADC      ///< Analog To Digital Converter (ADC)
71 #define DACC_ID    INT_DACC     ///< Digital To Analog Converter (DACC)
72 #define PWM_ID     INT_PWM      ///< Pulse Width Modulation (PWM)
73
74 /*
75  * Hardware features for drivers.
76  */
77 #define USART_HAS_PDC  1
78
79
80 #include "sam3_sysctl.h"
81 #include "sam3_pmc.h"
82 #include "sam3_memmap.h"
83 #include "sam3_ints.h"
84 #include "sam3_pio.h"
85 #include "sam3_nvic.h"
86 #include "sam3_uart.h"
87 #include "sam3_us.h"
88 #include "sam3_spi.h"
89 #include "sam3_flash.h"
90 #include "sam3_wdt.h"
91
92 /**
93  * UART I/O pins
94  */
95 /*\{*/
96 #if CPU_CM3_AT91SAM3U
97         #define RXD0   11
98         #define TXD0   12
99 #else
100         #define RXD0    9
101         #define TXD0   10
102         #define RXD1    2
103         #define TXD1    3
104 #endif
105 /*\}*/
106
107 /**
108  * PIO I/O pins
109  */
110 /*\{*/
111 #if CPU_CM3_AT91SAM3U
112         #define SPI0_SPCK   15
113         #define SPI0_MOSI   14
114         #define SPI0_MISO   13
115 #else
116         #define SPI0_SPCK   14
117         #define SPI0_MOSI   13
118         #define SPI0_MISO   12
119 #endif
120 /*\}*/
121 #endif /* SAM3_H */