TeensyNanoExoCode
Loading...
Searching...
No Matches
Board.h
Go to the documentation of this file.
1#ifndef BOARD_SETTINGS_HEADER
2 #define BOARD_SETTINGS_HEADER
3 // include config so we know what board is being used.
4 #include "Config.h"
5
6 #if BOARD_VERSION == AK_Board_V0_1
7 #include "Arduino.h"
8 namespace logic_micro_pins //teensy
9 {
10 #if defined(ARDUINO_TEENSY36)
11 // Serial Pins, NC
12 const unsigned int rx1_pin = 0;
13 const unsigned int tx1_pin = 1;
14
15 // CAN Pins
16 const unsigned int can_rx_pin = 4;
17 const unsigned int can_tx_pin = 3;
18
19 // FSR Pins
20 const unsigned int fsr_sense_left_heel_pin = A14;
21 const unsigned int fsr_sense_left_toe_pin = A15;
22 const unsigned int fsr_sense_right_heel_pin= A7;
23 const unsigned int fsr_sense_right_toe_pin = A6;
24
25 // Torque Sensor Pins
26 const unsigned int num_available_joints = 2;
27 const unsigned int torque_sensor_left[] = {A17, A16};
28 //const unsigned int torque_sensor_left1 = A16;
29 const unsigned int torque_sensor_right[] = {A9, A8};
30 //const unsigned int torque_sensor_right1 = A8;
31
32
33 // Sync LED Pins
34 const unsigned int sync_led_pin = 29;
35 const unsigned int sync_default_pin = 25;
36 #endif
37 const unsigned int sync_led_on_state = LOW;//HIGH;
38 const unsigned int sync_led_off_state = HIGH;//LOW;
39
40 // Arduino compiles everything in the src folder even if not included so it causes and error for the nano if this is not included.
41 #if defined(ARDUINO_TEENSY36)
42 // Status LED Pins
43 const unsigned int status_led_r_pin= 28;
44 const unsigned int status_led_g_pin = 27;
45 const unsigned int status_led_b_pin = 26;
46 #endif
47 // if you have connected to pins with PWM set to true.
48 const bool status_has_pwm = false;
49 // For high to be on use 255 for the on state and 0 for the off, for low as on flip it.
50 const uint8_t status_led_on_state = 0;//255;
51 const uint8_t status_led_off_state = 4095;//0;
52
53 // Arduino compiles everything in the src folder even if not included so it causes and error for the nano if this is not included.
54 #if defined(ARDUINO_TEENSY36)
55 // SPI Follower Pins
56 const unsigned int miso_pin = 12;
57 const unsigned int mosi_pin= 11;
58 const unsigned int sck_pin = 13;
59 const unsigned int cs_pin = 10;
60 const unsigned int spi_mode = 16;
61
62 // Pin to Stop the Motors
63 const unsigned int motor_stop_pin = 6;
64 #endif
65 // Pin to use when we need a value but don't actually want to use it.
66 const unsigned int not_connected_pin = 42; // selected 42 as it is a pad on the back so I figure it won't hurt anything if something goes wrong.
67
68 const unsigned int enable_left_pin[] = {not_connected_pin, not_connected_pin};
69 const unsigned int enable_right_pin[] = {not_connected_pin, not_connected_pin};
70
71 const unsigned int motor_enable_on_state = HIGH;
72 const unsigned int motor_enable_off_state = LOW;
73 };
74
75 #if defined(ARDUINO_ARDUINO_NANO33BLE) | defined(ARDUINO_NANO_RP2040_CONNECT)
76 namespace coms_micro_pins //nano
77 {
78 const unsigned int blue = 24;
79 const unsigned int green = 23;
80 const unsigned int red = 22;
81 const unsigned int led_active_low = 1;
82 };
83 #endif
84 #elif BOARD_VERSION == AK_Board_V0_3
85
86 #include "Arduino.h"
87 namespace logic_micro_pins //teensy
88 {
89 #if defined(ARDUINO_TEENSY41)
90 // Serial Pins, NC
91 const unsigned int rx1_pin = 0;
92 const unsigned int tx1_pin = 1;
93
94 // CAN Pins
95 const unsigned int can_rx_pin = 23;
96 const unsigned int can_tx_pin = 22;
97
98 // FSR Pins
99 const unsigned int fsr_sense_left_heel_pin = A14;
100 const unsigned int fsr_sense_left_toe_pin = A15;
101 const unsigned int fsr_sense_right_heel_pin= A5;
102 const unsigned int fsr_sense_right_toe_pin = A4;
103
104 // Torque Sensor Pins
105 const unsigned int num_available_joints = 2;
106 const unsigned int torque_sensor_left[] = {A12, A13};
107 //const unsigned int torque_sensor_left1 = A16;
108 const unsigned int torque_sensor_right[] = {A7, A6};
109 //const unsigned int torque_sensor_right1 = A8;
110
111
112 // Sync LED Pins
113 const unsigned int sync_led_pin = 15;
114 const unsigned int sync_default_pin = 5;
115 #endif
116 // Arduino compiles all files not just the ones that are used so this is not under teensy to prevent errors
117 const unsigned int sync_led_on_state = LOW;//HIGH;
118 const unsigned int sync_led_off_state = HIGH;//LOW;
119
120 #if defined(ARDUINO_TEENSY41)
121 // Status LED Pins
122 const unsigned int status_led_r_pin = 14;
123 const unsigned int status_led_g_pin = 25;
124 const unsigned int status_led_b_pin = 24;
125 #endif
126
127 // if you have connected to pins with PWM set to true.
128 const bool status_has_pwm = true;
129 // For high to be on use 255 for the on state and 0 for the off, for low as on flip it.
130 const uint8_t status_led_on_state = 0;//255;
131 const uint8_t status_led_off_state = 4095;//0;
132
133 #if defined(ARDUINO_TEENSY41)
134 // SPI Follower Pins
135 const unsigned int miso_pin = 12;
136 const unsigned int mosi_pin= 11;
137 const unsigned int sck_pin = 13;
138 const unsigned int cs_pin = 10;
139 const unsigned int irq_pin = 34;
140 const unsigned int rst_pin = 4;
141 const unsigned int spi_mode = 8; // This is 8 or 16 bit, not the actual SPI mode, I know it is confusing but that is how they chose to make the library.
142
143
144 // Pin to Stop the Motors
145 const unsigned int motor_stop_pin = 9;
146
147 // Pin to use when we need a value but don't actually want to use it.
148 const unsigned int not_connected_pin = 51; // selected 51 as it is a pad on the back so I figure it won't hurt anything if something goes wrong.
149
150 // Motor enable Pins
151 const unsigned int enable_left_pin[] = {28, 29};
152 const unsigned int enable_right_pin[] = {8, 7};
153
154
155 const unsigned int speed_check_pin = 33;
156
157 const unsigned int left_ankle_angle_pin = A16;
158 const unsigned int right_ankle_angle_pin = A17;
159
160 // I2C
161 // SDA 18
162 // SCL 19
163
164 //SPI
165 //
166 #endif
167
168 const unsigned int motor_enable_on_state = HIGH;
169 const unsigned int motor_enable_off_state = LOW;
170 };
171
172 #if defined(ARDUINO_ARDUINO_NANO33BLE) | defined(ARDUINO_NANO_RP2040_CONNECT)
173 namespace coms_micro_pins //nano
174 {
175 const unsigned int blue = 24;
176 const unsigned int green = 23;
177 const unsigned int red = 22;
178 const unsigned int led_active_low = 1;
179
180 // SPI Conroller Pins
181 const unsigned int miso_pin = 11;
182 const unsigned int mosi_pin= 12;
183 const unsigned int sck_pin = 13;
184 const unsigned int cs_pin = 10;
185 const unsigned int spi_mode = 16;
186
187
188 };
189 #endif
190 #elif BOARD_VERSION == AK_Board_V0_4
191
192 #include "Arduino.h"
193 namespace logic_micro_pins //teensy
194 {
195 #if defined(ARDUINO_TEENSY41)
196 // Serial Pins, NC
197 const unsigned int rx1_pin = 0;
198 const unsigned int tx1_pin = 1;
199
200 // CAN Pins
201 const unsigned int can_rx_pin = 23;
202 const unsigned int can_tx_pin = 22;
203
204 // FSR Pins
205 const unsigned int fsr_sense_left_heel_pin = A14;
206 const unsigned int fsr_sense_left_toe_pin = A15;
207 const unsigned int fsr_sense_right_heel_pin= A3;
208 const unsigned int fsr_sense_right_toe_pin = A2;
209
210 // Torque Sensor Pins
211 const unsigned int num_available_joints = 2;
212 const unsigned int torque_sensor_left[] = {A17, A16};
213 //const unsigned int torque_sensor_left1 = A16;
214 const unsigned int torque_sensor_right[] = {A7, A6};
215 //const unsigned int torque_sensor_right1 = A8;
216
217
218 // Sync LED Pins
219 const unsigned int sync_led_pin = 15;
220 const unsigned int sync_default_pin = 5;
221 #endif
222 // Arduino compiles all files not just the ones that are used so this is not under teensy to prevent errors
223 const unsigned int sync_led_on_state = LOW;//HIGH;
224 const unsigned int sync_led_off_state = HIGH;//LOW;
225
226 #if defined(ARDUINO_TEENSY41)
227 // Status LED Pins
228 const unsigned int status_led_r_pin= 14;
229 const unsigned int status_led_g_pin = 25;
230 const unsigned int status_led_b_pin = 24;
231 #endif
232
233 // if you have connected to pins with PWM set to true.
234 const bool status_has_pwm = true;
235 // For high to be on use 255 for the on state and 0 for the off, for low as on flip it.
236 const uint8_t status_led_on_state = 0;//255;
237 const uint8_t status_led_off_state = 4095;//0;
238
239 #if defined(ARDUINO_TEENSY41)
240 // SPI Follower Pins
241 const unsigned int miso_pin = 12;
242 const unsigned int mosi_pin= 11;
243 const unsigned int sck_pin = 13;
244 const unsigned int cs_pin = 10;
245 const unsigned int irq_pin = 34;
246 const unsigned int rst_pin = 4;
247 const unsigned int spi_mode = 8; // This is 8 or 16 bit, not the actual SPI mode, I know it is confusing but that is how they chose to make the library.
248
249
250 // Pin to Stop the Motors
251 const unsigned int motor_stop_pin = 9;
252
253 // Pin to use when we need a value but don't actually want to use it.
254 const unsigned int not_connected_pin = 51; // selected 51 as it is a pad on the back so I figure it won't hurt anything if something goes wrong.
255
256 // Motor enable Pins
257 const unsigned int enable_left_pin[] = {28, 29};
258 const unsigned int enable_right_pin[] = {8, 7};
259
260
261 const unsigned int speed_check_pin = 33;
262
263 const unsigned int left_ankle_angle_pin;
264 const unsigned int right_ankle_angle_pin;
265
266 // I2C
267 // SDA 18
268 // SCL 19
269
270 //SPI
271 //
272 #endif
273
274 const unsigned int motor_enable_on_state = HIGH;
275 const unsigned int motor_enable_off_state = LOW;
276 };
277
278 #if defined(ARDUINO_ARDUINO_NANO33BLE) | defined(ARDUINO_NANO_RP2040_CONNECT)
279 namespace coms_micro_pins //nano
280 {
281 const unsigned int blue = 24;
282 const unsigned int green = 23;
283 const unsigned int red = 22;
284 const unsigned int led_active_low = 1;
285
286 // SPI Conroller Pins
287 const unsigned int miso_pin = 11;
288 const unsigned int mosi_pin= 12;
289 const unsigned int sck_pin = 13;
290 const unsigned int cs_pin = 10;
291 const unsigned int spi_mode = 16;
292
293
294 };
295 #endif
296 #elif BOARD_VERSION == AK_Board_V0_5_1
297
298 #include "Arduino.h"
299 namespace logic_micro_pins //teensy
300 {
301 #if defined(ARDUINO_TEENSY41)
302 // Serial Pins, NC
303 const unsigned int rx1_pin = 0;
304 const unsigned int tx1_pin = 1;
305
306 // CAN Pins
307 const unsigned int can_rx_pin = 23;
308 const unsigned int can_tx_pin = 22;
309
310 // FSR Pins
311 const unsigned int fsr_sense_left_heel_pin = A14;
312 const unsigned int fsr_sense_left_toe_pin = A15;
313 const unsigned int fsr_sense_right_heel_pin= A3;
314 const unsigned int fsr_sense_right_toe_pin = A2;
315
316 // Torque Sensor Pins
317 const unsigned int num_available_joints = 2;
318 const unsigned int torque_sensor_left[] = {A16, A17};
319 //const unsigned int torque_sensor_left1 = A16;
320 const unsigned int torque_sensor_right[] = {A6, A7};
321 //const unsigned int torque_sensor_right1 = A8;
322
323
324 // Sync LED Pins
325 const unsigned int sync_led_pin = 15;
326 const unsigned int sync_default_pin = 5;
327 #endif
328 // Arduino compiles all files not just the ones that are used so this is not under teensy to prevent errors
329 const unsigned int sync_led_on_state = LOW;//HIGH;
330 const unsigned int sync_led_off_state = HIGH;//LOW;
331
332 #if defined(ARDUINO_TEENSY41)
333 // Status LED Pins
334 const unsigned int status_led_r_pin= 14;
335 const unsigned int status_led_g_pin = 25;
336 const unsigned int status_led_b_pin = 24;
337 #endif
338
339 // if you have connected to pins with PWM set to true.
340 const bool status_has_pwm = true;
341 // For high to be on use 255 for the on state and 0 for the off, for low as on flip it.
342 const uint8_t status_led_on_state = 0;//255;
343 const uint8_t status_led_off_state = 4095;//0;
344
345 #if defined(ARDUINO_TEENSY41)
346 // SPI Follower Pins
347 const unsigned int miso_pin ;
348 const unsigned int mosi_pin= 11;
349 const unsigned int sck_pin ;
350 const unsigned int cs_pin = 10;
351 const unsigned int irq_pin = 34;
352 const unsigned int rst_pin = 4;
353 const unsigned int spi_mode = 8; // This is 8 or 16 bit, not the actual SPI mode, I know it is confusing but that is how they chose to make the library.
354
355
356 // Pin to Stop the Motors
357 const unsigned int motor_stop_pin = 9;
358
359 // Pin to use when we need a value but don't actually want to use it.
360 const unsigned int not_connected_pin = 51; // selected 51 as it is a pad on the back so I figure it won't hurt anything if something goes wrong.
361
362 // Motor enable Pins
363 const unsigned int enable_left_pin[] = {28, 29};
364 const unsigned int enable_right_pin[] = {8, 7};
365
366
367 const unsigned int speed_check_pin = 33;
368
369 const unsigned int left_ankle_angle_pin = A13;
370 const unsigned int right_ankle_angle_pin = A12;
371
372 // I2C
373 // SDA 18
374 // SCL 19
375
376 //SPI
377 //
378 #endif
379
380 const unsigned int motor_enable_on_state = HIGH;
381 const unsigned int motor_enable_off_state = LOW;
382 };
383
384 #if defined(ARDUINO_ARDUINO_NANO33BLE) | defined(ARDUINO_NANO_RP2040_CONNECT)
385 namespace coms_micro_pins //nano
386 {
387 const unsigned int blue = 24;
388 const unsigned int green = 23;
389 const unsigned int red = 22;
390 const unsigned int led_active_low = 1;
391
392 // SPI Conroller Pins
393 const unsigned int miso_pin = 11;
394 const unsigned int mosi_pin= 12;
395 const unsigned int sck_pin = 13;
396 const unsigned int cs_pin = 10;
397 const unsigned int spi_mode = 16;
398
399
400 };
401 #endif
402 #endif
403#endif
404
Definition Board.h:88
const unsigned int sync_led_on_state
Definition Board.h:117
const unsigned int sync_led_off_state
Definition Board.h:118
const uint8_t status_led_on_state
Definition Board.h:130
const unsigned int motor_enable_off_state
Definition Board.h:169
const unsigned int motor_enable_on_state
Definition Board.h:168
const bool status_has_pwm
Definition Board.h:128
const uint8_t status_led_off_state
Definition Board.h:131