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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 #define DISABLE_LOG_SPACE 1
25 #define HAS_WIDE_GPS 0
27 #if defined(TELEMETRUM_V_1_0)
28 /* Discontinued and was never built with CC1111 chips needing this */
29 #define NEEDS_CC1111_CLOCK_HACK 0
33 #define HAS_BEEP_CONFIG 0
35 #define HAS_SERIAL_1 1
39 #define USE_INTERNAL_FLASH 0
43 #define IGNITE_ON_P2 1
44 #define IGNITE_ON_P0 0
45 #define PACKET_HAS_MASTER 0
46 #define PACKET_HAS_SLAVE 1
49 #define HAS_COMPANION 1
50 #define COMPANION_CS_ON_P1 1
51 #define AO_COMPANION_CS_PORT P1
52 #define AO_COMPANION_CS_PIN 2
53 #define AO_COMPANION_CS P1_2
56 #define LEDS_AVAILABLE (AO_LED_RED)
57 #define HAS_EXTERNAL_TEMP 0
58 #define HAS_ACCEL_REF 0
62 #define HAS_TELEMETRY 1
63 #define HAS_RADIO_RATE 0 /* not enough space for this */
64 #define HAS_MUTEX_TRY 0
65 #define HAS_TASK_INFO 0 /* not enough space for this either */
66 #define AO_LOG_FORMAT AO_LOG_FORMAT_FULL
69 #if defined(TELEMETRUM_V_1_1)
70 /* Discontinued and was never built with CC1111 chips needing this */
71 #define NEEDS_CC1111_CLOCK_HACK 0
75 #define HAS_BEEP_CONFIG 0
76 #define HAS_BATTERY_REPORT 1
78 #define HAS_SERIAL_1 1
82 #define USE_INTERNAL_FLASH 0
86 #define IGNITE_ON_P2 1
87 #define IGNITE_ON_P0 0
88 #define PACKET_HAS_MASTER 0
89 #define PACKET_HAS_SLAVE 1
91 #define HAS_COMPANION 1
92 #define AO_COMPANION_CS_PORT P1
93 #define AO_COMPANION_CS_PIN 2
94 #define AO_COMPANION_CS P1_2
97 #define LEDS_AVAILABLE (AO_LED_RED)
98 #define HAS_EXTERNAL_TEMP 0
99 #define HAS_ACCEL_REF 1
100 #define SPI_CS_ON_P1 1
101 #define SPI_CS_ON_P0 0
102 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
103 #define M25_MAX_CHIPS 1
106 #define HAS_MONITOR 0
107 #define HAS_TELEMETRY 1
108 #define HAS_RADIO_RATE 0 /* not enough space for this */
109 #define HAS_MUTEX_TRY 0
110 #define AO_LOG_FORMAT AO_LOG_FORMAT_FULL
113 #if defined(TELEMETRUM_V_1_2)
114 /* Discontinued and was never built with CC1111 chips needing this */
115 #define NEEDS_CC1111_CLOCK_HACK 0
119 #define HAS_BEEP_CONFIG 0
120 #define HAS_BATTERY_REPORT 1
122 #define HAS_SERIAL_1 1
126 #define USE_INTERNAL_FLASH 0
130 #define IGNITE_ON_P2 1
131 #define IGNITE_ON_P0 0
132 #define PACKET_HAS_MASTER 0
133 #define PACKET_HAS_SLAVE 1
135 #define HAS_COMPANION 1
136 #define AO_COMPANION_CS_PORT P1
137 #define AO_COMPANION_CS_PIN 2
138 #define AO_COMPANION_CS P1_2
141 #define LEDS_AVAILABLE (AO_LED_RED)
142 #define HAS_EXTERNAL_TEMP 0
143 #define HAS_ACCEL_REF 1
144 #define SPI_CS_ON_P1 1
145 #define SPI_CS_ON_P0 0
146 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
147 #define M25_MAX_CHIPS 1
150 #define HAS_MONITOR 0
151 #define HAS_TELEMETRY 1
152 #define HAS_RADIO_RATE 0 /* not enough space for this */
153 #define HAS_MUTEX_TRY 0
154 #define AO_LOG_FORMAT AO_LOG_FORMAT_FULL
157 #if defined(TELEDONGLE_V_0_2)
161 #define HAS_SERIAL_1 0
168 #define IGNITE_ON_P2 0
169 #define IGNITE_ON_P0 0
170 #define PACKET_HAS_MASTER 1
171 #define PACKET_HAS_SLAVE 0
173 #define AO_LED_GREEN 2
174 #define AO_MONITOR_LED AO_LED_GREEN
175 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
176 #define SPI_CS_ON_P1 1
177 #define SPI_CS_ON_P0 0
179 #define HAS_MONITOR 1
180 #define LEGACY_MONITOR 1
183 #define HAS_TELEMETRY 0
184 #define AO_RADIO_REG_TEST 1
187 #if defined(TELEMINI_V_1_0)
188 /* Discontinued and was never built with CC1111 chips needing this */
189 #define NEEDS_CC1111_CLOCK_HACK 0
194 #define HAS_SERIAL_1 0
198 #define HAS_FORCE_FREQ 1
199 #define USE_INTERNAL_FLASH 1
201 #define IGNITE_ON_P2 0
202 #define IGNITE_ON_P0 1
203 #define PACKET_HAS_MASTER 0
204 #define PACKET_HAS_SLAVE 1
205 #define USE_FAST_ASCENT_LOG 1
207 #define AO_LED_GREEN 1
209 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
210 #define HAS_EXTERNAL_TEMP 0
213 #define HAS_MONITOR 0
214 #define HAS_TELEMETRY 1
215 #define HAS_RADIO_RATE 0 /* not enough space for this */
216 #define AO_LOG_FORMAT AO_LOG_FORMAT_TINY
219 #if defined(TELENANO_V_0_1)
220 /* Discontinued and was never built with CC1111 chips needing this */
221 #define NEEDS_CC1111_CLOCK_HACK 0
226 #define HAS_SERIAL_1 0
230 #define USE_INTERNAL_FLASH 1
232 #define IGNITE_ON_P2 0
233 #define IGNITE_ON_P0 1
234 #define PACKET_HAS_MASTER 0
235 #define PACKET_HAS_SLAVE 1
237 #define AO_LED_GREEN 1
239 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
240 #define HAS_EXTERNAL_TEMP 0
243 #define HAS_MONITOR 0
244 #define HAS_TELEMETRY 1
245 #define HAS_RADIO_RATE 0 /* not enough space for this */
248 #if defined(TELEMETRUM_V_0_1)
249 /* Discontinued and was never built with CC1111 chips needing this */
250 #define NEEDS_CC1111_CLOCK_HACK 0
254 #define HAS_BEEP_CONFIG 0
256 #define HAS_SERIAL_1 1
261 #define USE_INTERNAL_FLASH 0
264 #define IGNITE_ON_P2 1
265 #define IGNITE_ON_P0 0
266 #define PACKET_HAS_MASTER 0
267 #define PACKET_HAS_SLAVE 1
269 #define AO_LED_GREEN 1
270 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
271 #define HAS_EXTERNAL_TEMP 1
272 #define HAS_ACCEL_REF 0
273 #define SPI_CS_ON_P1 1
274 #define SPI_CS_ON_P0 0
277 #define HAS_MONITOR 0
278 #define HAS_TELEMETRY 1
279 #define HAS_RADIO_RATE 0 /* not enough space for this */
280 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
281 #define AO_LOG_FORMAT AO_LOG_FORMAT_FULL
284 #if defined(TELEDONGLE_V_0_1)
285 /* Discontinued and was never built with CC1111 chips needing this */
286 #define NEEDS_CC1111_CLOCK_HACK 0
290 #define HAS_SERIAL_1 0
297 #define IGNITE_ON_P2 0
298 #define IGNITE_ON_P0 0
299 #define PACKET_HAS_MASTER 1
300 #define PACKET_HAS_SLAVE 0
302 #define AO_LED_GREEN 1
303 #define AO_MONITOR_LED AO_LED_GREEN
304 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
305 #define SPI_CS_ON_P1 0
306 #define SPI_CS_ON_P0 1
308 #define HAS_MONITOR 1
309 #define LEGACY_MONITOR 1
312 #define HAS_TELEMETRY 0
315 #if defined(TIDONGLE)
316 /* Discontinued and was never built with CC1111 chips needing this */
317 #define NEEDS_CC1111_CLOCK_HACK 0
321 #define HAS_SERIAL_1 0
328 #define IGNITE_ON_P2 0
329 #define IGNITE_ON_P0 0
330 #define PACKET_HAS_MASTER 1
331 #define PACKET_HAS_SLAVE 0
333 #define AO_MONITOR_LED AO_LED_RED
334 #define LEDS_AVAILABLE (AO_LED_RED)
335 #define SPI_CS_ON_P1 0
336 #define SPI_CS_ON_P0 1
338 #define HAS_MONITOR 1
339 #define LEGACY_MONITOR 1
342 #define HAS_TELEMETRY 0
345 #if defined(TELEBT_V_0_0)
346 /* Discontinued and was never built with CC1111 chips needing this */
347 #define NEEDS_CC1111_CLOCK_HACK 0
351 #define HAS_SERIAL_1 1
352 #define USE_SERIAL_1_STDIN 1
353 #define DELAY_SERIAL_1_STDIN 1
361 #define IGNITE_ON_P2 0
362 #define IGNITE_ON_P0 0
363 #define PACKET_HAS_MASTER 1
364 #define PACKET_HAS_SLAVE 0
366 #define AO_LED_GREEN 1
367 #define AO_MONITOR_LED AO_LED_RED
368 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
369 #define SPI_CS_ON_P1 1
370 #define SPI_CS_ON_P0 0
372 #define HAS_IGNITE_REPORT 1
373 #define BT_LINK_ON_P2 1
374 #define BT_LINK_ON_P1 0
375 #define BT_LINK_PIN_INDEX 7
376 #define BT_LINK_PIN P2_1
377 #define HAS_MONITOR 1
378 #define LEGACY_MONITOR 1
381 #define HAS_TELEMETRY 0
382 #define AO_RADIO_REG_TEST 1
385 #if defined(TELEBT_V_0_1)
386 /* Discontinued and was never built with CC1111 chips needing this */
387 #define NEEDS_CC1111_CLOCK_HACK 0
391 #define HAS_BEEP_CONFIG 0
392 #define HAS_SERIAL_1 1
393 #define HAS_SERIAL_1_ALT_1 1
394 #define HAS_SERIAL_1_ALT_2 0
395 #define HAS_SERIAL_1_HW_FLOW 1
396 #define USE_SERIAL_1_STDIN 1
397 #define DELAY_SERIAL_1_STDIN 1
402 #define USE_INTERNAL_FLASH 0
406 #define IGNITE_ON_P2 0
407 #define IGNITE_ON_P0 0
408 #define PACKET_HAS_MASTER 1
409 #define PACKET_HAS_SLAVE 0
411 #define AO_LED_GREEN 2
412 #define AO_MONITOR_LED AO_LED_RED
413 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
414 #define SPI_CS_ON_P1 1
415 #define SPI_CS_ON_P0 0
416 #define AO_M25_SPI_CS_MASK 0x04 /* CS0 is P1_2 */
417 #define M25_MAX_CHIPS 1
420 #define HAS_IGNITE_REPORT 1
421 #define BT_LINK_ON_P2 0
422 #define BT_LINK_ON_P1 1
423 #define BT_LINK_PIN_INDEX 7
424 #define BT_LINK_PIN P1_7
425 #define HAS_MONITOR 1
426 #define LEGACY_MONITOR 1
429 #define HAS_TELEMETRY 0
430 #define AO_RADIO_REG_TEST 1
433 #if defined(TELELAUNCH_V_0_1)
434 /* Discontinued and was never built with CC1111 chips needing this */
435 #define NEEDS_CC1111_CLOCK_HACK 0
440 #define HAS_SERIAL_1 1
445 #define USE_INTERNAL_FLASH 1
448 #define IGNITE_ON_P2 1
449 #define IGNITE_ON_P0 0
450 #define PACKET_HAS_MASTER 0
451 #define PACKET_HAS_SLAVE 0
453 #define AO_LED_GREEN 1
454 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
455 #define HAS_EXTERNAL_TEMP 1
456 #define HAS_ACCEL_REF 0
457 #define SPI_CS_ON_P1 1
458 #define SPI_CS_ON_P0 0
461 #define HAS_MONITOR 0
463 #define HAS_TELEMETRY 0
468 #define DBG_CLOCK (1 << 4) /* mi0 */
469 #define DBG_DATA (1 << 5) /* mo0 */
470 #define DBG_RESET_N (1 << 3) /* c0 */
472 #define DBG_CLOCK_PIN (P1_4)
473 #define DBG_DATA_PIN (P1_5)
474 #define DBG_RESET_N_PIN (P1_3)
476 #define DBG_PORT_NUM 1
478 #define DBG_PORT_SEL P1SEL
479 #define DBG_PORT_INP P1INP
480 #define DBG_PORT_DIR P1DIR
482 #endif /* DBG_ON_P1 */
486 #define DBG_CLOCK (1 << 3)
487 #define DBG_DATA (1 << 4)
488 #define DBG_RESET_N (1 << 5)
490 #define DBG_CLOCK_PIN (P0_3)
491 #define DBG_DATA_PIN (P0_4)
492 #define DBG_RESET_N_PIN (P0_5)
494 #define DBG_PORT_NUM 0
496 #define DBG_PORT_SEL P0SEL
497 #define DBG_PORT_INP P0INP
498 #define DBG_PORT_DIR P0DIR
500 #endif /* DBG_ON_P0 */
502 #if COMPANION_CS_ON_P1
503 #define COMPANION_CS_PORT P1
504 #define COMPANION_CS_SEL P1SEL
505 #define COMPANION_CS_DIR P1DIR
509 #define SPI_CS_PORT P1
510 #define SPI_CS_SEL P1SEL
511 #define SPI_CS_DIR P1DIR
515 #define SPI_CS_PORT P0
516 #define SPI_CS_SEL P0SEL
517 #define SPI_CS_DIR P0DIR
520 #define AO_M25_SPI_CS_PORT SPI_CS_PORT
523 #error Please define IGNITE_ON_P2
527 #error Please define IGNITE_ON_P0
531 #error Please define HAS_ADC
535 #error Please define HAS_EEPROM
539 #error Please define HAS_LOG
543 #ifndef USE_INTERNAL_FLASH
544 #error Please define USE_INTERNAL_FLASH
549 #error Please define HAS_DBG
553 #error Please define HAS_IGNITE
557 #define HAS_IGNITE_REPORT 1
560 #ifndef PACKET_HAS_MASTER
561 #error Please define PACKET_HAS_MASTER
564 #ifndef PACKET_HAS_SLAVE
565 #error Please define PACKET_HAS_SLAVE
569 #error Please define HAS_MONITOR
574 #error Please define HAS_RSSI
579 #error Please define HAS_ADC
585 #ifndef HAS_ACCEL_REF
586 #error Please define HAS_ACCEL_REF
589 #define HAS_ACCEL_REF 0
595 #define AO_IGNITER_PORT P2
596 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
597 #define AO_IGNITER_DROGUE P2_3
598 #define AO_IGNITER_MAIN P2_4
599 #define AO_IGNITER_DIR P2DIR
600 #define AO_IGNITER_DROGUE_BIT (1 << 3)
601 #define AO_IGNITER_MAIN_BIT (1 << 4)
602 #define AO_IGNITER_DROGUE_PIN 3
603 #define AO_IGNITER_MAIN_PIN 4
607 #define AO_IGNITER_PORT P0
608 #define AO_IGNITER_DROGUE P0_5
609 #define AO_IGNITER_MAIN P0_4
610 #define AO_IGNITER_DIR P0DIR
611 #define AO_IGNITER_DROGUE_BIT (1 << 5)
612 #define AO_IGNITER_MAIN_BIT (1 << 4)
613 #define AO_IGNITER_DROGUE_PIN 5
614 #define AO_IGNITER_MAIN_PIN 4
617 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
618 #define AO_IGNITER_MAIN_PORT AO_IGNITER_PORT
620 /* test these values with real igniters */
621 #define AO_IGNITER_OPEN 1000
622 #define AO_IGNITER_CLOSED 7000
623 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
624 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
627 int16_t accel; /* accelerometer */
628 int16_t pres; /* pressure sensor */
629 int16_t temp; /* temperature sensor */
630 int16_t v_batt; /* battery voltage */
631 int16_t sense_d; /* drogue continuity sense */
632 int16_t sense_m; /* main continuity sense */
634 uint16_t accel_ref; /* acceleration reference */
639 * Voltage divider on ADC battery sampler
641 #define AO_BATTERY_DIV_PLUS 5 /* 5k */
642 #define AO_BATTERY_DIV_MINUS 10 /* 10k */
645 * Voltage divider on ADC igniter samplers
647 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
648 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
651 * ADC reference in decivolts
653 #define AO_ADC_REFERENCE_DV 33
655 #endif /* _AO_PINS_H_ */