1# Copyright (c) 2022 Gerson Fernando Budke
2# SPDX-License-Identifier: Apache-2.0
3#
4# Sources:
5# - SAM4S Datasheet (Revision K - 06/15)
6#
7# Pin codes:
8#
9# - 48  pins: a
10# - 64  pins: b
11# - 100 pins: c
12
13model: atmel,sam
14
15family: sam4s
16
17map: SAM_PINMUX
18
19# SAM4S, SAM4SA, SAM4SD
20series: [4sX]
21
22variants:
23  - pincode: a
24    series: [4sX]
25    exception: y
26  - pincode: b
27    series: [4sX]
28  - pincode: c
29    series: [4sX]
30
31pins:
32  pa0:
33    pincodes: [a, b, c]
34    periph:
35      - [a, pwm, pwmh0]
36      - [b, tc0, tioa0]
37      - [c, ebi, a17, [a, b]]
38    wakeup:
39      - [x, supc, wkup0]
40  pa1:
41    pincodes: [a, b, c]
42    periph:
43      - [a, pwm, pwmh1]
44      - [b, tc0, tiob0]
45      - [c, ebi, a18, [a, b]]
46    wakeup:
47      - [x, supc, wkup1]
48  pa2:
49    pincodes: [a, b, c]
50    periph:
51      - [a, pwm, pwmh2]
52      - [b, usart0, sck]
53      - [c, dacc, datrg]
54    wakeup:
55      - [x, supc, wkup2]
56  pa3:
57    pincodes: [a, b, c]
58    periph:
59      - [a, twi0, twd]
60      - [b, spi, npcs3]
61  pa4:
62    pincodes: [a, b, c]
63    periph:
64      - [a, twi0, twck]
65      - [b, tc0, tclk0]
66    wakeup:
67      - [x, supc, wkup3]
68  pa5:
69    pincodes: [a, b, c]
70    periph:
71      - [a, usart0, rxd]
72      - [b, spi, npcs3]
73    wakeup:
74      - [x, supc, wkup4]
75  pa6:
76    pincodes: [a, b, c]
77    periph:
78      - [a, usart0, txd]
79      - [b, pmc, pck0]
80  pa7:
81    pincodes: [a, b, c]
82    periph:
83      - [a, usart0, rts]
84      - [b, pwm, pwmh3]
85    system:
86      - [s, supc, xin32]
87  pa8:
88    pincodes: [a, b, c]
89    periph:
90      - [a, usart0, cts]
91      - [b, adc, adtrg]
92    wakeup:
93      - [x, supc, wkup5]
94    system:
95      - [s, supc, xout32]
96  pa9:
97    pincodes: [a, b, c]
98    periph:
99      - [a, uart0, rxd]
100      - [b, spi, npcs1]
101      - [c, pwm, pwmfi0]
102    wakeup:
103      - [x, supc, wkup6]
104  pa10:
105    pincodes: [a, b, c]
106    periph:
107      - [a, uart0, txd]
108      - [b, spi, npcs2]
109      - [c, pwm, pwmfi1]
110  pa11:
111    pincodes: [a, b, c]
112    periph:
113      - [a, spi, npcs0]
114      - [b, pwm, pwmh0]
115    wakeup:
116      - [x, supc, wkup7]
117  pa12:
118    pincodes: [a, b, c]
119    periph:
120      - [a, spi, miso]
121      - [b, pwm, pwmh1]
122  pa13:
123    pincodes: [a, b, c]
124    periph:
125      - [a, spi, mosi]
126      - [b, pwm, pwmh2]
127  pa14:
128    pincodes: [a, b, c]
129    periph:
130      - [a, spi, spck]
131      - [b, pwm, pwmh3]
132    wakeup:
133      - [x, supc, wkup8]
134  pa15:
135    pincodes: [a, b, c]
136    periph:
137      - [a, ssc, tf]
138      - [b, tc0, tioa1]
139      - [c, pwm, pwml3]
140    extra:
141      - [x, pio, piodcen1]
142    wakeup:
143      - [x, supc, wkup14]
144  pa16:
145    pincodes: [a, b, c]
146    periph:
147      - [a, ssc, tk]
148      - [b, tc0, tiob1]
149      - [c, pwm, pwml2]
150    extra:
151      - [x, pio, piodcen2]
152    wakeup:
153      - [x, supc, wkup15]
154  pa17:
155    pincodes: [a, b, c]
156    periph:
157      - [a, ssc, td]
158      - [b, pmc, pck1]
159      - [c, pwm, pwmh3]
160    extra:
161      - [x, adc, ad0]
162  pa18:
163    pincodes: [a, b, c]
164    periph:
165      - [a, ssc, rd]
166      - [b, pmc, pck2]
167      - [c, ebi, a14, [a, b]]
168      - [d, pwm, pwmfi2]
169    extra:
170      - [x, adc, ad1]
171  pa19:
172    pincodes: [a, b, c]
173    periph:
174      - [a, ssc, rk]
175      - [b, pwm, pwml0]
176      - [c, ebi, a15, [a, b]]
177    extra:
178      - [x, adc, ad2]
179    wakeup:
180      - [x, supc, wkup9]
181  pa20:
182    pincodes: [a, b, c]
183    periph:
184      - [a, ssc, rf]
185      - [b, pwm, pwml1]
186      - [c, ebi, a16, [a, b]]
187    extra:
188      - [x, adc, ad3]
189    wakeup:
190      - [x, supc, wkup10]
191  pa21:
192    pincodes: [b, c]
193    periph:
194      - [a, usart1, rxd]
195      - [b, pmc, pck1]
196    extra:
197      - [x, adc, ad8]
198  pa22:
199    pincodes: [b, c]
200    periph:
201      - [a, usart1, txd]
202      - [b, spi, npcs3]
203      - [c, ebi, ncs2, [a, b]]
204    extra:
205      - [x, adc, ad9]
206  pa23:
207    pincodes: [b, c]
208    periph:
209      - [a, usart1, sck]
210      - [b, pwm, pwmh0]
211      - [c, ebi, a19, [a, b]]
212    extra:
213      - [x, pio, piodcclk]
214  pa24:
215    pincodes: [b, c]
216    periph:
217      - [a, usart1, rts]
218      - [b, pwm, pwmh1]
219      - [c, ebi, a20, [a, b]]
220    extra:
221      - [x, pio, piodc0]
222  pa25:
223    pincodes: [b, c]
224    periph:
225      - [a, usart1, cts]
226      - [b, pwm, pwmh2]
227      - [c, ebi, a23, [a, b]]
228    extra:
229      - [x, pio, piodc1]
230  pa26:
231    pincodes: [b, c]
232    periph:
233      - [a, usart1, dcd]
234      - [b, tc02, tioa2]
235      - [c, hsmci, mcda2, [a]]
236    extra:
237      - [x, pio, piodc2]
238  pa27:
239    pincodes: [b, c]
240    periph:
241      - [a, usart1, dtr]
242      - [b, tc0, tiob2]
243      - [c, hsmci, mcda3, [a]]
244    extra:
245      - [x, pio, piodc3]
246  pa28:
247    pincodes: [b, c]
248    periph:
249      - [a, usart1, dsr]
250      - [b, tc0, tclk1]
251      - [c, hsmci, mccda, [a]]
252    extra:
253      - [x, pio, piodc4]
254  pa29:
255    pincodes: [b, c]
256    periph:
257      - [a, usart1, ri1]
258      - [b, tc0, tclk2]
259      - [c, hsmci, mcck, [a]]
260    extra:
261      - [x, pio, piodc5]
262  pa30:
263    pincodes: [b, c]
264    periph:
265      - [a, pwm, pwml2]
266      - [b, spi, npcs2]
267      - [c, hsmci, mcda0, [a]]
268    extra:
269      - [x, pio, piodc6]
270    wakeup:
271      - [x, supc, wkup11]
272  pa31:
273    pincodes: [b, c]
274    periph:
275      - [a, spi, npcs1]
276      - [b, pmc, pck2]
277      - [c, hsmci, mcda1, [a]]
278    extra:
279      - [x, pio, piodc7]
280  pb0:
281    pincodes: [a, b, c]
282    periph:
283      - [a, pwm, pwmh0]
284    extra:
285      - [x, adc, ad4]
286      - [x, rtc, out0]
287  pb1:
288    pincodes: [a, b, c]
289    periph:
290      - [a, pwm, pwmh1]
291    extra:
292      - [x, adc, ad5]
293      - [x, rtc, out1]
294  pb2:
295    pincodes: [a, b, c]
296    periph:
297      - [a, uart1, rxd]
298      - [b, spi, npcs2]
299    extra:
300      - [x, adc, ad6]
301    wakeup:
302      - [x, supc, wkup12]
303  pb3:
304    pincodes: [a, b, c]
305    periph:
306      - [a, uart1, txd]
307      - [b, pmc, pck2]
308    extra:
309      - [x, adc, ad7]
310  pb4:
311    pincodes: [a, b, c]
312    periph:
313      - [a, twi1, twd]
314      - [b, pwm, pwmh2]
315    system:
316      - [s, jtag, tdi]
317  pb5:
318    pincodes: [a, b, c]
319    periph:
320      - [a, twi1, twck]
321      - [b, pwm, pwml0]
322    wakeup:
323      - [x, supc, wkup13]
324    system:
325      - [s, jtag, tdo]
326      - [s, swd, traceswo]
327  pb6:
328    pincodes: [a, b, c]
329    system:
330      - [s, jtag, tms]
331      - [s, swd, swdio]
332  pb7:
333    pincodes: [a, b, c]
334    system:
335      - [s, jtag, tck]
336      - [s, swd, swclk]
337  pb8:
338    pincodes: [a, b, c]
339    system:
340      - [s, supc, xout]
341  pb9:
342    pincodes: [a, b, c]
343    system:
344      - [s, supc, xin]
345  pb10:
346    pincodes: [a, b, c]
347    system:
348      - [s, udp, ddm]
349  pb11:
350    pincodes: [a, b, c]
351    system:
352      - [s, udp, ddp]
353  pb12:
354    pincodes: [a, b, c]
355    periph:
356      - [a, pwm, pwml1]
357    system:
358      - [s, flash, erase]
359  pb13:
360    pincodes: [b, c]
361    periph:
362      - [a, pwm, pwml2]
363      - [b, pmc, pck0]
364      - [d, dacc, dac0, [a]]
365  pb14:
366    pincodes: [b, c]
367    periph:
368      - [a, spi, npcs1]
369      - [b, pwm, pwmh3]
370      - [d, dacc, dac1, [a]]
371  pc0:
372    pincodes: [c]
373    periph:
374      - [a, ebi, d0, [a, b]]
375      - [b, pwm, pwml0]
376  pc1:
377    pincodes: [c]
378    periph:
379      - [a, ebi, d1, [a, b]]
380      - [b, pwm, pwml1]
381  pc2:
382    pincodes: [c]
383    periph:
384      - [a, ebi, d2, [a, b]]
385      - [b, pwm, pwml2]
386  pc3:
387    pincodes: [c]
388    periph:
389      - [a, ebi, d3, [a, b]]
390      - [b, pwm, pwml3]
391  pc4:
392    pincodes: [c]
393    periph:
394      - [a, ebi, d4, [a, b]]
395      - [b, spi, npcs1]
396  pc5:
397    pincodes: [c]
398    periph:
399      - [a, ebi, d5, [a, b]]
400  pc6:
401    pincodes: [c]
402    periph:
403      - [a, ebi, d6, [a, b]]
404  pc7:
405    pincodes: [c]
406    periph:
407      - [a, ebi, d7, [a, b]]
408  pc8:
409    pincodes: [c]
410    periph:
411      - [a, ebi, nwe, [a, b]]
412  pc9:
413    pincodes: [c]
414    periph:
415      - [a, ebi, nandoe, [a, b]]
416  pc10:
417    pincodes: [c]
418    periph:
419      - [a, ebi, nandwe, [a, b]]
420  pc11:
421    pincodes: [c]
422    periph:
423      - [a, ebi, nrd, [a, b]]
424  pc12:
425    pincodes: [c]
426    periph:
427      - [a, ebi, ncs3, [a, b]]
428    extra:
429      - [x, adc, ad12]
430  pc13:
431    pincodes: [c]
432    periph:
433      - [a, ebi, nwait, [a, b]]
434      - [b, pwm, pwml0]
435    extra:
436      - [x, adc, ad10]
437  pc14:
438    pincodes: [c]
439    periph:
440      - [a, ebi, ncs0, [a, b]]
441  pc15:
442    pincodes: [c]
443    periph:
444      - [a, ebi, ncs1, [a, b]]
445      - [b, pwm, pwml1]
446    extra:
447      - [x, adc, ad11]
448  pc16:
449    pincodes: [c]
450    periph:
451      - [a, ebi, a21_nandale, [a, b]]
452  pc17:
453    pincodes: [c]
454    periph:
455      - [a, ebi, a22_nandcle, [a, b]]
456  pc18:
457    pincodes: [c]
458    periph:
459      - [a, ebi, a0, [a, b]]
460      - [b, pwm, pwmh0]
461  pc19:
462    pincodes: [c]
463    periph:
464      - [a, ebi, a1, [a, b]]
465      - [b, pwm, pwmh1]
466  pc20:
467    pincodes: [c]
468    periph:
469      - [a, ebi, a2, [a, b]]
470      - [b, pwm, pwmh2]
471  pc21:
472    pincodes: [c]
473    periph:
474      - [a, ebi, a3, [a, b]]
475      - [b, pwm, pwmh3]
476  pc22:
477    pincodes: [c]
478    periph:
479      - [a, ebi, a4, [a, b]]
480      - [b, pwm, pwml3]
481  pc23:
482    pincodes: [c]
483    periph:
484      - [a, ebi, a5, [a, b]]
485      - [b, tc1, tioa3]
486  pc24:
487    pincodes: [c]
488    periph:
489      - [a, ebi, a6, [a, b]]
490      - [b, tc1, tiob3]
491  pc25:
492    pincodes: [c]
493    periph:
494      - [a, ebi, a7, [a, b]]
495      - [b, tc1, tclk3]
496  pc26:
497    pincodes: [c]
498    periph:
499      - [a, ebi, a8, [a, b]]
500      - [b, tc1, tioa4]
501  pc27:
502    pincodes: [c]
503    periph:
504      - [a, ebi, a9, [a, b]]
505      - [b, tc1, tiob4]
506  pc28:
507    pincodes: [c]
508    periph:
509      - [a, ebi, a10, [a, b]]
510      - [b, tc1, tclk4]
511  pc29:
512    pincodes: [c]
513    periph:
514      - [a, ebi, a11, [a, b]]
515      - [b, tc1, tioa5]
516    extra:
517      - [x, adc, ad13]
518  pc30:
519    pincodes: [c]
520    periph:
521      - [a, ebi, a12, [a, b]]
522      - [b, tc1, tiob5]
523    extra:
524      - [x, adc, ad14]
525  pc31:
526    pincodes: [c]
527    periph:
528      - [a, ebi, a13, [a, b]]
529      - [b, tc1, tclk5]
530