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 */
68 #if defined(TELEMETRUM_V_1_1)
69 /* Discontinued and was never built with CC1111 chips needing this */
70 #define NEEDS_CC1111_CLOCK_HACK 0
74 #define HAS_BEEP_CONFIG 0
75 #define HAS_BATTERY_REPORT 1
77 #define HAS_SERIAL_1 1
81 #define USE_INTERNAL_FLASH 0
85 #define IGNITE_ON_P2 1
86 #define IGNITE_ON_P0 0
87 #define PACKET_HAS_MASTER 0
88 #define PACKET_HAS_SLAVE 1
90 #define HAS_COMPANION 1
91 #define AO_COMPANION_CS_PORT P1
92 #define AO_COMPANION_CS_PIN 2
93 #define AO_COMPANION_CS P1_2
96 #define LEDS_AVAILABLE (AO_LED_RED)
97 #define HAS_EXTERNAL_TEMP 0
98 #define HAS_ACCEL_REF 1
99 #define SPI_CS_ON_P1 1
100 #define SPI_CS_ON_P0 0
101 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
102 #define M25_MAX_CHIPS 1
105 #define HAS_MONITOR 0
106 #define HAS_TELEMETRY 1
107 #define HAS_RADIO_RATE 0 /* not enough space for this */
108 #define HAS_MUTEX_TRY 0
111 #if defined(TELEMETRUM_V_1_2)
112 /* Discontinued and was never built with CC1111 chips needing this */
113 #define NEEDS_CC1111_CLOCK_HACK 0
117 #define HAS_BEEP_CONFIG 0
118 #define HAS_BATTERY_REPORT 1
120 #define HAS_SERIAL_1 1
124 #define USE_INTERNAL_FLASH 0
128 #define IGNITE_ON_P2 1
129 #define IGNITE_ON_P0 0
130 #define PACKET_HAS_MASTER 0
131 #define PACKET_HAS_SLAVE 1
133 #define HAS_COMPANION 1
134 #define AO_COMPANION_CS_PORT P1
135 #define AO_COMPANION_CS_PIN 2
136 #define AO_COMPANION_CS P1_2
139 #define LEDS_AVAILABLE (AO_LED_RED)
140 #define HAS_EXTERNAL_TEMP 0
141 #define HAS_ACCEL_REF 1
142 #define SPI_CS_ON_P1 1
143 #define SPI_CS_ON_P0 0
144 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
145 #define M25_MAX_CHIPS 1
148 #define HAS_MONITOR 0
149 #define HAS_TELEMETRY 1
150 #define HAS_RADIO_RATE 0 /* not enough space for this */
151 #define HAS_MUTEX_TRY 0
154 #if defined(TELEDONGLE_V_0_2)
158 #define HAS_SERIAL_1 0
165 #define IGNITE_ON_P2 0
166 #define IGNITE_ON_P0 0
167 #define PACKET_HAS_MASTER 1
168 #define PACKET_HAS_SLAVE 0
170 #define AO_LED_GREEN 2
171 #define AO_MONITOR_LED AO_LED_GREEN
172 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
173 #define SPI_CS_ON_P1 1
174 #define SPI_CS_ON_P0 0
176 #define HAS_MONITOR 1
177 #define LEGACY_MONITOR 1
180 #define HAS_TELEMETRY 0
181 #define AO_RADIO_REG_TEST 1
184 #if defined(TELEMINI_V_1_0)
185 /* Discontinued and was never built with CC1111 chips needing this */
186 #define NEEDS_CC1111_CLOCK_HACK 0
191 #define HAS_SERIAL_1 0
195 #define HAS_FORCE_FREQ 1
196 #define USE_INTERNAL_FLASH 1
198 #define IGNITE_ON_P2 0
199 #define IGNITE_ON_P0 1
200 #define PACKET_HAS_MASTER 0
201 #define PACKET_HAS_SLAVE 1
202 #define USE_FAST_ASCENT_LOG 1
204 #define AO_LED_GREEN 1
206 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
207 #define HAS_EXTERNAL_TEMP 0
210 #define HAS_MONITOR 0
211 #define HAS_TELEMETRY 1
212 #define HAS_RADIO_RATE 0 /* not enough space for this */
215 #if defined(TELENANO_V_0_1)
216 /* Discontinued and was never built with CC1111 chips needing this */
217 #define NEEDS_CC1111_CLOCK_HACK 0
222 #define HAS_SERIAL_1 0
226 #define USE_INTERNAL_FLASH 1
228 #define IGNITE_ON_P2 0
229 #define IGNITE_ON_P0 1
230 #define PACKET_HAS_MASTER 0
231 #define PACKET_HAS_SLAVE 1
233 #define AO_LED_GREEN 1
235 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
236 #define HAS_EXTERNAL_TEMP 0
239 #define HAS_MONITOR 0
240 #define HAS_TELEMETRY 1
241 #define HAS_RADIO_RATE 0 /* not enough space for this */
244 #if defined(TELEMETRUM_V_0_1)
245 /* Discontinued and was never built with CC1111 chips needing this */
246 #define NEEDS_CC1111_CLOCK_HACK 0
250 #define HAS_BEEP_CONFIG 0
252 #define HAS_SERIAL_1 1
257 #define USE_INTERNAL_FLASH 0
260 #define IGNITE_ON_P2 1
261 #define IGNITE_ON_P0 0
262 #define PACKET_HAS_MASTER 0
263 #define PACKET_HAS_SLAVE 1
265 #define AO_LED_GREEN 1
266 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
267 #define HAS_EXTERNAL_TEMP 1
268 #define HAS_ACCEL_REF 0
269 #define SPI_CS_ON_P1 1
270 #define SPI_CS_ON_P0 0
273 #define HAS_MONITOR 0
274 #define HAS_TELEMETRY 1
275 #define HAS_RADIO_RATE 0 /* not enough space for this */
276 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
279 #if defined(TELEDONGLE_V_0_1)
280 /* Discontinued and was never built with CC1111 chips needing this */
281 #define NEEDS_CC1111_CLOCK_HACK 0
285 #define HAS_SERIAL_1 0
292 #define IGNITE_ON_P2 0
293 #define IGNITE_ON_P0 0
294 #define PACKET_HAS_MASTER 1
295 #define PACKET_HAS_SLAVE 0
297 #define AO_LED_GREEN 1
298 #define AO_MONITOR_LED AO_LED_GREEN
299 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
300 #define SPI_CS_ON_P1 0
301 #define SPI_CS_ON_P0 1
303 #define HAS_MONITOR 1
304 #define LEGACY_MONITOR 1
307 #define HAS_TELEMETRY 0
310 #if defined(TIDONGLE)
311 /* Discontinued and was never built with CC1111 chips needing this */
312 #define NEEDS_CC1111_CLOCK_HACK 0
316 #define HAS_SERIAL_1 0
323 #define IGNITE_ON_P2 0
324 #define IGNITE_ON_P0 0
325 #define PACKET_HAS_MASTER 1
326 #define PACKET_HAS_SLAVE 0
328 #define AO_MONITOR_LED AO_LED_RED
329 #define LEDS_AVAILABLE (AO_LED_RED)
330 #define SPI_CS_ON_P1 0
331 #define SPI_CS_ON_P0 1
333 #define HAS_MONITOR 1
334 #define LEGACY_MONITOR 1
337 #define HAS_TELEMETRY 0
340 #if defined(TELEBT_V_0_0)
341 /* Discontinued and was never built with CC1111 chips needing this */
342 #define NEEDS_CC1111_CLOCK_HACK 0
346 #define HAS_SERIAL_1 1
347 #define USE_SERIAL_1_STDIN 1
348 #define DELAY_SERIAL_1_STDIN 1
356 #define IGNITE_ON_P2 0
357 #define IGNITE_ON_P0 0
358 #define PACKET_HAS_MASTER 1
359 #define PACKET_HAS_SLAVE 0
361 #define AO_LED_GREEN 1
362 #define AO_MONITOR_LED AO_LED_RED
363 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
364 #define SPI_CS_ON_P1 1
365 #define SPI_CS_ON_P0 0
367 #define HAS_IGNITE_REPORT 1
368 #define BT_LINK_ON_P2 1
369 #define BT_LINK_ON_P1 0
370 #define BT_LINK_PIN_INDEX 7
371 #define BT_LINK_PIN P2_1
372 #define HAS_MONITOR 1
373 #define LEGACY_MONITOR 1
376 #define HAS_TELEMETRY 0
377 #define AO_RADIO_REG_TEST 1
380 #if defined(TELEBT_V_0_1)
381 /* Discontinued and was never built with CC1111 chips needing this */
382 #define NEEDS_CC1111_CLOCK_HACK 0
386 #define HAS_BEEP_CONFIG 0
387 #define HAS_SERIAL_1 1
388 #define HAS_SERIAL_1_ALT_1 1
389 #define HAS_SERIAL_1_ALT_2 0
390 #define HAS_SERIAL_1_HW_FLOW 1
391 #define USE_SERIAL_1_STDIN 1
392 #define DELAY_SERIAL_1_STDIN 1
397 #define USE_INTERNAL_FLASH 0
401 #define IGNITE_ON_P2 0
402 #define IGNITE_ON_P0 0
403 #define PACKET_HAS_MASTER 1
404 #define PACKET_HAS_SLAVE 0
406 #define AO_LED_GREEN 2
407 #define AO_MONITOR_LED AO_LED_RED
408 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
409 #define SPI_CS_ON_P1 1
410 #define SPI_CS_ON_P0 0
411 #define AO_M25_SPI_CS_MASK 0x04 /* CS0 is P1_2 */
412 #define M25_MAX_CHIPS 1
415 #define HAS_IGNITE_REPORT 1
416 #define BT_LINK_ON_P2 0
417 #define BT_LINK_ON_P1 1
418 #define BT_LINK_PIN_INDEX 7
419 #define BT_LINK_PIN P1_7
420 #define HAS_MONITOR 1
421 #define LEGACY_MONITOR 1
424 #define HAS_TELEMETRY 0
425 #define AO_RADIO_REG_TEST 1
428 #if defined(TELELAUNCH_V_0_1)
429 /* Discontinued and was never built with CC1111 chips needing this */
430 #define NEEDS_CC1111_CLOCK_HACK 0
435 #define HAS_SERIAL_1 1
440 #define USE_INTERNAL_FLASH 1
443 #define IGNITE_ON_P2 1
444 #define IGNITE_ON_P0 0
445 #define PACKET_HAS_MASTER 0
446 #define PACKET_HAS_SLAVE 0
448 #define AO_LED_GREEN 1
449 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
450 #define HAS_EXTERNAL_TEMP 1
451 #define HAS_ACCEL_REF 0
452 #define SPI_CS_ON_P1 1
453 #define SPI_CS_ON_P0 0
456 #define HAS_MONITOR 0
458 #define HAS_TELEMETRY 0
463 #define DBG_CLOCK (1 << 4) /* mi0 */
464 #define DBG_DATA (1 << 5) /* mo0 */
465 #define DBG_RESET_N (1 << 3) /* c0 */
467 #define DBG_CLOCK_PIN (P1_4)
468 #define DBG_DATA_PIN (P1_5)
469 #define DBG_RESET_N_PIN (P1_3)
471 #define DBG_PORT_NUM 1
473 #define DBG_PORT_SEL P1SEL
474 #define DBG_PORT_INP P1INP
475 #define DBG_PORT_DIR P1DIR
477 #endif /* DBG_ON_P1 */
481 #define DBG_CLOCK (1 << 3)
482 #define DBG_DATA (1 << 4)
483 #define DBG_RESET_N (1 << 5)
485 #define DBG_CLOCK_PIN (P0_3)
486 #define DBG_DATA_PIN (P0_4)
487 #define DBG_RESET_N_PIN (P0_5)
489 #define DBG_PORT_NUM 0
491 #define DBG_PORT_SEL P0SEL
492 #define DBG_PORT_INP P0INP
493 #define DBG_PORT_DIR P0DIR
495 #endif /* DBG_ON_P0 */
497 #if COMPANION_CS_ON_P1
498 #define COMPANION_CS_PORT P1
499 #define COMPANION_CS_SEL P1SEL
500 #define COMPANION_CS_DIR P1DIR
504 #define SPI_CS_PORT P1
505 #define SPI_CS_SEL P1SEL
506 #define SPI_CS_DIR P1DIR
510 #define SPI_CS_PORT P0
511 #define SPI_CS_SEL P0SEL
512 #define SPI_CS_DIR P0DIR
515 #define AO_M25_SPI_CS_PORT SPI_CS_PORT
518 #error Please define IGNITE_ON_P2
522 #error Please define IGNITE_ON_P0
526 #error Please define HAS_ADC
530 #error Please define HAS_EEPROM
534 #error Please define HAS_LOG
538 #ifndef USE_INTERNAL_FLASH
539 #error Please define USE_INTERNAL_FLASH
544 #error Please define HAS_DBG
548 #error Please define HAS_IGNITE
552 #define HAS_IGNITE_REPORT 1
555 #ifndef PACKET_HAS_MASTER
556 #error Please define PACKET_HAS_MASTER
559 #ifndef PACKET_HAS_SLAVE
560 #error Please define PACKET_HAS_SLAVE
564 #error Please define HAS_MONITOR
569 #error Please define HAS_RSSI
574 #error Please define HAS_ADC
580 #ifndef HAS_ACCEL_REF
581 #error Please define HAS_ACCEL_REF
584 #define HAS_ACCEL_REF 0
590 #define AO_IGNITER_PORT P2
591 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
592 #define AO_IGNITER_DROGUE P2_3
593 #define AO_IGNITER_MAIN P2_4
594 #define AO_IGNITER_DIR P2DIR
595 #define AO_IGNITER_DROGUE_BIT (1 << 3)
596 #define AO_IGNITER_MAIN_BIT (1 << 4)
597 #define AO_IGNITER_DROGUE_PIN 3
598 #define AO_IGNITER_MAIN_PIN 4
602 #define AO_IGNITER_PORT P0
603 #define AO_IGNITER_DROGUE P0_5
604 #define AO_IGNITER_MAIN P0_4
605 #define AO_IGNITER_DIR P0DIR
606 #define AO_IGNITER_DROGUE_BIT (1 << 5)
607 #define AO_IGNITER_MAIN_BIT (1 << 4)
608 #define AO_IGNITER_DROGUE_PIN 5
609 #define AO_IGNITER_MAIN_PIN 4
612 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
613 #define AO_IGNITER_MAIN_PORT AO_IGNITER_PORT
615 /* test these values with real igniters */
616 #define AO_IGNITER_OPEN 1000
617 #define AO_IGNITER_CLOSED 7000
618 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
619 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
622 int16_t accel; /* accelerometer */
623 int16_t pres; /* pressure sensor */
624 int16_t temp; /* temperature sensor */
625 int16_t v_batt; /* battery voltage */
626 int16_t sense_d; /* drogue continuity sense */
627 int16_t sense_m; /* main continuity sense */
629 uint16_t accel_ref; /* acceleration reference */
634 * Voltage divider on ADC battery sampler
636 #define AO_BATTERY_DIV_PLUS 5 /* 5k */
637 #define AO_BATTERY_DIV_MINUS 10 /* 10k */
640 * Voltage divider on ADC igniter samplers
642 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
643 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
646 * ADC reference in decivolts
648 #define AO_ADC_REFERENCE_DV 33
650 #endif /* _AO_PINS_H_ */