-
Notifications
You must be signed in to change notification settings - Fork 1
/
pinout.h
348 lines (259 loc) · 8.97 KB
/
pinout.h
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
/*
* This file is part of the LibreRVAC project
*
* Copyright © 2015-2016
* Aleks-Daniel Jakimenko-Aleksejev <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
//#include "gpio.h"
// TODO finish reorganizing!
// INPUTS
#define PIN_BUMPER_SWITCH_LEFT_PORT G
#define PIN_BUMPER_SWITCH_LEFT_PIN 9
#define PIN_BUMPER_SWITCH_LEFT_ACTIVE LOW
#define PIN_BUMPER_SWITCH_RIGHT_PORT G
#define PIN_BUMPER_SWITCH_RIGHT_PIN 15
#define PIN_BUMPER_SWITCH_RIGHT_ACTIVE LOW
#define PIN_WHEEL_LIFT_LEFT_PORT D
#define PIN_WHEEL_LIFT_LEFT_PIN 6
#define PIN_WHEEL_LIFT_LEFT_ACTIVE LOW
#define PIN_WHEEL_LIFT_RIGHT_PORT D
#define PIN_WHEEL_LIFT_RIGHT_PIN 7
#define PIN_WHEEL_LIFT_RIGHT_ACTIVE LOW
#define PIN_WHEEL_CURRENT_SENSE_LEFT_PORT B
#define PIN_WHEEL_CURRENT_SENSE_LEFT_PIN 14
#define PIN_WHEEL_CURRENT_SENSE_LEFT_ACTIVE ?
#define PIN_WHEEL_CURRENT_SENSE_RIGHT_PORT B
#define PIN_WHEEL_CURRENT_SENSE_RIGHT_PIN 13
#define PIN_WHEEL_CURRENT_SENSE_RIGHT_ACTIVE HIGH
// ↑
#define PIN_DUST_BOX_INSERTED_PORT F
#define PIN_DUST_BOX_INSERTED_PIN 0
#define PIN_DUST_BOX_INSERTED_ACTIVE LOW
#define PIN_USERBUTTON_INTERRUPT_PORT E
#define PIN_USERBUTTON_INTERRUPT_PIN 9
#define PIN_USERBUTTON_INTERRUPT_ACTIVE LOW
#define PIN_SENSOR_BOTTOM_RIGHT_PORT B
#define PIN_SENSOR_BOTTOM_RIGHT_PIN 8
#define PIN_SENSOR_BOTTOM_RIGHT_ACTIVE HIGH
#define PIN_SENSOR_BOTTOM_MIDDLE_PORT B
#define PIN_SENSOR_BOTTOM_MIDDLE_PIN 10
#define PIN_SENSOR_BOTTOM_MIDDLE_ACTIVE HIGH
#define PIN_SENSOR_BOTTOM_LEFT_PORT B
#define PIN_SENSOR_BOTTOM_LEFT_PIN 11
#define PIN_SENSOR_BOTTOM_LEFT_ACTIVE HIGH
// IR
#define PIN_MID_RECEIVER_R_PORT G
#define PIN_MID_RECEIVER_R_PIN 8
#define PIN_MID_RECEIVER_R_ACTIVE ?
#define PIN_IR_RECEIVER_REAR_RIGHT_PORT E
#define PIN_IR_RECEIVER_REAR_RIGHT_PIN 8
#define PIN_IR_RECEIVER_REAR_RIGHT_ACTIVE LOW
// ENCODERS
#define PIN_BRUSH_MAIN_ENCODER_PORT B
#define PIN_BRUSH_MAIN_ENCODER_PIN 5
#define PIN_BRUSH_MAIN_ENCODER_ACTIVE LOW
#define PIN_WHEEL_LEFT_ENCODER_1_PORT D
#define PIN_WHEEL_LEFT_ENCODER_1_PIN 8
#define PIN_WHEEL_LEFT_ENCODER_1_ACTIVE ?
#define PIN_WHEEL_LEFT_ENCODER_2_PORT D
#define PIN_WHEEL_LEFT_ENCODER_2_PIN 9
#define PIN_WHEEL_LEFT_ENCODER_2_ACTIVE ?
#define PIN_WHEEL_RIGHT_ENCODER_1_PORT D
#define PIN_WHEEL_RIGHT_ENCODER_1_PIN 11
#define PIN_WHEEL_RIGHT_ENCODER_1_ACTIVE ?
#define PIN_WHEEL_RIGHT_ENCODER_2_PORT D
#define PIN_WHEEL_RIGHT_ENCODER_2_PIN 10
#define PIN_WHEEL_RIGHT_ENCODER_2_ACTIVE ?
// MOTORS
#define PIN_WHEEL_LEFT_ENABLE_PORT D
#define PIN_WHEEL_LEFT_ENABLE_PIN 0
#define PIN_WHEEL_LEFT_ENABLE_ACTIVE HIGH
#define PIN_WHEEL_LEFT_MODE_PORT E
#define PIN_WHEEL_LEFT_MODE_PIN 7
#define PIN_WHEEL_LEFT_MODE_ACTIVE HIGH
#define PIN_WHEEL_LEFT_PHASE_PORT C
#define PIN_WHEEL_LEFT_PHASE_PIN 1
#define PIN_WHEEL_LEFT_PHASE_ACTIVE LOW
#define PIN_WHEEL_RIGHT_ENABLE_PORT D
#define PIN_WHEEL_RIGHT_ENABLE_PIN 3
#define PIN_WHEEL_RIGHT_ENABLE_ACTIVE HIGH
#define PIN_WHEEL_RIGHT_MODE_PORT G
#define PIN_WHEEL_RIGHT_MODE_PIN 6
#define PIN_WHEEL_RIGHT_MODE_ACTIVE HIGH
#define PIN_WHEEL_RIGHT_PHASE_PORT G
#define PIN_WHEEL_RIGHT_PHASE_PIN 7
#define PIN_WHEEL_RIGHT_PHASE_ACTIVE HIGH
#define PIN_BRUSH_MAIN_ENABLE_PORT D
#define PIN_BRUSH_MAIN_ENABLE_PIN 1
#define PIN_BRUSH_MAIN_ENABLE_ACTIVE HIGH
#define PIN_BRUSH_MAIN_PHASE_PORT C
#define PIN_BRUSH_MAIN_PHASE_PIN 2
#define PIN_BRUSH_MAIN_PHASE_ACTIVE LOW
#define PIN_BRUSH_MAIN_DECAY_PORT C
#define PIN_BRUSH_MAIN_DECAY_PIN 3
#define PIN_BRUSH_MAIN_DECAY_ACTIVE LOW
#define PIN_BRUSH_SIDES_PORT A
#define PIN_BRUSH_SIDES_PIN 4
#define PIN_BRUSH_SIDES_ACTIVE HIGH
#define PIN_VACUUM_ENABLE_PORT D
#define PIN_VACUUM_ENABLE_PIN 5
#define PIN_VACUUM_ENABLE_ACTIVE HIGH
// OUTPUT
#define PIN_BEEPER_PORT D
#define PIN_BEEPER_PIN 13
#define PIN_BEEPER_ACTIVE HIGH
// LEDs
#define PIN_LEDS_POWER_ALL_PORT A
#define PIN_LEDS_POWER_ALL_PIN 6
#define PIN_LEDS_POWER_ALL_ACTIVE HIGH
#define PIN_LEDS_POWER_BATTERY_PORT G
#define PIN_LEDS_POWER_BATTERY_PIN 1
#define PIN_LEDS_POWER_BATTERY_ACTIVE HIGH
#define PIN_LED_0_PORT E
#define PIN_LED_0_PIN 2
#define PIN_LED_0_ACTIVE HIGH
#define PIN_LED_1_PORT E
#define PIN_LED_1_PIN 3
#define PIN_LED_1_ACTIVE HIGH
#define PIN_LED_2_PORT E
#define PIN_LED_2_PIN 4
#define PIN_LED_2_ACTIVE HIGH
#define PIN_LED_3_PORT E
#define PIN_LED_3_PIN 5
#define PIN_LED_3_ACTIVE HIGH
#define PIN_LED_4_PORT E
#define PIN_LED_4_PIN 6
#define PIN_LED_4_ACTIVE HIGH
#define PIN_BATTERY_THERMISTOR_PORT B
#define PIN_BATTERY_THERMISTOR_PIN 4
#define PIN_BATTERY_THERMISTOR_ACTIVE ?
#define PIN_BATTERY_VOLTAGE_IN_PORT B
#define PIN_BATTERY_VOLTAGE_IN_PIN 3
#define PIN_BATTERY_VOLTAGE_IN_ACTIVE ?
#define PIN_BATTERY_VOLTAGE_OUT_PORT B
#define PIN_BATTERY_VOLTAGE_OUT_PIN 2
#define PIN_BATTERY_VOLTAGE_OUT_ACTIVE ?
#define PIN_ADAPTER_DETECT_PORT B
#define PIN_ADAPTER_DETECT_PIN 1
#define PIN_ADAPTER_DETECT_ACTIVE HIGH
#define PIN_BUTTONS_PORT B
#define PIN_BUTTONS_PIN 0
#define PIN_BUTTONS_ACTIVE HIGH
#define PIN_LEGACY_LINUX_BOARD_PIN_10_PORT A
#define PIN_LEGACY_LINUX_BOARD_PIN_10_PIN 9
#define PIN_LEGACY_LINUX_BOARD_PIN_10_ACTIVE ?
#define PIN_LEGACY_LINUX_BOARD_PIN_11_PORT B
#define PIN_LEGACY_LINUX_BOARD_PIN_11_PIN 9
#define PIN_LEGACY_LINUX_BOARD_PIN_11_ACTIVE HIGH
#define PIN_RECEIVER_MID_LEFT_PORT A
#define PIN_RECEIVER_MID_LEFT_PIN 10
#define PIN_RECEIVER_MID_LEFT_ACTIVE ?
#define PIN_ACCELGYRO_POWER_PORT F
#define PIN_ACCELGYRO_POWER_PIN 7
#define PIN_ACCELGYRO_POWER_ACTIVE LOW
#define PIN_IR_RECEIVER_REAR_LEFT_PORT F
#define PIN_IR_RECEIVER_REAR_LEFT_PIN 6
#define PIN_IR_RECEIVER_REAR_LEFT_ACTIVE LOW
#define PIN_DOCKING_RECEIVER_LEFT_PORT A
#define PIN_DOCKING_RECEIVER_LEFT_PIN 14
#define PIN_DOCKING_RECEIVER_LEFT_ACTIVE LOW
#define PIN_DOCKING_RECEIVER_RIGHT_PORT A
#define PIN_DOCKING_RECEIVER_RIGHT_PIN 15
#define PIN_DOCKING_RECEIVER_RIGHT_ACTIVE LOW
#define PIN_CHARGING_ENABLE_PORT D
#define PIN_CHARGING_ENABLE_PIN 2
#define PIN_CHARGING_ENABLE_ACTIVE ?
#define PIN_SEGMENT_DISPLAY_COLON_PORT F
#define PIN_SEGMENT_DISPLAY_COLON_PIN 1
#define PIN_SEGMENT_DISPLAY_COLON_ACTIVE HIGH
#define PIN_LED_UNKNOWNS_PORT G
#define PIN_LED_UNKNOWNS_PIN 0
#define PIN_LED_UNKNOWNS_ACTIVE HIGH
#define PIN_LED_CHAR_1_PORT A
#define PIN_LED_CHAR_1_PIN 7
#define PIN_LED_CHAR_1_ACTIVE HIGH
#define PIN_LED_SEGMENT_TOP_PORT E
#define PIN_LED_SEGMENT_TOP_PIN 0
#define PIN_LED_SEGMENT_TOP_ACTIVE HIGH
#define PIN_LED_SEGMENT_TOP_RIGHT_PORT E
#define PIN_LED_SEGMENT_TOP_RIGHT_PIN 1
#define PIN_LED_SEGMENT_TOP_RIGHT_ACTIVE HIGH
#define PIN_LED_CHAR_2_PORT G
#define PIN_LED_CHAR_2_PIN 14
#define PIN_LED_CHAR_2_ACTIVE HIGH
#define PIN_LED_CHAR_4_PORT G
#define PIN_LED_CHAR_4_PIN 12
#define PIN_LED_CHAR_4_ACTIVE HIGH
#define PIN_LED_CHAR_3_PORT G
#define PIN_LED_CHAR_3_PIN 13
#define PIN_LED_CHAR_3_ACTIVE HIGH
// ICs
#define PIN_IC16_A_PORT A
#define PIN_IC16_A_PIN 1
#define PIN_IC16_A_ACTIVE HIGH
#define PIN_IC16_B_PORT F
#define PIN_IC16_B_PIN 13
#define PIN_IC16_B_ACTIVE HIGH
#define PIN_IC16_C_PORT C
#define PIN_IC16_C_PIN 4
#define PIN_IC16_C_ACTIVE HIGH
#define PIN_IC16_X_PORT D
#define PIN_IC16_X_PIN 4
#define PIN_IC16_X_ACTIVE HIGH
#define PIN_IC_SENSORS_A_PORT D
#define PIN_IC_SENSORS_A_PIN 15
#define PIN_IC_SENSORS_A_ACTIVE HIGH
#define PIN_IC_SENSORS_B_PORT D
#define PIN_IC_SENSORS_B_PIN 14
#define PIN_IC_SENSORS_B_ACTIVE HIGH
#define PIN_IC_SENSORS_C_PORT B
#define PIN_IC_SENSORS_C_PIN 15
#define PIN_IC_SENSORS_C_ACTIVE HIGH
#define PIN_IC_SENSORS_X_IN_PORT B
#define PIN_IC_SENSORS_X_IN_PIN 12
#define PIN_IC_SENSORS_X_IN_ACTIVE HIGH
#define PIN_IC_SENSORS_X_OUT_PORT D
#define PIN_IC_SENSORS_X_OUT_PIN 12
#define PIN_IC_SENSORS_X_OUT_ACTIVE HIGH
// COMMUNICATION
/*
// SPI is not used anymore
#define PIN_CONNECTION_SCK_PORT C
#define PIN_CONNECTION_SCK_PIN 13
#define PIN_CONNECTION_SCK_ACTIVE HIGH
#define PIN_CONNECTION_MISO_PORT B
#define PIN_CONNECTION_MISO_PIN 7
#define PIN_CONNECTION_MISO_ACTIVE HIGH
#define PIN_CONNECTION_MOSI_PORT B
#define PIN_CONNECTION_MOSI_PIN 6
#define PIN_CONNECTION_MOSI_ACTIVE HIGH
*/
#define PIN_CONNECTION_RX_PORT C
#define PIN_CONNECTION_RX_PIN 13
#define PIN_CONNECTION_RX_ACTIVE HIGH
#define PIN_CONNECTION_TX_PORT B
#define PIN_CONNECTION_TX_PIN 7
#define PIN_CONNECTION_TX_ACTIVE HIGH
/*
#define PIN_CONNECTION_MOSI_PORT B
#define PIN_CONNECTION_MOSI_PIN 6
#define PIN_CONNECTION_MOSI_ACTIVE HIGH
*/
// TEMPLATE
//#define PIN__PORT
//#define PIN__PIN
//#define PIN__ACTIVE HIGH