2 * Copyright © 2010 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 #if defined(TELEMETRUM_V_1_0)
26 #define HAS_SERIAL_1 1
28 #define USE_SERIAL_STDIN 0
31 #define USE_INTERNAL_FLASH 0
35 #define IGNITE_ON_P2 1
36 #define IGNITE_ON_P0 0
37 #define PACKET_HAS_MASTER 0
38 #define PACKET_HAS_SLAVE 1
41 #define HAS_COMPANION 1
42 #define COMPANION_CS_ON_P1 1
43 #define COMPANION_CS_MASK 0x4 /* CS1 is P1_2 */
44 #define COMPANION_CS P1_2
47 #define LEDS_AVAILABLE (AO_LED_RED)
48 #define HAS_EXTERNAL_TEMP 0
49 #define HAS_ACCEL_REF 0
55 #if defined(TELEMETRUM_V_1_1)
60 #define HAS_SERIAL_1 1
61 #define USE_SERIAL_STDIN 0
65 #define USE_INTERNAL_FLASH 0
69 #define IGNITE_ON_P2 1
70 #define IGNITE_ON_P0 0
71 #define PACKET_HAS_MASTER 0
72 #define PACKET_HAS_SLAVE 1
74 #define HAS_COMPANION 1
75 #define COMPANION_CS_ON_P1 1
76 #define COMPANION_CS_MASK 0x4 /* CS1 is P1_2 */
77 #define COMPANION_CS P1_2
80 #define LEDS_AVAILABLE (AO_LED_RED)
81 #define HAS_EXTERNAL_TEMP 0
82 #define HAS_ACCEL_REF 1
83 #define SPI_CS_ON_P1 1
84 #define SPI_CS_ON_P0 0
85 #define M25_CS_MASK 0x02 /* CS0 is P1_1 */
86 #define M25_MAX_CHIPS 1
92 #if defined(TELEMETRUM_V_1_2)
97 #define HAS_SERIAL_1 1
98 #define USE_SERIAL_STDIN 0
102 #define USE_INTERNAL_FLASH 0
106 #define IGNITE_ON_P2 1
107 #define IGNITE_ON_P0 0
108 #define PACKET_HAS_MASTER 0
109 #define PACKET_HAS_SLAVE 1
111 #define HAS_COMPANION 1
112 #define COMPANION_CS_ON_P1 1
113 #define COMPANION_CS_MASK 0x4 /* CS1 is P1_2 */
114 #define COMPANION_CS P1_2
117 #define LEDS_AVAILABLE (AO_LED_RED)
118 #define HAS_EXTERNAL_TEMP 0
119 #define HAS_ACCEL_REF 1
120 #define SPI_CS_ON_P1 1
121 #define SPI_CS_ON_P0 0
122 #define M25_CS_MASK 0x02 /* CS0 is P1_1 */
123 #define M25_MAX_CHIPS 1
126 #define HAS_MONITOR 0
129 #if defined(TELEDONGLE_V_0_2)
133 #define HAS_SERIAL_1 0
134 #define USE_SERIAL_STDIN 0
141 #define IGNITE_ON_P2 0
142 #define IGNITE_ON_P0 0
143 #define PACKET_HAS_MASTER 1
144 #define PACKET_HAS_SLAVE 0
146 #define AO_LED_GREEN 2
147 #define AO_MONITOR_LED AO_LED_GREEN
148 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
149 #define SPI_CS_ON_P1 1
150 #define SPI_CS_ON_P0 0
152 #define HAS_MONITOR 1
153 #define LEGACY_MONITOR 1
158 #if defined(TELEMINI_V_1_0)
163 #define HAS_SERIAL_1 0
164 #define USE_SERIAL_STDIN 0
168 #define USE_INTERNAL_FLASH 1
170 #define IGNITE_ON_P2 0
171 #define IGNITE_ON_P0 1
172 #define PACKET_HAS_MASTER 0
173 #define PACKET_HAS_SLAVE 1
174 #define USE_FAST_ASCENT_LOG 1
176 #define AO_LED_GREEN 1
178 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
179 #define HAS_EXTERNAL_TEMP 0
182 #define HAS_MONITOR 0
185 #if defined(TELENANO_V_0_1)
190 #define HAS_SERIAL_1 0
191 #define USE_SERIAL_STDIN 0
195 #define USE_INTERNAL_FLASH 1
197 #define IGNITE_ON_P2 0
198 #define IGNITE_ON_P0 1
199 #define PACKET_HAS_MASTER 0
200 #define PACKET_HAS_SLAVE 1
202 #define AO_LED_GREEN 1
204 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
205 #define HAS_EXTERNAL_TEMP 0
208 #define HAS_MONITOR 0
211 #if defined(TELEMETRUM_V_0_1)
216 #define HAS_SERIAL_1 1
217 #define USE_SERIAL_STDIN 0
222 #define USE_INTERNAL_FLASH 0
225 #define IGNITE_ON_P2 1
226 #define IGNITE_ON_P0 0
227 #define PACKET_HAS_MASTER 0
228 #define PACKET_HAS_SLAVE 1
230 #define AO_LED_GREEN 1
231 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
232 #define HAS_EXTERNAL_TEMP 1
233 #define HAS_ACCEL_REF 0
234 #define SPI_CS_ON_P1 1
235 #define SPI_CS_ON_P0 0
238 #define HAS_MONITOR 0
239 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
242 #if defined(TELEDONGLE_V_0_1)
246 #define HAS_SERIAL_1 0
247 #define USE_SERIAL_STDIN 0
254 #define IGNITE_ON_P2 0
255 #define IGNITE_ON_P0 0
256 #define PACKET_HAS_MASTER 1
257 #define PACKET_HAS_SLAVE 0
259 #define AO_LED_GREEN 1
260 #define AO_MONITOR_LED AO_LED_GREEN
261 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
262 #define SPI_CS_ON_P1 0
263 #define SPI_CS_ON_P0 1
265 #define HAS_MONITOR 1
266 #define LEGACY_MONITOR 1
271 #if defined(TIDONGLE)
275 #define HAS_SERIAL_1 0
276 #define USE_SERIAL_STDIN 0
283 #define IGNITE_ON_P2 0
284 #define IGNITE_ON_P0 0
285 #define PACKET_HAS_MASTER 1
286 #define PACKET_HAS_SLAVE 0
288 #define AO_MONITOR_LED AO_LED_RED
289 #define LEDS_AVAILABLE (AO_LED_RED)
290 #define SPI_CS_ON_P1 0
291 #define SPI_CS_ON_P0 1
293 #define HAS_MONITOR 1
294 #define LEGACY_MONITOR 1
299 #if defined(TELEBT_V_0_0)
303 #define HAS_SERIAL_1 1
304 #define USE_SERIAL_STDIN 1
312 #define IGNITE_ON_P2 0
313 #define IGNITE_ON_P0 0
314 #define PACKET_HAS_MASTER 1
315 #define PACKET_HAS_SLAVE 0
317 #define AO_LED_GREEN 1
318 #define AO_MONITOR_LED AO_LED_RED
319 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
320 #define SPI_CS_ON_P1 1
321 #define SPI_CS_ON_P0 0
323 #define HAS_IGNITE_REPORT 1
324 #define BT_LINK_ON_P2 1
325 #define BT_LINK_ON_P1 0
326 #define BT_LINK_PIN_INDEX 7
327 #define BT_LINK_PIN P2_1
328 #define HAS_MONITOR 1
329 #define LEGACY_MONITOR 1
334 #if defined(TELEBT_V_0_1)
338 #define HAS_SERIAL_1 1
339 #define HAS_SERIAL_1_ALT_1 1
340 #define HAS_SERIAL_1_ALT_2 0
341 #define HAS_SERIAL_1_HW_FLOW 1
342 #define USE_SERIAL_STDIN 1
347 #define USE_INTERNAL_FLASH 0
351 #define IGNITE_ON_P2 0
352 #define IGNITE_ON_P0 0
353 #define PACKET_HAS_MASTER 1
354 #define PACKET_HAS_SLAVE 0
356 #define AO_LED_GREEN 2
357 #define AO_MONITOR_LED AO_LED_RED
358 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
359 #define SPI_CS_ON_P1 1
360 #define SPI_CS_ON_P0 0
361 #define M25_CS_MASK 0x04 /* CS0 is P1_2 */
362 #define M25_MAX_CHIPS 1
365 #define HAS_IGNITE_REPORT 1
366 #define BT_LINK_ON_P2 0
367 #define BT_LINK_ON_P1 1
368 #define BT_LINK_PIN_INDEX 7
369 #define BT_LINK_PIN P1_7
370 #define HAS_MONITOR 1
371 #define LEGACY_MONITOR 1
376 #if defined(TELELAUNCH_V_0_1)
381 #define HAS_SERIAL_1 1
382 #define USE_SERIAL_STDIN 0
387 #define USE_INTERNAL_FLASH 1
390 #define IGNITE_ON_P2 1
391 #define IGNITE_ON_P0 0
392 #define PACKET_HAS_MASTER 0
393 #define PACKET_HAS_SLAVE 0
395 #define AO_LED_GREEN 1
396 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
397 #define HAS_EXTERNAL_TEMP 1
398 #define HAS_ACCEL_REF 0
399 #define SPI_CS_ON_P1 1
400 #define SPI_CS_ON_P0 0
403 #define HAS_MONITOR 0
409 #define DBG_CLOCK (1 << 4) /* mi0 */
410 #define DBG_DATA (1 << 5) /* mo0 */
411 #define DBG_RESET_N (1 << 3) /* c0 */
413 #define DBG_CLOCK_PIN (P1_4)
414 #define DBG_DATA_PIN (P1_5)
415 #define DBG_RESET_N_PIN (P1_3)
417 #define DBG_PORT_NUM 1
419 #define DBG_PORT_SEL P1SEL
420 #define DBG_PORT_INP P1INP
421 #define DBG_PORT_DIR P1DIR
423 #endif /* DBG_ON_P1 */
427 #define DBG_CLOCK (1 << 3)
428 #define DBG_DATA (1 << 4)
429 #define DBG_RESET_N (1 << 5)
431 #define DBG_CLOCK_PIN (P0_3)
432 #define DBG_DATA_PIN (P0_4)
433 #define DBG_RESET_N_PIN (P0_5)
435 #define DBG_PORT_NUM 0
437 #define DBG_PORT_SEL P0SEL
438 #define DBG_PORT_INP P0INP
439 #define DBG_PORT_DIR P0DIR
441 #endif /* DBG_ON_P0 */
443 #if COMPANION_CS_ON_P1
444 #define COMPANION_CS_PORT P1
445 #define COMPANION_CS_SEL P1SEL
446 #define COMPANION_CS_DIR P1DIR
450 #define SPI_CS_PORT P1
451 #define SPI_CS_SEL P1SEL
452 #define SPI_CS_DIR P1DIR
456 #define SPI_CS_PORT P0
457 #define SPI_CS_SEL P0SEL
458 #define SPI_CS_DIR P0DIR
462 #error Please define IGNITE_ON_P2
466 #error Please define IGNITE_ON_P0
470 #error Please define HAS_SERIAL_1
473 #ifndef USE_SERIAL_STDIN
474 #error Please define USE_SERIAL_STDIN
478 #error Please define HAS_ADC
482 #error Please define HAS_EEPROM
486 #error Please define HAS_LOG
490 #ifndef USE_INTERNAL_FLASH
491 #error Please define USE_INTERNAL_FLASH
496 #error Please define HAS_DBG
500 #error Please define HAS_IGNITE
504 #define HAS_IGNITE_REPORT 1
507 #ifndef PACKET_HAS_MASTER
508 #error Please define PACKET_HAS_MASTER
511 #ifndef PACKET_HAS_SLAVE
512 #error Please define PACKET_HAS_SLAVE
516 #error Please define HAS_MONITOR
521 #error Please define HAS_RSSI
526 #error Please define HAS_ADC
532 #ifndef HAS_ACCEL_REF
533 #error Please define HAS_ACCEL_REF
536 #define HAS_ACCEL_REF 0
542 #define AO_IGNITER_DROGUE P2_3
543 #define AO_IGNITER_MAIN P2_4
544 #define AO_IGNITER_DIR P2DIR
545 #define AO_IGNITER_DROGUE_BIT (1 << 3)
546 #define AO_IGNITER_MAIN_BIT (1 << 4)
550 #define AO_IGNITER_DROGUE P0_5
551 #define AO_IGNITER_MAIN P0_4
552 #define AO_IGNITER_DIR P0DIR
553 #define AO_IGNITER_DROGUE_BIT (1 << 5)
554 #define AO_IGNITER_MAIN_BIT (1 << 4)
557 /* test these values with real igniters */
558 #define AO_IGNITER_OPEN 1000
559 #define AO_IGNITER_CLOSED 7000
560 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
561 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
563 #endif /* _AO_PINS_H_ */