1# GD32F350XX pin definitions
2#
3# Sources:
4# - GD32F350XX Datasheet (Revision 1.5)
5#
6# Pin codes:
7#
8# - 28 pins: G
9# - 32 pins: K
10# - 48 pins: C
11# - 64 pins: R
12#
13# Memory codes:
14#
15# - 16Kb  Flash, 4Kb  SRAM: 4
16# - 32Kb  Flash, 6Kb  SRAM: 6
17# - 64Kb  Flash, 8Kb  SRAM: 8
18# - 64Kb  Flash, 16Kb SRAM: 8(GD32F350R8 only)
19# - 128Kb Flash, 16Kb SRAM: B
20#
21# Copyright (c) 2021 BrainCo Inc.
22# SPDX-License-Identifier: Apache 2.0
23
24model: af
25
26series: gd32f350
27
28variants:
29  - pincode: G
30    memories: [4]
31  - pincode: G
32    memories: [6]
33  - pincode: G
34    memories: [8]
35  - pincode: K
36    memories: [4]
37  - pincode: K
38    memories: [6]
39  - pincode: K
40    memories: [8]
41  - pincode: C
42    memories: [4]
43  - pincode: C
44    memories: [6]
45  - pincode: C
46    memories: [8, B]
47  - pincode: R
48    memories: [4]
49  - pincode: R
50    memories: [6]
51  - pincode: R
52    memories: [8, B]
53
54signal-configs:
55  USART1_CTS:
56    exclude-memories: [4]
57  USART1_RTS:
58    exclude-memories: [4]
59  USART1_TX:
60    exclude-memories: [4]
61  USART1_RX:
62    exclude-memories: [4]
63  USART1_CK:
64    exclude-memories: [4]
65  I2C1_SCL:
66    exclude-memories: [4, 6]
67  I2C1_SDA:
68    exclude-memories: [4, 6]
69  I2C1_SMBA:
70    exclude-memories: [4, 6]
71  SPI1_NSS:
72    exclude-memories: [4, 6]
73  SPI1_IO2:
74    exclude-memories: [4, 6]
75  SPI1_IO3:
76    exclude-memories: [4, 6]
77  SPI1_MISO:
78    exclude-memories: [4, 6]
79  SPI1_MOSI:
80    exclude-memories: [4, 6]
81  SPI1_SCK:
82    exclude-memories: [4, 6]
83  SPI1_O2:
84    exclude-memories: [4, 6]
85  SPI1_O3:
86    exclude-memories: [4, 6]
87
88pins:
89  PA0:
90    pincodes: [G, K, C, R]
91    afs:
92      ADC_IN0: ANALOG
93      USART0_CTS: 1
94      USART1_CTS: 1
95      TIMER1_CH0: 2
96      TIMER1_ETI: 2
97      TSI_G0_IO0: 3
98      I2C1_SCL: 4
99      CMP0_OUT: 7
100  PA1:
101    pincodes: [G, K, C, R]
102    afs:
103      ADC_IN1: ANALOG
104      EVENTOUT: 0
105      USART0_RTS: 1
106      USART1_RTS: 1
107      TIMER1_CH1: 2
108      TSI_G0_IO1: 3
109      I2C1_SDA: 4
110  PA2:
111    pincodes: [G, K, C, R]
112    afs:
113      ADC_IN2: ANALOG
114      TIMER14_CH0: 0
115      USART0_TX: 1
116      USART1_TX: 1
117      TIMER1_CH2: 2
118      TSI_G0_IO2: 3
119      CMP1_OUT: 7
120  PA3:
121    pincodes: [G, K, C, R]
122    afs:
123      ADC_IN3: ANALOG
124      TIMER14_CH1: 0
125      USART0_RX: 1
126      USART1_RX: 1
127      TIMER1_CH3: 2
128      TSI_G0_IO3: 3
129  PA4:
130    pincodes: [G, K, C, R]
131    afs:
132      ADC_IN4: ANALOG
133      DAC0_OUT: ANALOG
134      SPI0_NSS: 0
135      I2S0_WS: 0
136      USART0_CK: 1
137      USART1_CK: 1
138      TSI_G1_IO0: 3
139      TIMER13_CH0: 4
140      SPI1_NSS: 6
141  PA5:
142    pincodes: [G, K, C, R]
143    afs:
144      ADC_IN5: ANALOG
145      SPI0_SCK: 0
146      I2S0_CK: 0
147      CEC: 1
148      TIMER1_CH0: 2
149      TIMER1_ETI: 2
150      TSI_G1_IO1: 3
151  PA6:
152    pincodes: [G, K, C, R]
153    afs:
154      ADC_IN6: ANALOG
155      SPI0_MISO: 0
156      I2S0_MCK: 0
157      TIMER2_CH0: 1
158      TIMER0_BKIN: 2
159      TSI_G1_IO2: 3
160      TIMER15_CH0: 5
161      EVENTOUT: 6
162      CMP0_OUT: 7
163  PA7:
164    pincodes: [G, K, C, R]
165    afs:
166      ADC_IN7: ANALOG
167      SPI0_MOSI: 0
168      I2S0_SD: 0
169      TIMER2_CH1: 1
170      TIMER0_CH0_ON: 2
171      TSI_G1_IO3: 3
172      TIMER13_CH0: 4
173      TIMER16_CH0: 5
174      EVENTOUT: 6
175      CMP1_OUT: 7
176  PA8:
177    pincodes: [K, C, R]
178    afs:
179      CK_OUT: 0
180      USART0_CK: 1
181      TIMER0_CH0: 2
182      EVENTOUT: 3
183      USART1_TX: 4
184      USBFS_SOF: 5
185      CTC_SYNC: 6
186  PA9:
187    pincodes: [G, K, C, R]
188    afs:
189      TIMER14_BKIN: 0
190      USART0_TX: 1
191      TIMER0_CH1: 2
192      TSI_G3_IO0: 3
193      I2C0_SCL: 4
194      USBFS_VBUS: 5
195  PA10:
196    pincodes: [G, K, C, R]
197    afs:
198      TIMER16_BKIN: 0
199      USART0_RX: 1
200      TIMER0_CH2: 2
201      TSI_G3_IO1: 3
202      I2C0_SDA: 4
203      USBFS_ID: 5
204  PA11:
205    pincodes: [G, K, C, R]
206    afs:
207      EVENTOUT: 0
208      USART0_CTS: 1
209      TIMER0_CH3: 2
210      TSI_G3_IO2: 3
211      SPI1_IO2: 6
212      CMP0_OUT: 7
213  PA12:
214    pincodes: [G, K, C, R]
215    afs:
216      EVENTOUT: 0
217      USART0_RTS: 1
218      TIMER0_ETI: 2
219      TSI_G3_IO3: 3
220      SPI1_IO3: 6
221      CMP1_OUT: 7
222  PA13:
223    pincodes: [G, K, C, R]
224    afs:
225      SWDIO: 0
226      IFRP_OUT: 1
227      SPI1_MISO: 6
228  PA14:
229    pincodes: [G, K, C, R]
230    afs:
231      SWCLK: 0
232      USART0_TX: 1
233      USART1_TX: 1
234      SPI1_MOSI: 6
235  PA15:
236    pincodes: [G, K, C, R]
237    afs:
238      SPI0_NSS: 0
239      I2S0_WS: 0
240      USART0_RX: 1
241      USART1_RX: 1
242      TIMER1_CH0: 2
243      TIMER1_ETI: 2
244      EVENTOUT: 3
245      SPI1_NSS: 6
246  PB0:
247    pincodes: [G, K, C, R]
248    afs:
249      ADC_IN8: ANALOG
250      EVENTOUT: 0
251      TIMER2_CH2: 1
252      TIMER0_CH1_ON: 2
253      TSI_G2_IO1: 3
254      USART1_RX: 4
255  PB1:
256    pincodes: [G, K, C, R]
257    afs:
258      ADC_IN9: ANALOG
259      TIMER13_CH0: 0
260      TIMER2_CH3: 1
261      TIMER0_CH2_ON: 2
262      TSI_G2_IO2: 3
263      SPI1_SCK: 6
264  PB2:
265    pincodes: [K, C, R]
266    afs:
267      TSI_G2_IO3: 3
268  PB3:
269    pincodes: [G, K, C, R]
270    afs:
271      SPI0_SCK: 0
272      I2S0_CK: 0
273      EVENTOUT: 1
274      TIMER1_CH1: 2
275      TSI_G4_IO0: 3
276  PB4:
277    pincodes: [G, K, C, R]
278    afs:
279      SPI0_MISO: 0
280      I2S0_MCK: 0
281      TIMER2_CH0: 1
282      EVENTOUT: 2
283      TSI_G4_IO1: 3
284  PB5:
285    pincodes: [G, K, C, R]
286    afs:
287      SPI0_MOSI: 0
288      I2S0_SD: 0
289      TIMER2_CH1: 1
290      TIMER15_BKIN: 2
291      I2C0_SMBA: 3
292  PB6:
293    pincodes: [G, K, C, R]
294    afs:
295      USART0_TX: 0
296      I2C0_SCL: 1
297      TIMER15_CH0_ON: 2
298      TSI_G4_IO2: 3
299  PB7:
300    pincodes: [G, K, C, R]
301    afs:
302      USART0_RX: 0
303      I2C0_SDA: 1
304      TIMER16_CH0_ON: 2
305      TSI_G4_IO3: 3
306  PB8:
307    pincodes: [K, C, R]
308    afs:
309      CEC: 0
310      I2C0_SCL: 1
311      TIMER15_CH0: 2
312      TSITG: 3
313  PB9:
314    pincodes: [C, R]
315    afs:
316      IFRP_OUT: 0
317      I2C0_SDA: 1
318      TIMER16_CH0: 2
319      EVENTOUT: 3
320      I2S0_MCK: 5
321  PB10:
322    pincodes: [C, R]
323    afs:
324      CEC: 0
325      I2C0_SCL: 1
326      I2C1_SCL: 1
327      TIMER1_CH2: 2
328      TSITG: 3
329      SPI1_O2: 6
330  PB11:
331    pincodes: [C, R]
332    afs:
333      EVENTOUT: 0
334      I2C0_SDA: 1
335      I2C1_SDA: 1
336      TIMER1_CH3: 2
337      TSI_G5_IO0: 3
338      SPI1_O3: 6
339  PB12:
340    pincodes: [C, R]
341    afs:
342      SPI0_NSS: 0
343      SPI1_NSS: 0
344      EVENTOUT: 1
345      TIMER0_BKIN: 2
346      TSI_G5_IO1: 3
347      I2C1_SMBA: 4
348  PB13:
349    pincodes: [C, R]
350    afs:
351      SPI0_SCK: 0
352      SPI1_SCK: 0
353      TIMER0_CH0_ON: 2
354      TSI_G5_IO2: 3
355  PB14:
356    pincodes: [C, R]
357    afs:
358      SPI0_MISO: 0
359      SPI1_MISO: 0
360      TIMER14_CH0: 1
361      TIMER0_CH1_ON: 2
362      TSI_G5_IO3: 3
363  PB15:
364    pincodes: [C, R]
365    afs:
366      SPI0_MOSI: 0
367      SPI1_MOSI: 0
368      TIMER14_CH1: 1
369      TIMER0_CH2_ON: 2
370      TIMER14_CH0_ON: 3
371  PC0:
372    pincodes: [R]
373    afs:
374      ADC_IN10: ANALOG
375      EVENTOUT: 0
376  PC1:
377    pincodes: [R]
378    afs:
379      ADC_IN11: ANALOG
380      EVENTOUT: 0
381  PC2:
382    pincodes: [R]
383    afs:
384      ADC_IN12: ANALOG
385      EVENTOUT: 0
386  PC3:
387    pincodes: [R]
388    afs:
389      ADC_IN13: ANALOG
390      EVENTOUT: 0
391  PC4:
392    pincodes: [R]
393    afs:
394      ADC_IN14: ANALOG
395      EVENTOUT: 0
396  PC5:
397    pincodes: [R]
398    afs:
399      ADC_IN15: ANALOG
400      TSI_G2_IO0: 0
401  PC6:
402    pincodes: [R]
403    afs:
404      TIMER2_CH0: 0
405      I2S0_MCK: 2
406  PC7:
407    pincodes: [R]
408    afs:
409      TIMER2_CH1: 0
410  PC8:
411    pincodes: [R]
412    afs:
413      TIMER2_CH2: 0
414  PC9:
415    pincodes: [R]
416    afs:
417      TIMER2_CH3: 0
418  PD2:
419    pincodes: [R]
420    afs:
421      TIMER2_ETI: 0
422  PF0:
423    pincodes: [G, K, C, R]
424    afs:
425      CTC_SYNC: 0
426  PF4:
427    pincodes: [R]
428    afs:
429      EVENTOUT: 0
430  PF5:
431    pincodes: [R]
432    afs:
433      EVENTOUT: 0
434  PF6:
435    pincodes: [C, R]
436    afs:
437      I2C0_SCL: 0
438      I2C1_SCL: 0
439  PF7:
440    pincodes: [C, R]
441    afs:
442      I2C0_SDA: 0
443      I2C1_SDA: 0
444