1# GD32A503XX pin definitions
2#
3# Sources:
4# - GD32A503XX Datasheet (Revision 1.3)
5#
6# Pin codes:
7#
8# - 32 pins: K
9# - 48 pins: C
10# - 64 pins: R
11# - 100 pins: V
12#
13# Memory codes:
14#
15# - 128Kb  Flash, 24Kb SRAM: B
16# - 256Kb Flash, 32Kb SRAM: C
17# - 384Kb Flash, 48Kb SRAM: D
18#
19# Copyright (c) 2022 YuLong Yao <feilongphone@gmail.com>
20# SPDX-License-Identifier: Apache 2.0
21
22model: af
23
24series: gd32a503
25
26variants:
27  - pincode: K
28    memories: [B, C]
29  - pincode: C
30    memories: [B, C]
31  - pincode: R
32    memories: [B, C, D]
33  - pincode: V
34    memories: [B, C, D]
35
36pins:
37  PA0:
38    pincodes: [K, C, R, V]
39    afs:
40      TIMER0_CH3: 1
41      EVENTOUT: 9
42  PA1:
43    pincodes: [K, C, R, V]
44    afs:
45      CK_OUT0: 0
46      TIMER0_MCH2: 1
47      SPI0_NSS: 4
48      TRIGSEL_IN0: 7
49      EVENTOUT: 9
50  PA2:
51    pincodes: [K, C, R, V]
52    afs:
53      TIMER0_CH2: 1
54      SPI0_MOSI: 4
55      TRIGSEL_IN1: 7
56      EVENTOUT: 9
57  PA3:
58    pincodes: [K, C, R, V]
59    afs:
60      ADC0_IN11: ANALOG
61      TIMER0_MCH1: 1
62      TIMER1_CH3: 2
63      USART0_TX: 5
64      CAN0_TX: 6
65      EVENTOUT: 9
66  PA4:
67    pincodes: [K, C, R, V]
68    afs:
69      ADC0_IN10: ANALOG
70      TIMER0_CH1: 1
71      USART0_RX: 5
72      CAN0_RX: 6
73      EVENTOUT: 9
74  PA5:
75    pincodes: [K, C, R, V]
76    afs:
77      TIMER19_BRKIN3: 2
78      USART2_TX: 5
79      EVENTOUT: 9
80  PA6:
81    pincodes: [K, C, R, V]
82    afs:
83      TIMER19_BRKIN2: 2
84      USART2_RX: 5
85  PA7:
86    pincodes: [K, C, R, V]
87    afs:
88      DAC_OUT: ANALOG
89      TIMER19_MCH1: 1
90      TIMER1_CH1: 2
91      TIMER19_BRKIN1: 3
92      USART2_CK: 5
93      TRIGSEL_IN7: 7
94      EVENTOUT: 9
95  PA8:
96    pincodes: [K, C, R, V]
97    afs:
98      ADC1_IN3: ANALOG
99      TIMER0_BRKIN0: 1
100      TIMER20_MCH2: 2
101      SPI1_NSS: 4
102      I2S1_WS: 4
103      MFCOM_D7: 5
104      MFCOM_D5: 6
105      TRIGSEL_IN4: 7
106      EVENTOUT: 9
107  PA9:
108    pincodes: [C, R, V]
109    afs:
110      ADC1_IN2: ANALOG
111      TIMER20_CH2: 1
112      SPI1_MOSI: 4
113      I2S1_SD: 4
114      MFCOM_D6: 5
115      MFCOM_D4: 6
116      TRIGSEL_IN5: 7
117      EVENTOUT: 9
118  PA10:
119    pincodes: [K, C, R, V]
120    afs:
121      ADC1_IN1: ANALOG
122      TIMER20_MCH0: 1
123      I2C0_SCL: 3
124      USART0_TX: 5
125      MFCOM_D5: 6
126      EVENTOUT: 9
127  PA11:
128    pincodes: [K, C, R, V]
129    afs:
130      ADC1_IN0: ANALOG
131      TIMER20_CH0: 1
132      I2C0_SDA: 3
133      USART0_RX: 5
134      MFCOM_D4: 6
135      TRIGSEL_IN13: 7
136      EVENTOUT: 9
137  PA12:
138    pincodes: [V]
139    afs:
140      TIMER20_MCH1: 1
141      I2C0_SMBA: 3
142      USART0_CK: 5
143      EVENTOUT: 9
144  PA13:
145    pincodes: [V]
146    afs:
147      TIMER20_CH1: 1
148      I2C0_SDA: 3
149      EVENTOUT: 9
150  PA14:
151    pincodes: [V]
152    afs:
153      TIMER20_MCH0: 1
154      I2C0_SCL: 3
155      EVENTOUT: 9
156  PA15:
157    pincodes: [V]
158    afs:
159      TIMER20_CH0: 1
160      TRIGSEL_IN12: 7
161      EVENTOUT: 9
162  PB0:
163    pincodes: [V]
164    afs:
165      TIMER19_CH0: 1
166      TIMER19_CH1: 2
167      EVENTOUT: 9
168  PB1:
169    pincodes: [C, R, V]
170    afs:
171      ADC0_IN9: ANALOG
172      TIMER0_MCH0: 1
173      TIMER7_MCH3: 2
174      EVENTOUT: 9
175  PB2:
176    pincodes: [R, V]
177    afs:
178      ADC0_IN8: ANALOG
179      TIMER0_CH0: 1
180      TIMER7_CH3: 2
181      EVENTOUT: 9
182  PB3:
183    pincodes: [K, C, R, V]
184    afs:
185      NJTRST: 0
186      TIMER7_MCH2: 1
187      SPI0_IO2: 4
188      MFCOM_D1: 6
189      EVENTOUT: 9
190  PB4:
191    pincodes: [K, C, R, V]
192    afs:
193      JTDO: 0
194      TIMER7_CH2: 1
195      SPI0_IO3: 4
196      MFCOM_D0: 6
197      EVENTOUT: 9
198  PB5:
199    pincodes: [R, V]
200    afs:
201      TIMER7_BRKIN1: 2
202      I2C0_SMBA: 3
203      SPI0_MISO: 4
204      SPI1_NSS: 5
205      I2S1_WS: 6
206      EVENTOUT: 9
207  PB6:
208    pincodes: [R, V]
209    afs:
210      TIMER7_BRKIN2: 2
211      TIMER_ETI1: 3
212      SPI0_SCK: 4
213      SPI1_MOSI: 5
214      I2S1_SD: 5
215      EVENTOUT: 9
216  PB7:
217    pincodes: [K, C, R, V]
218    afs:
219      JTDI: 0
220      TIMER19_CH0: 1
221      TIMER19_CH1: 2
222      I2C1_SCL: 5
223      EVENTOUT: 9
224  PB8:
225    pincodes: [K, C, R, V]
226    afs:
227      JTCK: 0
228      SWCLK: 0
229      TIMER7_CH0: 1
230      TIMER7_CH1: 2
231      I2C1_SDA: 5
232      EVENTOUT: 9
233  PB9:
234    pincodes: [K, C, R, V]
235    afs:
236      JTMS: 0
237      SWDIO: 0
238      I2C1_SMBA: 5
239      CMP_OUT: 7
240      EVENTOUT: 9
241  PB10:
242    pincodes: [V]
243    afs:
244      TIMER20_CH3: 1
245      TIMER19_CH3: 2
246      SPI0_IO3: 4
247      USART2_CTS: 5
248      EVENTOUT: 9
249  PB11:
250    pincodes: [V]
251    afs:
252      TIMER20_MCH2: 1
253      TIMER1_CH3: 2
254      TRIGSEL_IN10: 7
255      EVENTOUT: 9
256  PB12:
257    pincodes: [V]
258    afs:
259      TIMER20_CH2: 1
260      TRIGSEL_IN11: 7
261      EVENTOUT: 9
262  PB13:
263    pincodes: [K, C, R, V]
264    afs:
265      ADC0_IN5: ANALOG
266      ADC1_IN15: ANALOG
267      TIMER_ETI0: 0
268      SPI0_MOSI: 4
269      USART0_TX: 5
270      CAN0_TX: 6
271      EVENTOUT: 9
272  PB14:
273    pincodes: [K, C, R, V]
274    afs:
275      ADC0_IN4: ANALOG
276      ADC1_IN14: ANALOG
277      TIMER1_CH2: 1
278      SPI0_NSS: 3
279      USART0_RX: 5
280      CAN0_RX: 6
281      EVENTOUT: 9
282  PB15:
283    pincodes: [C, R, V]
284    afs:
285      TIMER7_BRKIN1: 2
286      USART1_TX: 4
287      USART0_RTS: 5
288      USART0_DE: 5
289      EVENTOUT: 9
290  PC0:
291    pincodes: [K, C, R, V]
292    afs:
293      TIMER0_CH0: 1
294      SPI0_SCK: 4
295      EVENTOUT: 9
296  PC1:
297    pincodes: [C, R, V]
298    afs:
299      TIMER0_MCH3: 1
300      USART2_CTS: 5
301      EVENTOUT: 9
302  PC2:
303    pincodes: [V]
304    afs:
305      CK_OUT: 0
306      TIMER19_MCH2: 1
307      USART1_TX: 5
308      EVENTOUT: 9
309  PC3:
310    pincodes: [V]
311    afs:
312      TIMER19_CH2: 1
313      USART1_RX: 5
314      EVENTOUT: 9
315  PC4:
316    pincodes: [V]
317    afs:
318      TIMER19_CH1: 1
319      USART2_RTS: 5
320      USART2_DE: 5
321      EVENTOUT: 9
322  PC5:
323    pincodes: [V]
324    afs:
325      TIMER19_MCH0: 1
326      TIMER19_CH0: 2
327      USART2_CTS: 5
328      EVENTOUT: 9
329  PC6:
330    pincodes: [V]
331    afs:
332      ADC1_IN9: ANALOG
333      ADC0_IN9: ANALOG
334      TIMER0_CH1: 1
335      SPI1_SCK: 4
336      I2S1_CK: 4
337      EVENTOUT: 9
338  PC7:
339    pincodes: [C, R, V]
340    afs:
341      ADC1_IN8: ANALOG
342      ADC0_IN8: ANALOG
343      TIMER0_MCH0: 1
344      TIMER20_BRKIN1: 2
345      I2S1_MCK: 4
346      EVENTOUT: 9
347  PC8:
348    pincodes: [R, V]
349    afs:
350      ADC1_IN7: ANALOG
351      TIMER0_CH0: 1
352      TIMER20_BRKIN2: 2
353      EVENTOUT: 9
354  PC9:
355    pincodes: [R, V]
356    afs:
357      ADC1_IN6: ANALOG
358      TIMER0_BRKIN3: 1
359      TIMER20_BRKIN3: 2
360      EVENTOUT: 9
361  PC10:
362    pincodes: [K, C, R, V]
363    afs:
364      ADC0_IN1: ANALOG
365      TIMER7_MCH0: 1
366      TIMER7_CH0: 2
367      I2C0_SDA: 3
368      USART0_RTS: 5
369      USART0_DE: 5
370      MFCOM_D3: 6
371      TRIGSEL_OUT0: 7
372      EVENTOUT: 9
373  PC11:
374    pincodes: [K, C, R, V]
375    afs:
376      ADC0_IN0: ANALOG
377      TIMER19_MCH0: 1
378      TIMER19_CH0: 2
379      I2C0_SCL: 3
380      USART0_CTS: 5
381      MFCOM_D2: 6
382      TRIGSEL_OUT3: 7
383      EVENTOUT: 9
384  PC12:
385    pincodes: [C, R, V]
386    afs:
387      ADC1_IN5: ANALOG
388      TIMER20_MCH1: 1
389      TIMER7_CH0: 2
390      USART1_TX: 5
391      CAN1_TX: 6
392      EVENTOUT: 9
393  PC13:
394    pincodes: [R, V]
395    afs:
396      CK_OUT: 0
397      TIMER19_CH2: 1
398      MFCOM_D4: 6
399      TRIGSEL_OUT4: 7
400      EVENTOUT: 9
401  PC14:
402    pincodes: [V]
403    afs:
404      TIMER19_BRKIN0: 2
405      EVENTOUT: 9
406  PC15:
407    pincodes: [K, C, R, V]
408    afs:
409      TIMER_ETI2: 0
410      TIMER19_MCH1: 1
411      TIMER19_CH1: 2
412      CAN0_TX: 6
413      MFCOM_D7: 7
414      EVENTOUT: 9
415  PD0:
416    pincodes: [C, R, V]
417    afs:
418      ADC1_IN4: ANALOG
419      TIMER20_CH1: 1
420      TIMER7_CH1: 2
421      USART1_RX: 5
422      CAN1_RX: 6
423      EVENTOUT: 9
424  PD1:
425    pincodes: [V]
426    afs:
427      ADC1_IN13: ANALOG
428      TIMER7_MCH1: 1
429      SPI1_NSS: 4
430      I2S1_WS: 4
431      EVENTOUT: 9
432  PD2:
433    pincodes: [V]
434    afs:
435      ADC1_IN12: ANALOG
436      TIMER7_CH1: 1
437      SPI0_NSS: 4
438      EVENTOUT: 9
439  PD3:
440    pincodes: [R, V]
441    afs:
442      ADC1_IN11: ANALOG
443      TIMER20_MCH3: 1
444      SPI0_NSS: 4
445      USART1_RTS: 5
446      USART1_DE: 5
447      EVENTOUT: 9
448  PD4:
449    pincodes: [R, V]
450    afs:
451      ADC1_IN10: ANALOG
452      TIMER20_CH3: 1
453      TIMER1_CH2: 2
454      SPI0_MOSI: 4
455      USART1_CTS: 5
456      EVENTOUT: 9
457  PD5:
458    pincodes: [V]
459    afs:
460      TIMER0_BRKIN0: 7
461      TIMER20_BRKIN1: 12
462      TIMER7_BRKIN0: 12
463      USART1_CK: 12
464      EVENTOUT: 9
465  PD6:
466    pincodes: [C, R, V]
467    afs:
468      TIMER7_MCH3: 1
469      TIMER19_CH0: 2
470      I2C1_SCL: 5
471      CAN1_TX: 6
472      EVENTOUT: 9
473  PD7:
474    pincodes: [C, R, V]
475    afs:
476      TIMER7_CH3: 1
477      TIMER19_CH1: 2
478      I2C1_SDA: 5
479      CAN1_RX: 6
480      EVENTOUT: 9
481  PD8:
482    pincodes: [C, R, V]
483    afs:
484      TIMER7_BRKIN0: 2
485      USART1_RX: 4
486      USART0_CTS: 5
487      EVENTOUT: 9
488  PD9:
489    pincodes: [K, C, R, V]
490    afs:
491      ADC0_IN3: ANALOG
492      TIMER0_BRKIN2: 2
493      USART1_RTS: 5
494      USART1_DE: 5
495      EVENTOUT: 9
496  PD10:
497    pincodes: [R, V]
498    afs:
499      ADC0_IN2: ANALOG
500      TIMER0_BRKIN1: 2
501      SPI1_NSS: 4
502      I2S1_WS: 4
503      USART1_CTS: 5
504      EVENTOUT: 9
505  PD11:
506    pincodes: [R, V]
507    afs:
508      TIMER0_MCH3: 1
509      TIMER20_BRKIN0: 2
510      I2C1_SMBA: 5
511      EVENTOUT: 9
512  PD12:
513    pincodes: [V]
514    afs:
515      TIMER0_CH3: 1
516      TIMER20_BRKIN0: 2
517      EVENTOUT: 9
518  PD13:
519    pincodes: [V]
520    afs:
521      TIMER0_MCH2: 1
522      SPI1_NSS: 4
523      I2S1_WS: 4
524      EVENTOUT: 9
525  PD14:
526    pincodes: [V]
527    afs:
528      ADC1_IN15: ANALOG
529      TIMER0_CH2: 1
530      SPI1_MOSI: 4
531      I2S1_SD: 4
532      EVENTOUT: 9
533  PD15:
534    pincodes: [V]
535    afs:
536      ADC1_IN14: ANALOG
537      TIMER0_MCH1: 1
538      SPI1_MISO: 4
539      EVENTOUT: 9
540  PE0:
541    pincodes: [V]
542    afs:
543      TIMER20_BRKIN2: 1
544      TIMER7_BRKIN3: 2
545      USART2_TX: 5
546      MFCOM_D7: 6
547      EVENTOUT: 9
548  PE1:
549    pincodes: [V]
550    afs:
551      TIMER20_BRKIN3: 1
552      USART2_RX: 5
553      MFCOM_D6: 6
554      EVENTOUT: 9
555  PE2:
556    pincodes: [V]
557    afs:
558      TIMER19_MCH3: 2
559      USART1_RTS: 5
560      USART1_DE: 5
561      MFCOM_D3: 6
562      TRIGSEL_OUT7: 7
563      EVENTOUT: 9
564  PE3:
565    pincodes: [V]
566    afs:
567      TIMER19_CH3: 0
568      USART1_CTS: 12
569      MFCOM_D2: 12
570      TRIGSEL_OUT6: 12
571      EVENTOUT: 9
572  PE4:
573    pincodes: [C, R, V]
574    afs:
575      TIMER0_MCH1: 1
576      TIMER19_MCH0: 2
577      SPI1_MISO: 4
578      MFCOM_D1: 6
579      TRIGSEL_OUT2: 7
580      EVENTOUT: 9
581  PE5:
582    pincodes: [C, R, V]
583    afs:
584      TIMER0_CH1: 1
585      TIMER19_CH0: 2
586      SPI1_SCK: 4
587      I2S1_CK: 4
588      MFCOM_D0: 6
589      TRIGSEL_OUT1: 7
590      EVENTOUT: 9
591  PE6:
592    pincodes: [R, V]
593    afs:
594      TIMER1_CH0: 1
595      TIMER1_ETI: 1
596      TIMER19_MCH2: 2
597      I2S1_MCK: 4
598      MFCOM_D5: 6
599      TRIGSEL_OUT5: 7
600      EVENTOUT: 9
601  PE7:
602    pincodes: [V]
603    afs:
604      TIMER7_MCH2: 1
605      TIMER19_BRKIN3: 2
606      MFCOM_D0: 6
607      EVENTOUT: 9
608  PE8:
609    pincodes: [V]
610    afs:
611      TIMER7_CH2: 1
612      TIMER19_BRKIN2: 2
613      MFCOM_D1: 6
614      EVENTOUT: 9
615  PE9:
616    pincodes: [R, V]
617    afs:
618      ADC0_IN15: ANALOG
619      TIMER7_BRKIN3: 2
620      EVENTOUT: 9
621  PE10:
622    pincodes: [C, R, V]
623    afs:
624      ADC0_IN14: ANALOG
625      TIMER7_BRKIN2: 2
626      I2C1_SCL: 5
627      EVENTOUT: 9
628  PE11:
629    pincodes: [C, R, V]
630    afs:
631      ADC0_IN13: ANALOG
632      TIMER7_MCH1: 1
633      I2C1_SDA: 5
634      TRIGSEL_IN8: 7
635      EVENTOUT: 9
636  PE12:
637    pincodes: [C, R, V]
638    afs:
639      ADC0_IN12: ANALOG
640      TIMER7_CH1: 1
641      I2C1_SMBA: 5
642      TRIGSEL_IN9: 7
643      EVENTOUT: 9
644  PE13:
645    pincodes: [K, C, R, V]
646    afs:
647      ADC0_IN7: ANALOG
648      TIMER7_MCH0: 1
649      TIMER7_CH0: 2
650      SPI0_MISO: 4
651      TRIGSEL_IN2: 7
652      EVENTOUT: 9
653  PE14:
654    pincodes: [K, C, R, V]
655    afs:
656      ADC0_IN6: ANALOG
657      TIMER7_CH0: 1
658      TIMER7_CH1: 2
659      SPI0_SCK: 4
660      TRIGSEL_IN3: 7
661      EVENTOUT: 9
662  PE15:
663    pincodes: [V]
664    afs:
665      TIMER20_MCH3: 1
666      TIMER19_MCH3: 2
667      SPI0_IO2: 4
668      USART2_RTS: 5
669      USART2_DE: 5
670      EVENTOUT: 9
671  PF0:
672    pincodes: [K, C, R, V]
673    afs:
674      TIMER19_CH1: 1
675      CAN0_RX: 6
676      MFCOM_D6: 7
677      EVENTOUT: 9
678  PF1:
679    pincodes: [V]
680    afs:
681      TIMER0_BRKIN1: 1
682      TIMER19_BRKIN1: 2
683      EVENTOUT: 9
684  PF2:
685    pincodes: [R, V]
686    afs:
687      TIMER0_BRKIN0: 1
688      TIMRE19_BRKIN0: 2
689      USART2_RTS: 5
690      USART2_DE: 5
691      TRIGSEL_IN6: 6
692      CMP_OUT: 7
693      EVENTOUT: 9
694  PF3:
695    pincodes: [V]
696    afs:
697      TIMER0_BRKIN3: 2
698      USART2_TX: 5
699      EVENTOUT: 9
700  PF4:
701    pincodes: [V]
702    afs:
703      TIMER0_BRKIN2: 2
704      USART2_RX: 5
705      EVENTOUT: 9
706  PF5:
707    pincodes: [K, C, R, V]
708    afs:
709      TIMER0_MCH0: 1
710      SPI0_MISO: 4
711      USART1_CTS: 5
712      EVENTOUT: 9
713  PF6:
714    pincodes: [K, C, R, V]
715    afs:
716      I2C0_SCL: 3
717      EVENTOUT: 9
718  PF7:
719    pincodes: [K, C, R, V]
720    afs:
721      I2C0_SDA: 3
722      EVENTOUT: 9
723