forked from moggieuk/Happy-Hare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpin_defs
394 lines (386 loc) · 31.8 KB
/
pin_defs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
#!/bin/bash
# Happy Hare MMU Software
#
# Pin definitions for Installer script. Includes complete set of definitions for each board type
# so impossible setups have blank pins rather than placeholder tokens. Each MCU defines a setup
# for type-A and some for type-B MMU styles.
#
# The defined pin tokens allow for up to 12 gates on type-A MMU's and 4 gates on type-B. No MCU
# can currently support beyond these limits
#
# Copyright (C) 2022-2024 moggieuk#6538 (discord) [email protected]
#
# Pins for original EASY-BRD and EASY-BRD with Seed Studio XIAO RP2040
# Note: uart pin is shared on original EASY-BRD (with different uart addresses)
#
PIN[EASY-BRD,gear_uart_pin]="PA8"; PIN[EASY-BRD-RP2040,gear_uart_pin]="gpio6"
PIN[EASY-BRD,gear_step_pin]="PA4"; PIN[EASY-BRD-RP2040,gear_step_pin]="gpio27"
PIN[EASY-BRD,gear_dir_pin]="PA10"; PIN[EASY-BRD-RP2040,gear_dir_pin]="gpio28"
PIN[EASY-BRD,gear_enable_pin]="PA2"; PIN[EASY-BRD-RP2040,gear_enable_pin]="gpio26"
PIN[EASY-BRD,gear_diag_pin]=""; PIN[EASY-BRD-RP2040,gear_diag_pin]=""
PIN[EASY-BRD,gear_1_uart_pin]=""; PIN[EASY-BRD-RP2040,gear_1_uart_pin]="";
PIN[EASY-BRD,gear_1_step_pin]=""; PIN[EASY-BRD-RP2040,gear_1_step_pin]="";
PIN[EASY-BRD,gear_1_dir_pin]=""; PIN[EASY-BRD-RP2040,gear_1_dir_pin]="";
PIN[EASY-BRD,gear_1_enable_pin]=""; PIN[EASY-BRD-RP2040,gear_1_enable_pin]="";
PIN[EASY-BRD,gear_1_diag_pin]=""; PIN[EASY-BRD-RP2040,gear_1_diag_pin]="";
PIN[EASY-BRD,gear_2_uart_pin]=""; PIN[EASY-BRD-RP2040,gear_2_uart_pin]="";
PIN[EASY-BRD,gear_2_step_pin]=""; PIN[EASY-BRD-RP2040,gear_2_step_pin]="";
PIN[EASY-BRD,gear_2_dir_pin]=""; PIN[EASY-BRD-RP2040,gear_2_dir_pin]="";
PIN[EASY-BRD,gear_2_enable_pin]=""; PIN[EASY-BRD-RP2040,gear_2_enable_pin]="";
PIN[EASY-BRD,gear_2_diag_pin]=""; PIN[EASY-BRD-RP2040,gear_2_diag_pin]="";
PIN[EASY-BRD,gear_3_uart_pin]=""; PIN[EASY-BRD-RP2040,gear_3_uart_pin]="";
PIN[EASY-BRD,gear_3_step_pin]=""; PIN[EASY-BRD-RP2040,gear_3_step_pin]="";
PIN[EASY-BRD,gear_3_dir_pin]=""; PIN[EASY-BRD-RP2040,gear_3_dir_pin]="";
PIN[EASY-BRD,gear_3_enable_pin]=""; PIN[EASY-BRD-RP2040,gear_3_enable_pin]="";
PIN[EASY-BRD,gear_3_diag_pin]=""; PIN[EASY-BRD-RP2040,gear_3_diag_pin]="";
PIN[EASY-BRD,selector_uart_pin]="PA8"; PIN[EASY-BRD-RP2040,selector_uart_pin]="gpio6"
PIN[EASY-BRD,selector_step_pin]="PA9"; PIN[EASY-BRD-RP2040,selector_step_pin]="gpio7"
PIN[EASY-BRD,selector_dir_pin]="PB8"; PIN[EASY-BRD-RP2040,selector_dir_pin]="gpio0"
PIN[EASY-BRD,selector_enable_pin]="PA11"; PIN[EASY-BRD-RP2040,selector_enable_pin]="gpio29"
PIN[EASY-BRD,selector_diag_pin]="PA7"; PIN[EASY-BRD-RP2040,selector_diag_pin]="gpio2"
PIN[EASY-BRD,selector_endstop_pin]="PB9"; PIN[EASY-BRD-RP2040,selector_endstop_pin]="gpio1"
PIN[EASY-BRD,selector_servo_pin]="PA5"; PIN[EASY-BRD-RP2040,selector_servo_pin]="gpio4"
PIN[EASY-BRD,encoder_pin]="PA6"; PIN[EASY-BRD-RP2040,encoder_pin]="gpio3"
PIN[EASY-BRD,neopixel_pin]=""; PIN[EASY-BRD-RP2040,neopixel_pin]=""
PIN[EASY-BRD,gate_sensor_pin]="PA6"; PIN[EASY-BRD-RP2040,gate_sensor_pin]="gpio3";
PIN[EASY-BRD,pre_gate_0_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_0_pin]="";
PIN[EASY-BRD,pre_gate_1_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_1_pin]="";
PIN[EASY-BRD,pre_gate_2_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_2_pin]="";
PIN[EASY-BRD,pre_gate_3_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_3_pin]="";
PIN[EASY-BRD,pre_gate_4_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_4_pin]="";
PIN[EASY-BRD,pre_gate_5_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_5_pin]="";
PIN[EASY-BRD,pre_gate_6_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_6_pin]="";
PIN[EASY-BRD,pre_gate_7_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_7_pin]="";
PIN[EASY-BRD,pre_gate_8_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_8_pin]="";
PIN[EASY-BRD,pre_gate_9_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_9_pin]="";
PIN[EASY-BRD,pre_gate_10_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_10_pin]="";
PIN[EASY-BRD,pre_gate_11_pin]=""; PIN[EASY-BRD-RP2040,pre_gate_11_pin]="";
PIN[EASY-BRD,gear_sensor_0_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_0_pin]="";
PIN[EASY-BRD,gear_sensor_1_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_1_pin]="";
PIN[EASY-BRD,gear_sensor_2_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_2_pin]="";
PIN[EASY-BRD,gear_sensor_3_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_3_pin]="";
PIN[EASY-BRD,gear_sensor_4_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_4_pin]="";
PIN[EASY-BRD,gear_sensor_5_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_5_pin]="";
PIN[EASY-BRD,gear_sensor_6_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_6_pin]="";
PIN[EASY-BRD,gear_sensor_7_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_7_pin]="";
PIN[EASY-BRD,gear_sensor_8_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_8_pin]="";
PIN[EASY-BRD,gear_sensor_9_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_9_pin]="";
PIN[EASY-BRD,gear_sensor_10_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_10_pin]="";
PIN[EASY-BRD,gear_sensor_11_pin]=""; PIN[EASY-BRD-RP2040,gear_sensor_10_pin]="";
#
# Common Type-B MMU pin utilization
#
# TODO
# Pins for Mellow EASY-BRD with CANbus (original v1.x and v2)
#
PIN[MELLOW-EASY-BRD-CAN,gear_uart_pin]="gpio9"; PIN[MELLOW-EASY-BRD-CANv2,gear_uart_pin]="gpio9";
PIN[MELLOW-EASY-BRD-CAN,gear_step_pin]="gpio7"; PIN[MELLOW-EASY-BRD-CANv2,gear_step_pin]="gpio7";
PIN[MELLOW-EASY-BRD-CAN,gear_dir_pin]="gpio8"; PIN[MELLOW-EASY-BRD-CANv2,gear_dir_pin]="gpio8";
PIN[MELLOW-EASY-BRD-CAN,gear_enable_pin]="gpio6"; PIN[MELLOW-EASY-BRD-CANv2,gear_enable_pin]="gpio6";
PIN[MELLOW-EASY-BRD-CAN,gear_diag_pin]="gpio23"; PIN[MELLOW-EASY-BRD-CANv2,gear_diag_pin]=""; # v2: Dup with encoder (gpio15)
PIN[MELLOW-EASY-BRD-CAN,gear_1_uart_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_1_uart_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_1_step_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_1_step_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_1_dir_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_1_dir_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_1_enable_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_1_enable_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_1_diag_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_1_diag_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_2_uart_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_2_uart_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_2_step_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_2_step_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_2_dir_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_2_dir_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_2_enable_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_2_enable_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_2_diag_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_2_diag_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_3_uart_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_3_uart_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_3_step_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_3_step_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_3_dir_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_3_dir_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_3_enable_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_3_enable_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_3_diag_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_3_diag_pin]="";
PIN[MELLOW-EASY-BRD-CAN,selector_uart_pin]="gpio0"; PIN[MELLOW-EASY-BRD-CANv2,selector_uart_pin]="gpio2";
PIN[MELLOW-EASY-BRD-CAN,selector_step_pin]="gpio2"; PIN[MELLOW-EASY-BRD-CANv2,selector_step_pin]="gpio4";
PIN[MELLOW-EASY-BRD-CAN,selector_dir_pin]="gpio1"; PIN[MELLOW-EASY-BRD-CANv2,selector_dir_pin]="gpio3";
PIN[MELLOW-EASY-BRD-CAN,selector_enable_pin]="gpio3"; PIN[MELLOW-EASY-BRD-CANv2,selector_enable_pin]="gpio5";
PIN[MELLOW-EASY-BRD-CAN,selector_diag_pin]="gpio22"; PIN[MELLOW-EASY-BRD-CANv2,selector_diag_pin]="gpio20"; # v2: Dup with endstop (gpio20)
PIN[MELLOW-EASY-BRD-CAN,selector_endstop_pin]="gpio20"; PIN[MELLOW-EASY-BRD-CANv2,selector_endstop_pin]="gpio20"; # Endstop
PIN[MELLOW-EASY-BRD-CAN,selector_servo_pin]="gpio21"; PIN[MELLOW-EASY-BRD-CANv2,selector_servo_pin]="gpio21"; # Servo
PIN[MELLOW-EASY-BRD-CAN,encoder_pin]="gpio15"; PIN[MELLOW-EASY-BRD-CANv2,encoder_pin]="gpio15"; # Encoder
PIN[MELLOW-EASY-BRD-CAN,neopixel_pin]="gpio14"; PIN[MELLOW-EASY-BRD-CANv2,neopixel_pin]="gpio14"; # v1: Extra / v2: RGB
PIN[MELLOW-EASY-BRD-CAN,gate_sensor_pin]="gpio15"; PIN[MELLOW-EASY-BRD-CANv2,gate_sensor_pin]="gpio15"; # Encoder (Alt)
PIN[MELLOW-EASY-BRD-CAN,pre_gate_0_pin]="gpio10"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_0_pin]="gpio24"; # v1: Exp 5 / v2: Exp 3
PIN[MELLOW-EASY-BRD-CAN,pre_gate_1_pin]="gpio26"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_1_pin]="gpio22"; # v1: Exp 6 / v2: Exp 4
PIN[MELLOW-EASY-BRD-CAN,pre_gate_2_pin]="gpio11"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_2_pin]="gpio25"; # v1: Exp 7 / v2: Exp 5
PIN[MELLOW-EASY-BRD-CAN,pre_gate_3_pin]="gpio27"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_3_pin]="gpio23"; # v1: Exp 8 / v2: Exp 6
PIN[MELLOW-EASY-BRD-CAN,pre_gate_4_pin]="gpio12"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_4_pin]="gpio13"; # v1: Exp 9 / v2: Exp 7
PIN[MELLOW-EASY-BRD-CAN,pre_gate_5_pin]="gpio28"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_5_pin]="gpio26"; # v1: Exp 10 / v2: Exp 8
PIN[MELLOW-EASY-BRD-CAN,pre_gate_6_pin]="gpio24"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_6_pin]="gpio12"; # v1: Exp 11 / v2: Exp 9
PIN[MELLOW-EASY-BRD-CAN,pre_gate_7_pin]="gpio29"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_7_pin]="gpio27"; # v1: Exp 12 / v2: Exp 10
PIN[MELLOW-EASY-BRD-CAN,pre_gate_8_pin]="gpio13"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_8_pin]="gpio11"; # v1: Exp 13 / v2: Exp 11
PIN[MELLOW-EASY-BRD-CAN,pre_gate_9_pin]="gpio25"; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_9_pin]="gpio28"; # v1: Exp 14 / v2: Exp 12
PIN[MELLOW-EASY-BRD-CAN,pre_gate_10_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_10_pin]="gpio10"; # v2: Exp 13
PIN[MELLOW-EASY-BRD-CAN,pre_gate_11_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,pre_gate_11_pin]="gpio29"; # v2: Exp 14
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_0_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_0_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_1_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_1_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_2_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_2_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_3_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_3_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_4_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_4_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_5_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_5_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_6_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_6_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_7_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_7_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_8_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_8_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_9_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_9_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_10_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_10_pin]="";
PIN[MELLOW-EASY-BRD-CAN,gear_sensor_11_pin]=""; PIN[MELLOW-EASY-BRD-CANv2,gear_sensor_10_pin]="";
#
# Common Type-B MMU pin utilization
#
# TODO
# Pins for Fysetc Burrows ERB board (original v1 and v2)
#
PIN[ERB,gear_uart_pin]="gpio20"; PIN[ERBv2,gear_uart_pin]="gpio11";
PIN[ERB,gear_step_pin]="gpio10"; PIN[ERBv2,gear_step_pin]="gpio10";
PIN[ERB,gear_dir_pin]="gpio9"; PIN[ERBv2,gear_dir_pin]="gpio9";
PIN[ERB,gear_enable_pin]="gpio8"; PIN[ERBv2,gear_enable_pin]="gpio8";
PIN[ERB,gear_diag_pin]="gpio13"; PIN[ERBv2,gear_diag_pin]="gpio13";
PIN[ERB,gear_1_uart_pin]=""; PIN[ERBv2,gear_1_uart_pin]="";
PIN[ERB,gear_1_step_pin]=""; PIN[ERBv2,gear_1_step_pin]="";
PIN[ERB,gear_1_dir_pin]=""; PIN[ERBv2,gear_1_dir_pin]="";
PIN[ERB,gear_1_enable_pin]=""; PIN[ERBv2,gear_1_enable_pin]="";
PIN[ERB,gear_1_diag_pin]=""; PIN[ERBv2,gear_1_diag_pin]="";
PIN[ERB,gear_2_uart_pin]=""; PIN[ERBv2,gear_2_uart_pin]="";
PIN[ERB,gear_2_step_pin]=""; PIN[ERBv2,gear_2_step_pin]="";
PIN[ERB,gear_2_dir_pin]=""; PIN[ERBv2,gear_2_dir_pin]="";
PIN[ERB,gear_2_enable_pin]=""; PIN[ERBv2,gear_2_enable_pin]="";
PIN[ERB,gear_2_diag_pin]=""; PIN[ERBv2,gear_2_diag_pin]="";
PIN[ERB,gear_3_uart_pin]=""; PIN[ERBv2,gear_3_uart_pin]="";
PIN[ERB,gear_3_step_pin]=""; PIN[ERBv2,gear_3_step_pin]="";
PIN[ERB,gear_3_dir_pin]=""; PIN[ERBv2,gear_3_dir_pin]="";
PIN[ERB,gear_3_enable_pin]=""; PIN[ERBv2,gear_3_enable_pin]="";
PIN[ERB,gear_3_diag_pin]=""; PIN[ERBv2,gear_3_diag_pin]="";
PIN[ERB,selector_uart_pin]="gpio17"; PIN[ERBv2,selector_uart_pin]="gpio17";
PIN[ERB,selector_step_pin]="gpio16"; PIN[ERBv2,selector_step_pin]="gpio16";
PIN[ERB,selector_dir_pin]="gpio15"; PIN[ERBv2,selector_dir_pin]="gpio15";
PIN[ERB,selector_enable_pin]="gpio14"; PIN[ERBv2,selector_enable_pin]="gpio14";
PIN[ERB,selector_diag_pin]="gpio19"; PIN[ERBv2,selector_diag_pin]="gpio19";
PIN[ERB,selector_endstop_pin]="gpio24"; PIN[ERBv2,selector_endstop_pin]="gpio24";
PIN[ERB,selector_servo_pin]="gpio23"; PIN[ERBv2,selector_servo_pin]="gpio23";
PIN[ERB,encoder_pin]="gpio22"; PIN[ERBv2,encoder_pin]="gpio22";
PIN[ERB,neopixel_pin]="gpio21"; PIN[ERBv2,neopixel_pin]="gpio21";
PIN[ERB,gate_sensor_pin]="gpio22"; PIN[ERBv2,gate_sensor_pin]="gpio25"; # Hall Effect
PIN[ERB,pre_gate_0_pin]="gpio0"; PIN[ERBv2,pre_gate_0_pin]="gpio12";
PIN[ERB,pre_gate_1_pin]="gpio1"; PIN[ERBv2,pre_gate_1_pin]="gpio18";
PIN[ERB,pre_gate_2_pin]="gpio2"; PIN[ERBv2,pre_gate_2_pin]="gpio2";
PIN[ERB,pre_gate_3_pin]="gpio3"; PIN[ERBv2,pre_gate_3_pin]="gpio3";
PIN[ERB,pre_gate_4_pin]="gpio4"; PIN[ERBv2,pre_gate_4_pin]="gpio4";
PIN[ERB,pre_gate_5_pin]="gpio5"; PIN[ERBv2,pre_gate_5_pin]="gpio5";
PIN[ERB,pre_gate_6_pin]="gpio6"; PIN[ERBv2,pre_gate_6_pin]="gpio6";
PIN[ERB,pre_gate_7_pin]="gpio7"; PIN[ERBv2,pre_gate_7_pin]="gpio7";
PIN[ERB,pre_gate_8_pin]="gpio26"; PIN[ERBv2,pre_gate_8_pin]="gpio26";
PIN[ERB,pre_gate_9_pin]="gpio27"; PIN[ERBv2,pre_gate_9_pin]="gpio27";
PIN[ERB,pre_gate_10_pin]="gpio28"; PIN[ERBv2,pre_gate_10_pin]="gpio28";
PIN[ERB,pre_gate_11_pin]="gpio29"; PIN[ERBv2,pre_gate_11_pin]="gpio29";
PIN[ERB,gear_sensor_0_pin]=""; PIN[ERBv2,gear_sensor_0_pin]="";
PIN[ERB,gear_sensor_1_pin]=""; PIN[ERBv2,gear_sensor_1_pin]="";
PIN[ERB,gear_sensor_2_pin]=""; PIN[ERBv2,gear_sensor_2_pin]="";
PIN[ERB,gear_sensor_3_pin]=""; PIN[ERBv2,gear_sensor_3_pin]="";
PIN[ERB,gear_sensor_4_pin]=""; PIN[ERBv2,gear_sensor_4_pin]="";
PIN[ERB,gear_sensor_5_pin]=""; PIN[ERBv2,gear_sensor_5_pin]="";
PIN[ERB,gear_sensor_6_pin]=""; PIN[ERBv2,gear_sensor_6_pin]="";
PIN[ERB,gear_sensor_7_pin]=""; PIN[ERBv2,gear_sensor_7_pin]="";
PIN[ERB,gear_sensor_8_pin]=""; PIN[ERBv2,gear_sensor_8_pin]="";
PIN[ERB,gear_sensor_9_pin]=""; PIN[ERBv2,gear_sensor_9_pin]="";
PIN[ERB,gear_sensor_10_pin]=""; PIN[ERBv2,gear_sensor_10_pin]="";
PIN[ERB,gear_sensor_11_pin]=""; PIN[ERBv2,gear_sensor_10_pin]="";
#
# Common Type-B MMU pin utilization
#
# TODO
# Pins for BTT MMB board (gear on motor1, selector on motor2, endstop on STP11, optional gate sensor on STP1 if no gear DIAG use)
# Note BTT MMB v1.1 Board switched M1_enable and STP4
#
PIN[MMB10,gear_uart_pin]="PA10"; PIN[MMB11,gear_uart_pin]="PA10"; # M1
PIN[MMB10,gear_step_pin]="PB15"; PIN[MMB11,gear_step_pin]="PB15";
PIN[MMB10,gear_dir_pin]="PB14"; PIN[MMB11,gear_dir_pin]="PB14";
PIN[MMB10,gear_enable_pin]="PA8"; PIN[MMB11,gear_enable_pin]="PB8";
PIN[MMB10,gear_diag_pin]="PA3"; PIN[MMB11,gear_diag_pin]="PA3"; # Aka STP1
PIN[MMB10,gear_1_uart_pin]=""; PIN[MMB11,gear_1_uart_pin]="";
PIN[MMB10,gear_1_step_pin]=""; PIN[MMB11,gear_1_step_pin]="";
PIN[MMB10,gear_1_dir_pin]=""; PIN[MMB11,gear_1_dir_pin]="";
PIN[MMB10,gear_1_enable_pin]=""; PIN[MMB11,gear_1_enable_pin]="";
PIN[MMB10,gear_1_diag_pin]=""; PIN[MMB11,gear_1_diag_pin]="";
PIN[MMB10,gear_2_uart_pin]=""; PIN[MMB11,gear_2_uart_pin]="";
PIN[MMB10,gear_2_step_pin]=""; PIN[MMB11,gear_2_step_pin]="";
PIN[MMB10,gear_2_dir_pin]=""; PIN[MMB11,gear_2_dir_pin]="";
PIN[MMB10,gear_2_enable_pin]=""; PIN[MMB11,gear_2_enable_pin]="";
PIN[MMB10,gear_2_diag_pin]=""; PIN[MMB11,gear_2_diag_pin]="";
PIN[MMB10,gear_3_uart_pin]=""; PIN[MMB11,gear_3_uart_pin]="";
PIN[MMB10,gear_3_step_pin]=""; PIN[MMB11,gear_3_step_pin]="";
PIN[MMB10,gear_3_dir_pin]=""; PIN[MMB11,gear_3_dir_pin]="";
PIN[MMB10,gear_3_enable_pin]=""; PIN[MMB11,gear_3_enable_pin]="";
PIN[MMB10,gear_3_diag_pin]=""; PIN[MMB11,gear_3_diag_pin]="";
PIN[MMB10,selector_uart_pin]="PC7"; PIN[MMB11,selector_uart_pin]="PC7"; # M2
PIN[MMB10,selector_step_pin]="PD2"; PIN[MMB11,selector_step_pin]="PD2";
PIN[MMB10,selector_dir_pin]="PB13"; PIN[MMB11,selector_dir_pin]="PB13";
PIN[MMB10,selector_enable_pin]="PD1"; PIN[MMB11,selector_enable_pin]="PD1";
PIN[MMB10,selector_diag_pin]="PA4"; PIN[MMB11,selector_diag_pin]="PA4"; # Aka STP2
PIN[MMB10,selector_endstop_pin]="PB2"; PIN[MMB11,selector_endstop_pin]="PB2"; # STP11
PIN[MMB10,selector_servo_pin]="PA0"; PIN[MMB11,selector_servo_pin]="PA0";
PIN[MMB10,encoder_pin]="PA1"; PIN[MMB11,encoder_pin]="PA1";
PIN[MMB10,neopixel_pin]="PA2"; PIN[MMB11,neopixel_pin]="PA2";
PIN[MMB10,gate_sensor_pin]="PA3"; PIN[MMB11,gate_sensor_pin]="PA3"; # STP1 (if not DIAG)
PIN[MMB10,pre_gate_0_pin]="PB9"; PIN[MMB11,pre_gate_0_pin]="PB9"; # STP3
PIN[MMB10,pre_gate_1_pin]="PB8"; PIN[MMB11,pre_gate_1_pin]="PA8"; # STP4
PIN[MMB10,pre_gate_2_pin]="PC15"; PIN[MMB11,pre_gate_2_pin]="PC15"; # STP5
PIN[MMB10,pre_gate_3_pin]="PC13"; PIN[MMB11,pre_gate_3_pin]="PC13"; # STP6
PIN[MMB10,pre_gate_4_pin]="PC14"; PIN[MMB11,pre_gate_4_pin]="PC14"; # STP7
PIN[MMB10,pre_gate_5_pin]="PB12"; PIN[MMB11,pre_gate_5_pin]="PB12"; # STP8
PIN[MMB10,pre_gate_6_pin]="PB11"; PIN[MMB11,pre_gate_6_pin]="PB11"; # STP9
PIN[MMB10,pre_gate_7_pin]="PB10"; PIN[MMB11,pre_gate_7_pin]="PB10"; # STP10
PIN[MMB10,pre_gate_8_pin]=""; PIN[MMB11,pre_gate_8_pin]="";
PIN[MMB10,pre_gate_9_pin]=""; PIN[MMB11,pre_gate_9_pin]="";
PIN[MMB10,pre_gate_10_pin]=""; PIN[MMB11,pre_gate_10_pin]="";
PIN[MMB10,pre_gate_11_pin]=""; PIN[MMB11,pre_gate_11_pin]="";
PIN[MMB10,gear_sensor_0_pin]=""; PIN[MMB11,gear_sensor_0_pin]="";
PIN[MMB10,gear_sensor_1_pin]=""; PIN[MMB11,gear_sensor_1_pin]="";
PIN[MMB10,gear_sensor_2_pin]=""; PIN[MMB11,gear_sensor_2_pin]="";
PIN[MMB10,gear_sensor_3_pin]=""; PIN[MMB11,gear_sensor_3_pin]="";
PIN[MMB10,gear_sensor_4_pin]=""; PIN[MMB11,gear_sensor_4_pin]="";
PIN[MMB10,gear_sensor_5_pin]=""; PIN[MMB11,gear_sensor_5_pin]="";
PIN[MMB10,gear_sensor_6_pin]=""; PIN[MMB11,gear_sensor_6_pin]="";
PIN[MMB10,gear_sensor_7_pin]=""; PIN[MMB11,gear_sensor_7_pin]="";
PIN[MMB10,gear_sensor_8_pin]=""; PIN[MMB11,gear_sensor_8_pin]="";
PIN[MMB10,gear_sensor_9_pin]=""; PIN[MMB11,gear_sensor_9_pin]="";
PIN[MMB10,gear_sensor_10_pin]=""; PIN[MMB11,gear_sensor_10_pin]="";
PIN[MMB10,gear_sensor_11_pin]=""; PIN[MMB11,gear_sensor_10_pin]="";
#
# Common Type-B MMU pin utilization
#
PIN[B,MMB10,gear_uart_pin]="PA10"; PIN[B,MMB11,gear_uart_pin]="PA10"; # M1
PIN[B,MMB10,gear_step_pin]="PB15"; PIN[B,MMB11,gear_step_pin]="PB15";
PIN[B,MMB10,gear_dir_pin]="PB14"; PIN[B,MMB11,gear_dir_pin]="PB14";
PIN[B,MMB10,gear_enable_pin]="PA8"; PIN[B,MMB11,gear_enable_pin]="PB8"; # !Reversed on v1.1
PIN[B,MMB10,gear_diag_pin]="PA3"; PIN[B,MMB11,gear_diag_pin]="PA3"; # Aka STP1
PIN[B,MMB10,gear_1_uart_pin]="PC7"; PIN[B,MMB11,gear_1_uart_pin]="PC7"; # M2
PIN[B,MMB10,gear_1_step_pin]="PD2"; PIN[B,MMB11,gear_1_step_pin]="PD2";
PIN[B,MMB10,gear_1_dir_pin]="PB13"; PIN[B,MMB11,gear_1_dir_pin]="PB13";
PIN[B,MMB10,gear_1_enable_pin]="PD1"; PIN[B,MMB11,gear_1_enable_pin]="PD1";
PIN[B,MMB10,gear_1_diag_pin]="PA4"; PIN[B,MMB11,gear_1_diag_pin]="PA4"; # Aka STP2
PIN[B,MMB10,gear_2_uart_pin]="PC6"; PIN[B,MMB11,gear_2_uart_pin]="PC6"; # M3
PIN[B,MMB10,gear_2_step_pin]="PD0"; PIN[B,MMB11,gear_2_step_pin]="PD0";
PIN[B,MMB10,gear_2_dir_pin]="PD3"; PIN[B,MMB11,gear_2_dir_pin]="PD3";
PIN[B,MMB10,gear_2_enable_pin]="PA15"; PIN[B,MMB11,gear_2_enable_pin]="PA15";
PIN[B,MMB10,gear_2_diag_pin]="PB9"; PIN[B,MMB11,gear_2_diag_pin]="PB9"; # Aka STP3
PIN[B,MMB10,gear_3_uart_pin]="PA9"; PIN[B,MMB11,gear_3_uart_pin]="PA9"; # M4
PIN[B,MMB10,gear_3_step_pin]="PB6"; PIN[B,MMB11,gear_3_step_pin]="PB6";
PIN[B,MMB10,gear_3_dir_pin]="PB7"; PIN[B,MMB11,gear_3_dir_pin]="PB7";
PIN[B,MMB10,gear_3_enable_pin]="PB5"; PIN[B,MMB11,gear_3_enable_pin]="PB5";
PIN[B,MMB10,gear_3_diag_pin]="PB8"; PIN[B,MMB11,gear_3_diag_pin]="PB8"; # Aka STP4
PIN[B,MMB10,selector_uart_pin]=""; PIN[B,MMB11,selector_uart_pin]="";
PIN[B,MMB10,selector_step_pin]=""; PIN[B,MMB11,selector_step_pin]="";
PIN[B,MMB10,selector_dir_pin]=""; PIN[B,MMB11,selector_dir_pin]="";
PIN[B,MMB10,selector_enable_pin]=""; PIN[B,MMB11,selector_enable_pin]="";
PIN[B,MMB10,selector_diag_pin]=""; PIN[B,MMB11,selector_diag_pin]="";
PIN[B,MMB10,selector_endstop_pin]=""; PIN[B,MMB11,selector_endstop_pin]="";
PIN[B,MMB10,selector_servo_pin]=""; PIN[B,MMB11,selector_servo_pin]="";
PIN[B,MMB10,encoder_pin]="PA1"; PIN[B,MMB11,encoder_pin]="PA1";
PIN[B,MMB10,neopixel_pin]="PA2"; PIN[B,MMB11,neopixel_pin]="PA2";
PIN[B,MMB10,gate_sensor_pin]="PB11"; PIN[B,MMB11,gate_sensor_pin]="PB11"; # STP9
PIN[B,MMB10,pre_gate_0_pin]="PA3"; PIN[B,MMB11,pre_gate_0_pin]="PA3"; # STP1
PIN[B,MMB10,pre_gate_1_pin]="PA4"; PIN[B,MMB11,pre_gate_1_pin]="PA4"; # STP2
PIN[B,MMB10,pre_gate_2_pin]="PB9"; PIN[B,MMB11,pre_gate_2_pin]="PB9"; # STP3
PIN[B,MMB10,pre_gate_3_pin]="PB8"; PIN[B,MMB11,pre_gate_3_pin]="PA8"; # STP4 !Reversed on v1.1
PIN[B,MMB10,pre_gate_4_pin]=""; PIN[B,MMB11,pre_gate_4_pin]="";
PIN[B,MMB10,pre_gate_5_pin]=""; PIN[B,MMB11,pre_gate_5_pin]="";
PIN[B,MMB10,pre_gate_6_pin]=""; PIN[B,MMB11,pre_gate_6_pin]="";
PIN[B,MMB10,pre_gate_7_pin]=""; PIN[B,MMB11,pre_gate_7_pin]="";
PIN[B,MMB10,pre_gate_8_pin]=""; PIN[B,MMB11,pre_gate_8_pin]="";
PIN[B,MMB10,pre_gate_9_pin]=""; PIN[B,MMB11,pre_gate_9_pin]="";
PIN[B,MMB10,pre_gate_10_pin]=""; PIN[B,MMB11,pre_gate_10_pin]="";
PIN[B,MMB10,pre_gate_11_pin]=""; PIN[B,MMB11,pre_gate_11_pin]="";
PIN[B,MMB10,gear_sensor_0_pin]="PC15"; PIN[B,MMB11,gear_sensor_0_pin]="PC15"; # STP5
PIN[B,MMB10,gear_sensor_1_pin]="PC13"; PIN[B,MMB11,gear_sensor_1_pin]="PC13"; # STP6
PIN[B,MMB10,gear_sensor_2_pin]="PC14"; PIN[B,MMB11,gear_sensor_2_pin]="PC14"; # STP7
PIN[B,MMB10,gear_sensor_3_pin]="PB12"; PIN[B,MMB11,gear_sensor_3_pin]="PB12"; # STP8
PIN[B,MMB10,gear_sensor_4_pin]=""; PIN[B,MMB11,gear_sensor_4_pin]="";
PIN[B,MMB10,gear_sensor_5_pin]=""; PIN[B,MMB11,gear_sensor_5_pin]="";
PIN[B,MMB10,gear_sensor_6_pin]=""; PIN[B,MMB11,gear_sensor_6_pin]="";
PIN[B,MMB10,gear_sensor_7_pin]=""; PIN[B,MMB11,gear_sensor_7_pin]="";
PIN[B,MMB10,gear_sensor_8_pin]=""; PIN[B,MMB11,gear_sensor_8_pin]="";
PIN[B,MMB10,gear_sensor_9_pin]=""; PIN[B,MMB11,gear_sensor_9_pin]="";
PIN[B,MMB10,gear_sensor_10_pin]=""; PIN[B,MMB11,gear_sensor_10_pin]="";
PIN[B,MMB10,gear_sensor_11_pin]=""; PIN[B,MMB11,gear_sensor_11_pin]="";
PIN[B,MMB10,spooler_en_0_pin]=""; PIN[B,MMB11,spooler_en_0_pin]="";
PIN[B,MMB10,spooler_en_1_pin]=""; PIN[B,MMB11,spooler_en_1_pin]="";
PIN[B,MMB10,spooler_en_2_pin]=""; PIN[B,MMB11,spooler_en_2_pin]="";
PIN[B,MMB10,spooler_en_3_pin]=""; PIN[B,MMB11,spooler_en_3_pin]="";
PIN[B,MMB10,spooler_rwd_0_pin]="PA0"; PIN[B,MMB11,spooler_rwd_0_pin]="PA0";
PIN[B,MMB10,spooler_rwd_1_pin]="PA1"; PIN[B,MMB11,spooler_rwd_1_pin]="PA1";
PIN[B,MMB10,spooler_rwd_2_pin]="PB10"; PIN[B,MMB11,spooler_rwd_2_pin]="PB10";
PIN[B,MMB10,spooler_rwd_3_pin]="PB2"; PIN[B,MMB11,spooler_rwd_3_pin]="PB2";
PIN[B,MMB10,spooler_fwd_0_pin]=""; PIN[B,MMB11,spooler_fwd_0_pin]="";
PIN[B,MMB10,spooler_fwd_1_pin]=""; PIN[B,MMB11,spooler_fwd_1_pin]="";
PIN[B,MMB10,spooler_fwd_2_pin]=""; PIN[B,MMB11,spooler_fwd_2_pin]="";
PIN[B,MMB10,spooler_fwd_3_pin]=""; PIN[B,MMB11,spooler_fwd_3_pin]="";
# Spare: PB10 (STP10), PB2 (STP11) PB10 (STP10), PB2 (STP11)
PIN[B,AFC_LITE_1,gear_uart_pin]="PD5";
PIN[B,AFC_LITE_1,gear_step_pin]="PD4";
PIN[B,AFC_LITE_1,gear_dir_pin]="PD3";
PIN[B,AFC_LITE_1,gear_enable_pin]="PD6";
PIN[B,AFC_LITE_1,gear_diag_pin]="PD2";
PIN[B,AFC_LITE_1,gear_1_uart_pin]="PD0";
PIN[B,AFC_LITE_1,gear_1_step_pin]="PC12";
PIN[B,AFC_LITE_1,gear_1_dir_pin]="PC11";
PIN[B,AFC_LITE_1,gear_1_enable_pin]="PD1";
PIN[B,AFC_LITE_1,gear_1_diag_pin]="PC10";
PIN[B,AFC_LITE_1,gear_2_uart_pin]="PE1";
PIN[B,AFC_LITE_1,gear_2_step_pin]="PE2";
PIN[B,AFC_LITE_1,gear_2_dir_pin]="PE3";
PIN[B,AFC_LITE_1,gear_2_enable_pin]="PE0";
PIN[B,AFC_LITE_1,gear_2_diag_pin]="PE4";
PIN[B,AFC_LITE_1,gear_3_uart_pin]="PC6";
PIN[B,AFC_LITE_1,gear_3_step_pin]="PD15";
PIN[B,AFC_LITE_1,gear_3_dir_pin]="PD14";
PIN[B,AFC_LITE_1,gear_3_enable_pin]="PC7";
PIN[B,AFC_LITE_1,gear_3_diag_pin]="PC8";
PIN[B,AFC_LITE_1,selector_uart_pin]="";
PIN[B,AFC_LITE_1,selector_step_pin]="";
PIN[B,AFC_LITE_1,selector_dir_pin]="";
PIN[B,AFC_LITE_1,selector_enable_pin]="";
PIN[B,AFC_LITE_1,selector_diag_pin]="";
PIN[B,AFC_LITE_1,selector_endstop_pin]="";
PIN[B,AFC_LITE_1,selector_servo_pin]="";
PIN[B,AFC_LITE_1,encoder_pin]="";
PIN[B,AFC_LITE_1,neopixel_pin]="PE14";
PIN[B,AFC_LITE_1,gate_sensor_pin]="PC4";
PIN[B,AFC_LITE_1,pre_gate_0_pin]="PC5";
PIN[B,AFC_LITE_1,pre_gate_1_pin]="PB0";
PIN[B,AFC_LITE_1,pre_gate_2_pin]="PB1";
PIN[B,AFC_LITE_1,pre_gate_3_pin]="PB2";
PIN[B,AFC_LITE_1,pre_gate_4_pin]="";
PIN[B,AFC_LITE_1,pre_gate_5_pin]="";
PIN[B,AFC_LITE_1,pre_gate_6_pin]="";
PIN[B,AFC_LITE_1,pre_gate_7_pin]="";
PIN[B,AFC_LITE_1,pre_gate_8_pin]="";
PIN[B,AFC_LITE_1,pre_gate_9_pin]="";
PIN[B,AFC_LITE_1,pre_gate_10_pin]="";
PIN[B,AFC_LITE_1,pre_gate_11_pin]="";
PIN[B,AFC_LITE_1,gear_sensor_0_pin]="PE8";
PIN[B,AFC_LITE_1,gear_sensor_1_pin]="PE9";
PIN[B,AFC_LITE_1,gear_sensor_2_pin]="PE10";
PIN[B,AFC_LITE_1,gear_sensor_3_pin]="PE11";
PIN[B,AFC_LITE_1,gear_sensor_4_pin]="";
PIN[B,AFC_LITE_1,gear_sensor_5_pin]="";
PIN[B,AFC_LITE_1,gear_sensor_6_pin]="";
PIN[B,AFC_LITE_1,gear_sensor_7_pin]="";
PIN[B,AFC_LITE_1,gear_sensor_8_pin]="";
PIN[B,AFC_LITE_1,gear_sensor_9_pin]="";
PIN[B,AFC_LITE_1,gear_sensor_10_pin]="";
PIN[B,AFC_LITE_1,gear_sensor_11_pin]="";
PIN[B,AFC_LITE_1,spooler_en_0_pin]="PA2";
PIN[B,AFC_LITE_1,spooler_en_1_pin]="PA5";
PIN[B,AFC_LITE_1,spooler_en_2_pin]="PB13";
PIN[B,AFC_LITE_1,spooler_en_3_pin]="PD11";
PIN[B,AFC_LITE_1,spooler_rwd_0_pin]="PA0";
PIN[B,AFC_LITE_1,spooler_rwd_1_pin]="PA6";
PIN[B,AFC_LITE_1,spooler_rwd_2_pin]="PB14";
PIN[B,AFC_LITE_1,spooler_rwd_3_pin]="PD12";
PIN[B,AFC_LITE_1,spooler_fwd_0_pin]="PA1";
PIN[B,AFC_LITE_1,spooler_fwd_1_pin]="PA7";
PIN[B,AFC_LITE_1,spooler_fwd_2_pin]="PB15";
PIN[B,AFC_LITE_1,spooler_fwd_3_pin]="PD13";