1# Copyright (c) 2022 Gerson Fernando Budke
2# SPDX-License-Identifier: Apache-2.0
3#
4# Sources:
5# - Atmel-42223G–SAM-R21_Datasheet–05/2016 (Revision G - 05/2016)
6#
7# Pin codes:
8#
9# - 32      pins: e
10# - 48      pins: g
11
12model: atmel,sam
13
14family: r21
15
16map: SAM_PINMUX
17
18series: [r21]
19
20variants:
21  - pincode: e
22    series: [r21]
23  - pincode: g
24    series: [r21]
25
26pins:
27  pa00:
28    pincodes: [g]
29    periph:
30      - [d, sercom1, pad0]
31      - [e, tcc2, wo0]
32  pa01:
33    pincodes: [g]
34    periph:
35      - [a, eic, extint1]
36      - [d, sercom1, pad1]
37      - [e, tcc2, wo1]
38  pa04:
39    pincodes: [g]
40    periph:
41      - [a, eic, extint4]
42      - [b, adc, vrefb]
43      - [b, adc, ain4]
44      - [b, ac, ain0]
45      - [b, ptc, y2]
46      - [d, sercom0, pad0]
47      - [e, tcc0, wo0]
48  pa05:
49    pincodes: [g]
50    periph:
51      - [a, eic, extint5]
52      - [b, adc, ain5]
53      - [b, ac, ain1]
54      - [b, ptc, y3]
55      - [d, sercom0, pad1]
56      - [e, tcc0, wo1]
57  pa06:
58    pincodes: [e, g]
59    periph:
60      - [a, eic, extint6]
61      - [b, adc, ain6]
62      - [b, ac, ain2]
63      - [b, ptc, y4]
64      - [d, sercom0, pad2]
65      - [e, tcc1, wo0]
66  pa07:
67    pincodes: [e, g]
68    periph:
69      - [a, eic, extint7]
70      - [b, adc, ain7]
71      - [b, ac, ain3]
72      - [b, ptc, y5]
73      - [d, sercom0, pad3]
74      - [e, tcc1, wo1]
75  pa08:
76    pincodes: [e, g]
77    periph:
78      - [a, eic, nmi]
79      - [b, adc, ain16]
80      - [b, ptc, x0]
81      - [c, sercom0, pad0]
82      - [d, sercom2, pad0]
83      - [e, tcc0, wo0]
84      - [f, radio, fectrl0]
85  pa09:
86    pincodes: [e, g]
87    periph:
88      - [a, eic, extint9]
89      - [b, adc, ain17]
90      - [b, ptc, x1]
91      - [c, sercom0, pad1]
92      - [d, sercom2, pad1]
93      - [e, tcc0, wo1]
94      - [f, radio, fectrl1]
95  pa12:
96    pincodes: [g]
97    periph:
98      - [a, eic, extint12]
99      - [c, sercom2, pad0]
100      - [e, tcc2, wo0]
101      - [f, radio, fectrl2]
102      - [h, ac, cmp0]
103  pa13:
104    pincodes: [g]
105    periph:
106      - [a, eic, extint13]
107      - [c, sercom2, pad1]
108      - [e, tcc2, wo1]
109      - [f, radio, fectrl3]
110      - [h, ac, cmp1]
111  pa14:
112    pincodes: [e, g]
113    periph:
114      - [a, eic, extint14]
115      - [c, sercom2, pad2]
116      - [e, tc3, wo0]
117      - [f, radio, fectrl4]
118      - [h, gclk, io0]
119  pa15:
120    pincodes: [e, g]
121    periph:
122      - [a, eic, extint15]
123      - [c, sercom2, pad3]
124      - [e, tc3, wo1]
125      - [f, radio, fectrl5]
126      - [h, gclk, io1]
127  pa16:
128    pincodes: [e, g]
129    periph:
130      - [b, ptc, x4]
131      - [c, sercom1, pad0]
132      - [d, sercom3, pad0]
133      - [e, tcc2, wo0]
134      - [f, tcc0, wo6]
135      - [h, gclk, io2]
136  pa17:
137    pincodes: [e, g]
138    periph:
139      - [a, eic, extint1]
140      - [b, ptc, x5]
141      - [c, sercom1, pad1]
142      - [d, sercom3, pad1]
143      - [e, tcc2, wo1]
144      - [f, tcc0, wo7]
145      - [h, gclk, io3]
146  pa18:
147    pincodes: [e, g]
148    periph:
149      - [a, eic, extint2]
150      - [b, ptc, x6]
151      - [c, sercom1, pad2]
152      - [d, sercom3, pad2]
153      - [e, tc3, wo0]
154      - [f, tcc0, wo2]
155      - [h, ac, cmp0]
156  pa19:
157    pincodes: [e, g]
158    periph:
159      - [a, eic, extint3]
160      - [b, ptc, x7]
161      - [c, sercom1, pad3]
162      - [d, sercom3, pad3]
163      - [e, tc3, wo1]
164      - [f, tcc0, wo3]
165      - [h, ac, cmp1]
166  pa22:
167    pincodes: [g]
168    periph:
169      - [a, eic, extint6]
170      - [b, ptc, x10]
171      - [c, sercom3, pad0]
172      - [d, sercom5, pad0]
173      - [e, tc4, wo0]
174      - [f, tcc0, wo4]
175      - [h, gclk, io6]
176  pa23:
177    pincodes: [g]
178    periph:
179      - [a, eic, extint7]
180      - [b, ptc, x11]
181      - [c, sercom3, pad1]
182      - [d, sercom5, pad1]
183      - [e, tc4, wo1]
184      - [f, tcc0, wo5]
185      - [g, usb, sof]
186      - [h, gclk, io7]
187  pa24:
188    pincodes: [e, g]
189    periph:
190      - [a, eic, extint12]
191      - [c, sercom3, pad2]
192      - [d, sercom5, pad2]
193      - [e, tc5, wo0]
194      - [f, tcc1, wo2]
195      - [g, usb, dm]
196  pa25:
197    pincodes: [e, g]
198    periph:
199      - [a, eic, extint13]
200      - [b, ptc, x11]
201      - [c, sercom3, pad3]
202      - [d, sercom5, pad3]
203      - [e, tc5, wo1]
204      - [f, tcc1, wo3]
205      - [g, usb, dp]
206  pb22:
207    pincodes: [g]
208    periph:
209      - [a, eic, extint6]
210      - [d, sercom5, pad2]
211      - [h, gclk, io0]
212  pb23:
213    pincodes: [g]
214    periph:
215      - [a, eic, extint7]
216      - [d, sercom5, pad3]
217      - [h, gclk, io1]
218  pa27:
219    pincodes: [e, g]
220    periph:
221      - [a, eic, extint15]
222      - [f, sercom3, pad0]
223      - [h, gclk, io0]
224  pa28:
225    pincodes: [e, g]
226    periph:
227      - [a, eic, extint8]
228      - [f, sercom3, pad1]
229      - [h, gclk, io0]
230  pa30:
231    pincodes: [e, g]
232    periph:
233      - [a, eic, extint10]
234      - [d, sercom1, pad2]
235      - [e, tcc1, wo0]
236      - [g, swd, clk]
237      - [h, gclk, io0]
238  pa31:
239    pincodes: [e, g]
240    periph:
241      - [a, eic, extint11]
242      - [d, sercom1, pad3]
243      - [e, tcc1, wo1]
244      - [g, swd, io]
245  pb02:
246    pincodes: [g]
247    periph:
248      - [a, eic, extint2]
249      - [b, adc, ain10]
250      - [b, ptc, y8]
251      - [d, sercom5, pad0]
252  pb03:
253    pincodes: [g]
254    periph:
255      - [a, eic, extint3]
256      - [b, adc, ain11]
257      - [b, ptc, y9]
258      - [d, sercom5, pad1]
259
260# Internal Multiplexed Signals
261
262  pa10:
263    pincodes: [e, g]
264    periph:
265      - [a, eic, extint10]
266      # dig3
267  pa11:
268    pincodes: [e, g]
269    periph:
270      - [a, eic, extint11]
271      # dig4
272  pa20:
273    pincodes: [e, g]
274      # slp_tr
275  pb00:
276    pincodes: [e, g]
277    periph:
278      - [a, eic, extint0]
279      # irq
280  pb15:
281    pincodes: [e, g]
282      # rstn
283  pb16:
284    pincodes: [e, g]
285    periph:
286      - [a, eic, extint0]
287      # dig1
288  pb17:
289    pincodes: [e, g]
290    periph:
291      - [a, eic, extint1]
292      # dig2
293  pb30:
294    pincodes: [e, g]
295    periph:
296      - [f, sercom4, pad2]
297      # mosi
298  pb31:
299    pincodes: [e, g]
300    periph:
301      - [f, sercom4, pad1]
302      # sel
303  pc16:
304    pincodes: [e, g]
305    periph:
306      - [f, glkc, io1]
307      # clkm (Die revision A uses GCLK/IO[5])
308  pc18:
309    pincodes: [e, g]
310    periph:
311      - [f, sercom4, pad3]
312      # sclk
313  pc19:
314    pincodes: [e, g]
315    periph:
316      - [f, sercom4, pad0]
317      # miso
318