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.
22 #define DISABLE_LOG_SPACE 1
24 #if defined(TELEMETRUM_V_1_0)
25 /* Discontinued and was never built with CC1111 chips needing this */
26 #define NEEDS_CC1111_CLOCK_HACK 0
30 #define HAS_BEEP_CONFIG 0
32 #define HAS_SERIAL_1 1
36 #define USE_INTERNAL_FLASH 0
40 #define IGNITE_ON_P2 1
41 #define IGNITE_ON_P0 0
42 #define PACKET_HAS_MASTER 0
43 #define PACKET_HAS_SLAVE 1
46 #define HAS_COMPANION 1
47 #define COMPANION_CS_ON_P1 1
48 #define AO_COMPANION_CS_PORT P1
49 #define AO_COMPANION_CS_PIN 2
50 #define AO_COMPANION_CS P1_2
53 #define LEDS_AVAILABLE (AO_LED_RED)
54 #define HAS_EXTERNAL_TEMP 0
55 #define HAS_ACCEL_REF 0
59 #define HAS_TELEMETRY 1
62 #if defined(TELEMETRUM_V_1_1)
63 /* Discontinued and was never built with CC1111 chips needing this */
64 #define NEEDS_CC1111_CLOCK_HACK 0
68 #define HAS_BEEP_CONFIG 0
69 #define HAS_BATTERY_REPORT 1
71 #define HAS_SERIAL_1 1
75 #define USE_INTERNAL_FLASH 0
79 #define IGNITE_ON_P2 1
80 #define IGNITE_ON_P0 0
81 #define PACKET_HAS_MASTER 0
82 #define PACKET_HAS_SLAVE 1
84 #define HAS_COMPANION 1
85 #define AO_COMPANION_CS_PORT P1
86 #define AO_COMPANION_CS_PIN 2
87 #define AO_COMPANION_CS P1_2
90 #define LEDS_AVAILABLE (AO_LED_RED)
91 #define HAS_EXTERNAL_TEMP 0
92 #define HAS_ACCEL_REF 1
93 #define SPI_CS_ON_P1 1
94 #define SPI_CS_ON_P0 0
95 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
96 #define M25_MAX_CHIPS 1
100 #define HAS_TELEMETRY 1
103 #if defined(TELEMETRUM_V_1_2)
104 /* Discontinued and was never built with CC1111 chips needing this */
105 #define NEEDS_CC1111_CLOCK_HACK 0
109 #define HAS_BEEP_CONFIG 0
110 #define HAS_BATTERY_REPORT 1
112 #define HAS_SERIAL_1 1
116 #define USE_INTERNAL_FLASH 0
120 #define IGNITE_ON_P2 1
121 #define IGNITE_ON_P0 0
122 #define PACKET_HAS_MASTER 0
123 #define PACKET_HAS_SLAVE 1
125 #define HAS_COMPANION 1
126 #define AO_COMPANION_CS_PORT P1
127 #define AO_COMPANION_CS_PIN 2
128 #define AO_COMPANION_CS P1_2
131 #define LEDS_AVAILABLE (AO_LED_RED)
132 #define HAS_EXTERNAL_TEMP 0
133 #define HAS_ACCEL_REF 1
134 #define SPI_CS_ON_P1 1
135 #define SPI_CS_ON_P0 0
136 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
137 #define M25_MAX_CHIPS 1
140 #define HAS_MONITOR 0
141 #define HAS_TELEMETRY 1
144 #if defined(TELEDONGLE_V_0_2)
148 #define HAS_SERIAL_1 0
155 #define IGNITE_ON_P2 0
156 #define IGNITE_ON_P0 0
157 #define PACKET_HAS_MASTER 1
158 #define PACKET_HAS_SLAVE 0
160 #define AO_LED_GREEN 2
161 #define AO_MONITOR_LED AO_LED_GREEN
162 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
163 #define SPI_CS_ON_P1 1
164 #define SPI_CS_ON_P0 0
166 #define HAS_MONITOR 1
167 #define LEGACY_MONITOR 1
170 #define HAS_TELEMETRY 0
171 #define AO_RADIO_REG_TEST 1
174 #if defined(TELEMINI_V_1_0)
175 /* Discontinued and was never built with CC1111 chips needing this */
176 #define NEEDS_CC1111_CLOCK_HACK 0
181 #define HAS_SERIAL_1 0
185 #define HAS_FORCE_FREQ 1
186 #define USE_INTERNAL_FLASH 1
188 #define IGNITE_ON_P2 0
189 #define IGNITE_ON_P0 1
190 #define PACKET_HAS_MASTER 0
191 #define PACKET_HAS_SLAVE 1
192 #define USE_FAST_ASCENT_LOG 1
194 #define AO_LED_GREEN 1
196 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
197 #define HAS_EXTERNAL_TEMP 0
200 #define HAS_MONITOR 0
201 #define HAS_TELEMETRY 1
202 #define HAS_RADIO_RATE 0 /* not enough space for this */
205 #if defined(TELENANO_V_0_1)
206 /* Discontinued and was never built with CC1111 chips needing this */
207 #define NEEDS_CC1111_CLOCK_HACK 0
212 #define HAS_SERIAL_1 0
216 #define USE_INTERNAL_FLASH 1
218 #define IGNITE_ON_P2 0
219 #define IGNITE_ON_P0 1
220 #define PACKET_HAS_MASTER 0
221 #define PACKET_HAS_SLAVE 1
223 #define AO_LED_GREEN 1
225 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
226 #define HAS_EXTERNAL_TEMP 0
229 #define HAS_MONITOR 0
230 #define HAS_TELEMETRY 1
231 #define HAS_RADIO_RATE 0 /* not enough space for this */
234 #if defined(TELEMETRUM_V_0_1)
235 /* Discontinued and was never built with CC1111 chips needing this */
236 #define NEEDS_CC1111_CLOCK_HACK 0
240 #define HAS_BEEP_CONFIG 0
242 #define HAS_SERIAL_1 1
247 #define USE_INTERNAL_FLASH 0
250 #define IGNITE_ON_P2 1
251 #define IGNITE_ON_P0 0
252 #define PACKET_HAS_MASTER 0
253 #define PACKET_HAS_SLAVE 1
255 #define AO_LED_GREEN 1
256 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
257 #define HAS_EXTERNAL_TEMP 1
258 #define HAS_ACCEL_REF 0
259 #define SPI_CS_ON_P1 1
260 #define SPI_CS_ON_P0 0
263 #define HAS_MONITOR 0
264 #define HAS_TELEMETRY 1
265 #define HAS_RADIO_RATE 0 /* not enough space for this */
266 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
269 #if defined(TELEDONGLE_V_0_1)
270 /* Discontinued and was never built with CC1111 chips needing this */
271 #define NEEDS_CC1111_CLOCK_HACK 0
275 #define HAS_SERIAL_1 0
282 #define IGNITE_ON_P2 0
283 #define IGNITE_ON_P0 0
284 #define PACKET_HAS_MASTER 1
285 #define PACKET_HAS_SLAVE 0
287 #define AO_LED_GREEN 1
288 #define AO_MONITOR_LED AO_LED_GREEN
289 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
290 #define SPI_CS_ON_P1 0
291 #define SPI_CS_ON_P0 1
293 #define HAS_MONITOR 1
294 #define LEGACY_MONITOR 1
297 #define HAS_TELEMETRY 0
300 #if defined(TIDONGLE)
301 /* Discontinued and was never built with CC1111 chips needing this */
302 #define NEEDS_CC1111_CLOCK_HACK 0
306 #define HAS_SERIAL_1 0
313 #define IGNITE_ON_P2 0
314 #define IGNITE_ON_P0 0
315 #define PACKET_HAS_MASTER 1
316 #define PACKET_HAS_SLAVE 0
318 #define AO_MONITOR_LED AO_LED_RED
319 #define LEDS_AVAILABLE (AO_LED_RED)
320 #define SPI_CS_ON_P1 0
321 #define SPI_CS_ON_P0 1
323 #define HAS_MONITOR 1
324 #define LEGACY_MONITOR 1
327 #define HAS_TELEMETRY 0
330 #if defined(TELEBT_V_0_0)
331 /* Discontinued and was never built with CC1111 chips needing this */
332 #define NEEDS_CC1111_CLOCK_HACK 0
336 #define HAS_SERIAL_1 1
337 #define USE_SERIAL_1_STDIN 1
338 #define DELAY_SERIAL_1_STDIN 1
346 #define IGNITE_ON_P2 0
347 #define IGNITE_ON_P0 0
348 #define PACKET_HAS_MASTER 1
349 #define PACKET_HAS_SLAVE 0
351 #define AO_LED_GREEN 1
352 #define AO_MONITOR_LED AO_LED_RED
353 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
354 #define SPI_CS_ON_P1 1
355 #define SPI_CS_ON_P0 0
357 #define HAS_IGNITE_REPORT 1
358 #define BT_LINK_ON_P2 1
359 #define BT_LINK_ON_P1 0
360 #define BT_LINK_PIN_INDEX 7
361 #define BT_LINK_PIN P2_1
362 #define HAS_MONITOR 1
363 #define LEGACY_MONITOR 1
366 #define HAS_TELEMETRY 0
367 #define AO_RADIO_REG_TEST 1
370 #if defined(TELEBT_V_0_1)
371 /* Discontinued and was never built with CC1111 chips needing this */
372 #define NEEDS_CC1111_CLOCK_HACK 0
376 #define HAS_BEEP_CONFIG 0
377 #define HAS_SERIAL_1 1
378 #define HAS_SERIAL_1_ALT_1 1
379 #define HAS_SERIAL_1_ALT_2 0
380 #define HAS_SERIAL_1_HW_FLOW 1
381 #define USE_SERIAL_1_STDIN 1
382 #define DELAY_SERIAL_1_STDIN 1
387 #define USE_INTERNAL_FLASH 0
391 #define IGNITE_ON_P2 0
392 #define IGNITE_ON_P0 0
393 #define PACKET_HAS_MASTER 1
394 #define PACKET_HAS_SLAVE 0
396 #define AO_LED_GREEN 2
397 #define AO_MONITOR_LED AO_LED_RED
398 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
399 #define SPI_CS_ON_P1 1
400 #define SPI_CS_ON_P0 0
401 #define AO_M25_SPI_CS_MASK 0x04 /* CS0 is P1_2 */
402 #define M25_MAX_CHIPS 1
405 #define HAS_IGNITE_REPORT 1
406 #define BT_LINK_ON_P2 0
407 #define BT_LINK_ON_P1 1
408 #define BT_LINK_PIN_INDEX 7
409 #define BT_LINK_PIN P1_7
410 #define HAS_MONITOR 1
411 #define LEGACY_MONITOR 1
414 #define HAS_TELEMETRY 0
415 #define AO_RADIO_REG_TEST 1
418 #if defined(TELELAUNCH_V_0_1)
419 /* Discontinued and was never built with CC1111 chips needing this */
420 #define NEEDS_CC1111_CLOCK_HACK 0
425 #define HAS_SERIAL_1 1
430 #define USE_INTERNAL_FLASH 1
433 #define IGNITE_ON_P2 1
434 #define IGNITE_ON_P0 0
435 #define PACKET_HAS_MASTER 0
436 #define PACKET_HAS_SLAVE 0
438 #define AO_LED_GREEN 1
439 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
440 #define HAS_EXTERNAL_TEMP 1
441 #define HAS_ACCEL_REF 0
442 #define SPI_CS_ON_P1 1
443 #define SPI_CS_ON_P0 0
446 #define HAS_MONITOR 0
448 #define HAS_TELEMETRY 0
453 #define DBG_CLOCK (1 << 4) /* mi0 */
454 #define DBG_DATA (1 << 5) /* mo0 */
455 #define DBG_RESET_N (1 << 3) /* c0 */
457 #define DBG_CLOCK_PIN (P1_4)
458 #define DBG_DATA_PIN (P1_5)
459 #define DBG_RESET_N_PIN (P1_3)
461 #define DBG_PORT_NUM 1
463 #define DBG_PORT_SEL P1SEL
464 #define DBG_PORT_INP P1INP
465 #define DBG_PORT_DIR P1DIR
467 #endif /* DBG_ON_P1 */
471 #define DBG_CLOCK (1 << 3)
472 #define DBG_DATA (1 << 4)
473 #define DBG_RESET_N (1 << 5)
475 #define DBG_CLOCK_PIN (P0_3)
476 #define DBG_DATA_PIN (P0_4)
477 #define DBG_RESET_N_PIN (P0_5)
479 #define DBG_PORT_NUM 0
481 #define DBG_PORT_SEL P0SEL
482 #define DBG_PORT_INP P0INP
483 #define DBG_PORT_DIR P0DIR
485 #endif /* DBG_ON_P0 */
487 #if COMPANION_CS_ON_P1
488 #define COMPANION_CS_PORT P1
489 #define COMPANION_CS_SEL P1SEL
490 #define COMPANION_CS_DIR P1DIR
494 #define SPI_CS_PORT P1
495 #define SPI_CS_SEL P1SEL
496 #define SPI_CS_DIR P1DIR
500 #define SPI_CS_PORT P0
501 #define SPI_CS_SEL P0SEL
502 #define SPI_CS_DIR P0DIR
505 #define AO_M25_SPI_CS_PORT SPI_CS_PORT
508 #error Please define IGNITE_ON_P2
512 #error Please define IGNITE_ON_P0
516 #error Please define HAS_ADC
520 #error Please define HAS_EEPROM
524 #error Please define HAS_LOG
528 #ifndef USE_INTERNAL_FLASH
529 #error Please define USE_INTERNAL_FLASH
534 #error Please define HAS_DBG
538 #error Please define HAS_IGNITE
542 #define HAS_IGNITE_REPORT 1
545 #ifndef PACKET_HAS_MASTER
546 #error Please define PACKET_HAS_MASTER
549 #ifndef PACKET_HAS_SLAVE
550 #error Please define PACKET_HAS_SLAVE
554 #error Please define HAS_MONITOR
559 #error Please define HAS_RSSI
564 #error Please define HAS_ADC
570 #ifndef HAS_ACCEL_REF
571 #error Please define HAS_ACCEL_REF
574 #define HAS_ACCEL_REF 0
580 #define AO_IGNITER_PORT P2
581 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
582 #define AO_IGNITER_DROGUE P2_3
583 #define AO_IGNITER_MAIN P2_4
584 #define AO_IGNITER_DIR P2DIR
585 #define AO_IGNITER_DROGUE_BIT (1 << 3)
586 #define AO_IGNITER_MAIN_BIT (1 << 4)
587 #define AO_IGNITER_DROGUE_PIN 3
588 #define AO_IGNITER_MAIN_PIN 4
592 #define AO_IGNITER_PORT P0
593 #define AO_IGNITER_DROGUE P0_5
594 #define AO_IGNITER_MAIN P0_4
595 #define AO_IGNITER_DIR P0DIR
596 #define AO_IGNITER_DROGUE_BIT (1 << 5)
597 #define AO_IGNITER_MAIN_BIT (1 << 4)
598 #define AO_IGNITER_DROGUE_PIN 5
599 #define AO_IGNITER_MAIN_PIN 4
602 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
603 #define AO_IGNITER_MAIN_PORT AO_IGNITER_PORT
605 /* test these values with real igniters */
606 #define AO_IGNITER_OPEN 1000
607 #define AO_IGNITER_CLOSED 7000
608 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
609 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
612 int16_t accel; /* accelerometer */
613 int16_t pres; /* pressure sensor */
614 int16_t temp; /* temperature sensor */
615 int16_t v_batt; /* battery voltage */
616 int16_t sense_d; /* drogue continuity sense */
617 int16_t sense_m; /* main continuity sense */
619 uint16_t accel_ref; /* acceleration reference */
624 * Voltage divider on ADC battery sampler
626 #define AO_BATTERY_DIV_PLUS 5 /* 5k */
627 #define AO_BATTERY_DIV_MINUS 10 /* 10k */
630 * Voltage divider on ADC igniter samplers
632 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
633 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
636 * ADC reference in decivolts
638 #define AO_ADC_REFERENCE_DV 33
640 #endif /* _AO_PINS_H_ */