1 /* ----------------------------------------------------------------------------
2  *         SAM Software Package License
3  * ----------------------------------------------------------------------------
4  * Copyright (c) 2012, Atmel Corporation
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following condition is met:
10  *
11  * - Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the disclaimer below.
13  *
14  * Atmel's name may not be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
20  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  * ----------------------------------------------------------------------------
28  */
29 
30 #ifndef _SAM_INCLUDED_
31 #define _SAM_INCLUDED_
32 
33 #define part_is_defined(part) (defined(__ ## part ## __))
34 
35 /*
36  * ----------------------------------------------------------------------------
37  * SAM3 family
38  * ----------------------------------------------------------------------------
39  */
40 
41 /* SAM3N series */
42 #define SAM3N00 ( \
43     part_is_defined( SAM3N00A ) || \
44     part_is_defined( SAM3N00B ) )
45 
46 #define SAM3N0 ( \
47     part_is_defined( SAM3N0A ) || \
48     part_is_defined( SAM3N0B ) || \
49     part_is_defined( SAM3N0C ) )
50 
51 #define SAM3N1 ( \
52     part_is_defined( SAM3N1A ) || \
53     part_is_defined( SAM3N1B ) || \
54     part_is_defined( SAM3N1C ) )
55 
56 #define SAM3N2 ( \
57     part_is_defined( SAM3N2A ) || \
58     part_is_defined( SAM3N2B ) || \
59     part_is_defined( SAM3N2C ) )
60 
61 #define SAM3N4 ( \
62     part_is_defined( SAM3N4A ) || \
63     part_is_defined( SAM3N4B ) || \
64     part_is_defined( SAM3N4C ) )
65 
66 /* Entire SAM3N series */
67 #define SAM3N_SERIES (SAM3N00 || SAM3N0 || SAM3N1 || SAM3N2 || SAM3N4)
68 
69 
70 /* SAM3S series */
71 #define SAM3S00 ( \
72     part_is_defined( SAM3S00A ) || \
73     part_is_defined( SAM3S00B ) )
74 
75 #define SAM3S0 ( \
76     part_is_defined( SAM3S0A ) || \
77     part_is_defined( SAM3S0B ) || \
78     part_is_defined( SAM3S0C ) )
79 
80 #define SAM3S1 ( \
81     part_is_defined( SAM3S1A ) || \
82     part_is_defined( SAM3S1B ) || \
83     part_is_defined( SAM3S1C ) )
84 
85 #define SAM3S2 ( \
86     part_is_defined( SAM3S2A ) || \
87     part_is_defined( SAM3S2B ) || \
88     part_is_defined( SAM3S2C ) )
89 
90 #define SAM3S4 ( \
91     part_is_defined( SAM3S4A ) || \
92     part_is_defined( SAM3S4B ) || \
93     part_is_defined( SAM3S4C ) )
94 
95 /* Entire SAM3S series */
96 #define SAM3S_SERIES (SAM3S00 || SAM3S0 ||SAM3S1 || SAM3S2 || SAM3S4)
97 
98 /* SAM3SD8 series */
99 #define SAM3S8 ( \
100     part_is_defined( SAM3S8B ) || \
101     part_is_defined( SAM3S8C ) )
102 
103 #define SAM3SD8 ( \
104     part_is_defined( SAM3SD8B ) || \
105     part_is_defined( SAM3SD8C ) )
106 
107 /* Entire SAM3SD8 series */
108 #define SAM3SD8_SERIES (SAM3S8 || SAM3SD8)
109 
110 /* SAM3U series */
111 #define SAM3U1 ( \
112     part_is_defined( SAM3U1C ) || \
113     part_is_defined( SAM3U1E ) )
114 
115 #define SAM3U2 ( \
116     part_is_defined( SAM3U2C ) || \
117     part_is_defined( SAM3U2E ) )
118 
119 #define SAM3U4 ( \
120     part_is_defined( SAM3U4C ) || \
121     part_is_defined( SAM3U4E ) )
122 
123 /* Entire SAM3U series */
124 #define SAM3U_SERIES (SAM3U1 || SAM3U2 || SAM3U4)
125 
126 /* SAM3XA series */
127 #define SAM3X4 ( \
128     part_is_defined( SAM3X4C ) || \
129     part_is_defined( SAM3X4E ) )
130 
131 #define SAM3X8 ( \
132     part_is_defined( SAM3X8C ) || \
133     part_is_defined( SAM3X8E ) || \
134     part_is_defined( SAM3X8H ) )
135 
136 #define SAM3A4 ( \
137     part_is_defined( SAM3A4C ) )
138 
139 #define SAM3A8 ( \
140     part_is_defined( SAM3A8C ) )
141 
142 /* Entire SAM3XA series */
143 #define SAM3XA_SERIES ( SAM3X4 || SAM3X8 || SAM3A4 || SAM3A8)
144 
145 /*
146  * ----------------------------------------------------------------------------
147  * SAM4 family
148  * ----------------------------------------------------------------------------
149  */
150 
151 
152 /* Entire SAM3 Family */
153 #define SAM3_SERIES ( SAM3N_SERIES || SAM3S_SERIES || SAM3SD8_SERIES || SAM3U_SERIES || SAM3XA_SERIES )
154 
155 /* SAM4S series */
156 #define SAM4S8 ( \
157     part_is_defined( SAM4S8B ) || \
158     part_is_defined( SAM4S8C ) )
159 
160 #define SAM4S16 ( \
161     part_is_defined( SAM4S16B ) || \
162     part_is_defined( SAM4S16C ) )
163 
164 /* Entire SAM4S series */
165 #define SAM4S_SERIES ( SAM4S8 || SAM4S16)
166 
167 /* Entire SAM4 Family */
168 #define SAM4_SERIES ( SAM4S_SERIES )
169 
170 /*
171  * ----------------------------------------------------------------------------
172  * SAM9 family
173  * ----------------------------------------------------------------------------
174  */
175 
176 /*
177  * ----------------------------------------------------------------------------
178  * SAM7 family
179  * ----------------------------------------------------------------------------
180  */
181 
182 
183 
184 /*
185  * ----------------------------------------------------------------------------
186  * Whole SAM product line
187  * ----------------------------------------------------------------------------
188  */
189 #define SAM ( SAM3_SERIES || SAM4_SERIES )
190 
191 /*
192  * ----------------------------------------------------------------------------
193  * Header inclusion
194  * ----------------------------------------------------------------------------
195  */
196 
197 #if SAM3_SERIES
198 #include "sam3.h"
199 #endif /* SAM3 */
200 
201 #if SAM4_SERIES
202 #include "sam4.h"
203 #endif /* SAM4 */
204 
205 #endif /* _SAM_INCLUDED_ */
206