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    extra:
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    extra:
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    extra:
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    extra:
67      - [x, supc, wkup3]
68  pa5:
69    pincodes: [a, b, c]
70    periph:
71      - [a, usart0, rxd]
72      - [b, spi, npcs3]
73    extra:
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    extra:
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    extra:
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    extra:
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    extra:
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      - [x, supc, wkup14]
143  pa16:
144    pincodes: [a, b, c]
145    periph:
146      - [a, ssc, tk]
147      - [b, tc0, tiob1]
148      - [c, pwm, pwml2]
149    extra:
150      - [x, pio, piodcen2]
151      - [x, supc, wkup15]
152  pa17:
153    pincodes: [a, b, c]
154    periph:
155      - [a, ssc, td]
156      - [b, pmc, pck1]
157      - [c, pwm, pwmh3]
158    extra:
159      - [x, adc, ad0]
160  pa18:
161    pincodes: [a, b, c]
162    periph:
163      - [a, ssc, rd]
164      - [b, pmc, pck2]
165      - [c, ebi, a14, [a, b]]
166      - [d, pwm, pwmfi2]
167    extra:
168      - [x, adc, ad1]
169  pa19:
170    pincodes: [a, b, c]
171    periph:
172      - [a, ssc, rk]
173      - [b, pwm, pwml0]
174      - [c, ebi, a15, [a, b]]
175    extra:
176      - [x, adc, ad2]
177      - [x, supc, wkup9]
178  pa20:
179    pincodes: [a, b, c]
180    periph:
181      - [a, ssc, rf]
182      - [b, pwm, pwml1]
183      - [c, ebi, a16, [a, b]]
184    extra:
185      - [x, adc, ad3]
186      - [x, supc, wkup10]
187  pa21:
188    pincodes: [b, c]
189    periph:
190      - [a, usart1, rxd]
191      - [b, pmc, pck1]
192    extra:
193      - [x, adc, ad8]
194  pa22:
195    pincodes: [b, c]
196    periph:
197      - [a, usart1, txd]
198      - [b, spi, npcs3]
199      - [c, ebi, ncs2, [a, b]]
200    extra:
201      - [x, adc, ad9]
202  pa23:
203    pincodes: [b, c]
204    periph:
205      - [a, usart1, sck]
206      - [b, pwm, pwmh0]
207      - [c, ebi, a19, [a, b]]
208    extra:
209      - [x, pio, piodcclk]
210  pa24:
211    pincodes: [b, c]
212    periph:
213      - [a, usart1, rts]
214      - [b, pwm, pwmh1]
215      - [c, ebi, a20, [a, b]]
216    extra:
217      - [x, pio, piodc0]
218  pa25:
219    pincodes: [b, c]
220    periph:
221      - [a, usart1, cts]
222      - [b, pwm, pwmh2]
223      - [c, ebi, a23, [a, b]]
224    extra:
225      - [x, pio, piodc1]
226  pa26:
227    pincodes: [b, c]
228    periph:
229      - [a, usart1, dcd]
230      - [b, tc02, tioa2]
231      - [c, hsmci, mcda2, [a]]
232    extra:
233      - [x, pio, piodc2]
234  pa27:
235    pincodes: [b, c]
236    periph:
237      - [a, usart1, dtr]
238      - [b, tc0, tiob2]
239      - [c, hsmci, mcda3, [a]]
240    extra:
241      - [x, pio, piodc3]
242  pa28:
243    pincodes: [b, c]
244    periph:
245      - [a, usart1, dsr]
246      - [b, tc0, tclk1]
247      - [c, hsmci, mccda, [a]]
248    extra:
249      - [x, pio, piodc4]
250  pa29:
251    pincodes: [b, c]
252    periph:
253      - [a, usart1, ri1]
254      - [b, tc0, tclk2]
255      - [c, hsmci, mcck, [a]]
256    extra:
257      - [x, pio, piodc5]
258  pa30:
259    pincodes: [b, c]
260    periph:
261      - [a, pwm, pwml2]
262      - [b, spi, npcs2]
263      - [c, hsmci, mcda0, [a]]
264    extra:
265      - [x, pio, piodc6]
266      - [x, supc, wkup11]
267  pa31:
268    pincodes: [b, c]
269    periph:
270      - [a, spi, npcs1]
271      - [b, pmc, pck2]
272      - [c, hsmci, mcda1, [a]]
273    extra:
274      - [x, pio, piodc7]
275  pb0:
276    pincodes: [a, b, c]
277    periph:
278      - [a, pwm, pwmh0]
279    extra:
280      - [x, adc, ad4]
281      - [x, rtc, out0]
282  pb1:
283    pincodes: [a, b, c]
284    periph:
285      - [a, pwm, pwmh1]
286    extra:
287      - [x, adc, ad5]
288      - [x, rtc, out1]
289  pb2:
290    pincodes: [a, b, c]
291    periph:
292      - [a, uart1, rxd]
293      - [b, spi, npcs2]
294    extra:
295      - [x, adc, ad6]
296      - [x, supc, wkup12]
297  pb3:
298    pincodes: [a, b, c]
299    periph:
300      - [a, uart1, txd]
301      - [b, pmc, pck2]
302    extra:
303      - [x, adc, ad7]
304  pb4:
305    pincodes: [a, b, c]
306    periph:
307      - [a, twi1, twd]
308      - [b, pwm, pwmh2]
309    system:
310      - [s, jtag, tdi]
311  pb5:
312    pincodes: [a, b, c]
313    periph:
314      - [a, twi1, twck]
315      - [b, pwm, pwml0]
316    extra:
317      - [x, supc, wkup13]
318    system:
319      - [s, jtag, tdo]
320      - [s, swd, traceswo]
321  pb6:
322    pincodes: [a, b, c]
323    system:
324      - [s, jtag, tms]
325      - [s, swd, swdio]
326  pb7:
327    pincodes: [a, b, c]
328    system:
329      - [s, jtag, tck]
330      - [s, swd, swclk]
331  pb8:
332    pincodes: [a, b, c]
333    system:
334      - [s, supc, xout]
335  pb9:
336    pincodes: [a, b, c]
337    system:
338      - [s, supc, xin]
339  pb10:
340    pincodes: [a, b, c]
341    system:
342      - [s, udp, ddm]
343  pb11:
344    pincodes: [a, b, c]
345    system:
346      - [s, udp, ddp]
347  pb12:
348    pincodes: [a, b, c]
349    periph:
350      - [a, pwm, pwml1]
351    system:
352      - [s, flash, erase]
353  pb13:
354    pincodes: [b, c]
355    periph:
356      - [a, pwm, pwml2]
357      - [b, pmc, pck0]
358      - [d, dacc, dac0, [a]]
359  pb14:
360    pincodes: [b, c]
361    periph:
362      - [a, spi, npcs1]
363      - [b, pwm, pwmh3]
364      - [d, dacc, dac1, [a]]
365  pc0:
366    pincodes: [c]
367    periph:
368      - [a, ebi, d0, [a, b]]
369      - [b, pwm, pwml0]
370  pc1:
371    pincodes: [c]
372    periph:
373      - [a, ebi, d1, [a, b]]
374      - [b, pwm, pwml1]
375  pc2:
376    pincodes: [c]
377    periph:
378      - [a, ebi, d2, [a, b]]
379      - [b, pwm, pwml2]
380  pc3:
381    pincodes: [c]
382    periph:
383      - [a, ebi, d3, [a, b]]
384      - [b, pwm, pwml3]
385  pc4:
386    pincodes: [c]
387    periph:
388      - [a, ebi, d4, [a, b]]
389      - [b, spi, npcs1]
390  pc5:
391    pincodes: [c]
392    periph:
393      - [a, ebi, d5, [a, b]]
394  pc6:
395    pincodes: [c]
396    periph:
397      - [a, ebi, d6, [a, b]]
398  pc7:
399    pincodes: [c]
400    periph:
401      - [a, ebi, d7, [a, b]]
402  pc8:
403    pincodes: [c]
404    periph:
405      - [a, ebi, nwe, [a, b]]
406  pc9:
407    pincodes: [c]
408    periph:
409      - [a, ebi, nandoe, [a, b]]
410  pc10:
411    pincodes: [c]
412    periph:
413      - [a, ebi, nandwe, [a, b]]
414  pc11:
415    pincodes: [c]
416    periph:
417      - [a, ebi, nrd, [a, b]]
418  pc12:
419    pincodes: [c]
420    periph:
421      - [a, ebi, ncs3, [a, b]]
422    extra:
423      - [x, adc, ad12]
424  pc13:
425    pincodes: [c]
426    periph:
427      - [a, ebi, nwait, [a, b]]
428      - [b, pwm, pwml0]
429    extra:
430      - [x, adc, ad10]
431  pc14:
432    pincodes: [c]
433    periph:
434      - [a, ebi, ncs0, [a, b]]
435  pc15:
436    pincodes: [c]
437    periph:
438      - [a, ebi, ncs1, [a, b]]
439      - [b, pwm, pwml1]
440    extra:
441      - [x, adc, ad11]
442  pc16:
443    pincodes: [c]
444    periph:
445      - [a, ebi, a21_nandale, [a, b]]
446  pc17:
447    pincodes: [c]
448    periph:
449      - [a, ebi, a22_nandcle, [a, b]]
450  pc18:
451    pincodes: [c]
452    periph:
453      - [a, ebi, a0, [a, b]]
454      - [b, pwm, pwmh0]
455  pc19:
456    pincodes: [c]
457    periph:
458      - [a, ebi, a1, [a, b]]
459      - [b, pwm, pwmh1]
460  pc20:
461    pincodes: [c]
462    periph:
463      - [a, ebi, a2, [a, b]]
464      - [b, pwm, pwmh2]
465  pc21:
466    pincodes: [c]
467    periph:
468      - [a, ebi, a3, [a, b]]
469      - [b, pwm, pwmh3]
470  pc22:
471    pincodes: [c]
472    periph:
473      - [a, ebi, a4, [a, b]]
474      - [b, pwm, pwml3]
475  pc23:
476    pincodes: [c]
477    periph:
478      - [a, ebi, a5, [a, b]]
479      - [b, tc1, tioa3]
480  pc24:
481    pincodes: [c]
482    periph:
483      - [a, ebi, a6, [a, b]]
484      - [b, tc1, tiob3]
485  pc25:
486    pincodes: [c]
487    periph:
488      - [a, ebi, a7, [a, b]]
489      - [b, tc1, tclk3]
490  pc26:
491    pincodes: [c]
492    periph:
493      - [a, ebi, a8, [a, b]]
494      - [b, tc1, tioa4]
495  pc27:
496    pincodes: [c]
497    periph:
498      - [a, ebi, a9, [a, b]]
499      - [b, tc1, tiob4]
500  pc28:
501    pincodes: [c]
502    periph:
503      - [a, ebi, a10, [a, b]]
504      - [b, tc1, tclk4]
505  pc29:
506    pincodes: [c]
507    periph:
508      - [a, ebi, a11, [a, b]]
509      - [b, tc1, tioa5]
510    extra:
511      - [x, adc, ad13]
512  pc30:
513    pincodes: [c]
514    periph:
515      - [a, ebi, a12, [a, b]]
516      - [b, tc1, tiob5]
517    extra:
518      - [x, adc, ad14]
519  pc31:
520    pincodes: [c]
521    periph:
522      - [a, ebi, a13, [a, b]]
523      - [b, tc1, tclk5]
524