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
60 #define HAS_RADIO_RATE 0 /* not enough space for this */
63 #if defined(TELEMETRUM_V_1_1)
64 /* Discontinued and was never built with CC1111 chips needing this */
65 #define NEEDS_CC1111_CLOCK_HACK 0
69 #define HAS_BEEP_CONFIG 0
70 #define HAS_BATTERY_REPORT 1
72 #define HAS_SERIAL_1 1
76 #define USE_INTERNAL_FLASH 0
80 #define IGNITE_ON_P2 1
81 #define IGNITE_ON_P0 0
82 #define PACKET_HAS_MASTER 0
83 #define PACKET_HAS_SLAVE 1
85 #define HAS_COMPANION 1
86 #define AO_COMPANION_CS_PORT P1
87 #define AO_COMPANION_CS_PIN 2
88 #define AO_COMPANION_CS P1_2
91 #define LEDS_AVAILABLE (AO_LED_RED)
92 #define HAS_EXTERNAL_TEMP 0
93 #define HAS_ACCEL_REF 1
94 #define SPI_CS_ON_P1 1
95 #define SPI_CS_ON_P0 0
96 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
97 #define M25_MAX_CHIPS 1
100 #define HAS_MONITOR 0
101 #define HAS_TELEMETRY 1
102 #define HAS_RADIO_RATE 0 /* not enough space for this */
105 #if defined(TELEMETRUM_V_1_2)
106 /* Discontinued and was never built with CC1111 chips needing this */
107 #define NEEDS_CC1111_CLOCK_HACK 0
111 #define HAS_BEEP_CONFIG 0
112 #define HAS_BATTERY_REPORT 1
114 #define HAS_SERIAL_1 1
118 #define USE_INTERNAL_FLASH 0
122 #define IGNITE_ON_P2 1
123 #define IGNITE_ON_P0 0
124 #define PACKET_HAS_MASTER 0
125 #define PACKET_HAS_SLAVE 1
127 #define HAS_COMPANION 1
128 #define AO_COMPANION_CS_PORT P1
129 #define AO_COMPANION_CS_PIN 2
130 #define AO_COMPANION_CS P1_2
133 #define LEDS_AVAILABLE (AO_LED_RED)
134 #define HAS_EXTERNAL_TEMP 0
135 #define HAS_ACCEL_REF 1
136 #define SPI_CS_ON_P1 1
137 #define SPI_CS_ON_P0 0
138 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
139 #define M25_MAX_CHIPS 1
142 #define HAS_MONITOR 0
143 #define HAS_TELEMETRY 1
144 #define HAS_RADIO_RATE 0 /* not enough space for this */
147 #if defined(TELEDONGLE_V_0_2)
151 #define HAS_SERIAL_1 0
158 #define IGNITE_ON_P2 0
159 #define IGNITE_ON_P0 0
160 #define PACKET_HAS_MASTER 1
161 #define PACKET_HAS_SLAVE 0
163 #define AO_LED_GREEN 2
164 #define AO_MONITOR_LED AO_LED_GREEN
165 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
166 #define SPI_CS_ON_P1 1
167 #define SPI_CS_ON_P0 0
169 #define HAS_MONITOR 1
170 #define LEGACY_MONITOR 1
173 #define HAS_TELEMETRY 0
174 #define AO_RADIO_REG_TEST 1
177 #if defined(TELEMINI_V_1_0)
178 /* Discontinued and was never built with CC1111 chips needing this */
179 #define NEEDS_CC1111_CLOCK_HACK 0
184 #define HAS_SERIAL_1 0
188 #define HAS_FORCE_FREQ 1
189 #define USE_INTERNAL_FLASH 1
191 #define IGNITE_ON_P2 0
192 #define IGNITE_ON_P0 1
193 #define PACKET_HAS_MASTER 0
194 #define PACKET_HAS_SLAVE 1
195 #define USE_FAST_ASCENT_LOG 1
197 #define AO_LED_GREEN 1
199 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
200 #define HAS_EXTERNAL_TEMP 0
203 #define HAS_MONITOR 0
204 #define HAS_TELEMETRY 1
205 #define HAS_RADIO_RATE 0 /* not enough space for this */
208 #if defined(TELENANO_V_0_1)
209 /* Discontinued and was never built with CC1111 chips needing this */
210 #define NEEDS_CC1111_CLOCK_HACK 0
215 #define HAS_SERIAL_1 0
219 #define USE_INTERNAL_FLASH 1
221 #define IGNITE_ON_P2 0
222 #define IGNITE_ON_P0 1
223 #define PACKET_HAS_MASTER 0
224 #define PACKET_HAS_SLAVE 1
226 #define AO_LED_GREEN 1
228 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
229 #define HAS_EXTERNAL_TEMP 0
232 #define HAS_MONITOR 0
233 #define HAS_TELEMETRY 1
234 #define HAS_RADIO_RATE 0 /* not enough space for this */
237 #if defined(TELEMETRUM_V_0_1)
238 /* Discontinued and was never built with CC1111 chips needing this */
239 #define NEEDS_CC1111_CLOCK_HACK 0
243 #define HAS_BEEP_CONFIG 0
245 #define HAS_SERIAL_1 1
250 #define USE_INTERNAL_FLASH 0
253 #define IGNITE_ON_P2 1
254 #define IGNITE_ON_P0 0
255 #define PACKET_HAS_MASTER 0
256 #define PACKET_HAS_SLAVE 1
258 #define AO_LED_GREEN 1
259 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
260 #define HAS_EXTERNAL_TEMP 1
261 #define HAS_ACCEL_REF 0
262 #define SPI_CS_ON_P1 1
263 #define SPI_CS_ON_P0 0
266 #define HAS_MONITOR 0
267 #define HAS_TELEMETRY 1
268 #define HAS_RADIO_RATE 0 /* not enough space for this */
269 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
272 #if defined(TELEDONGLE_V_0_1)
273 /* Discontinued and was never built with CC1111 chips needing this */
274 #define NEEDS_CC1111_CLOCK_HACK 0
278 #define HAS_SERIAL_1 0
285 #define IGNITE_ON_P2 0
286 #define IGNITE_ON_P0 0
287 #define PACKET_HAS_MASTER 1
288 #define PACKET_HAS_SLAVE 0
290 #define AO_LED_GREEN 1
291 #define AO_MONITOR_LED AO_LED_GREEN
292 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
293 #define SPI_CS_ON_P1 0
294 #define SPI_CS_ON_P0 1
296 #define HAS_MONITOR 1
297 #define LEGACY_MONITOR 1
300 #define HAS_TELEMETRY 0
303 #if defined(TIDONGLE)
304 /* Discontinued and was never built with CC1111 chips needing this */
305 #define NEEDS_CC1111_CLOCK_HACK 0
309 #define HAS_SERIAL_1 0
316 #define IGNITE_ON_P2 0
317 #define IGNITE_ON_P0 0
318 #define PACKET_HAS_MASTER 1
319 #define PACKET_HAS_SLAVE 0
321 #define AO_MONITOR_LED AO_LED_RED
322 #define LEDS_AVAILABLE (AO_LED_RED)
323 #define SPI_CS_ON_P1 0
324 #define SPI_CS_ON_P0 1
326 #define HAS_MONITOR 1
327 #define LEGACY_MONITOR 1
330 #define HAS_TELEMETRY 0
333 #if defined(TELEBT_V_0_0)
334 /* Discontinued and was never built with CC1111 chips needing this */
335 #define NEEDS_CC1111_CLOCK_HACK 0
339 #define HAS_SERIAL_1 1
340 #define USE_SERIAL_1_STDIN 1
341 #define DELAY_SERIAL_1_STDIN 1
349 #define IGNITE_ON_P2 0
350 #define IGNITE_ON_P0 0
351 #define PACKET_HAS_MASTER 1
352 #define PACKET_HAS_SLAVE 0
354 #define AO_LED_GREEN 1
355 #define AO_MONITOR_LED AO_LED_RED
356 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
357 #define SPI_CS_ON_P1 1
358 #define SPI_CS_ON_P0 0
360 #define HAS_IGNITE_REPORT 1
361 #define BT_LINK_ON_P2 1
362 #define BT_LINK_ON_P1 0
363 #define BT_LINK_PIN_INDEX 7
364 #define BT_LINK_PIN P2_1
365 #define HAS_MONITOR 1
366 #define LEGACY_MONITOR 1
369 #define HAS_TELEMETRY 0
370 #define AO_RADIO_REG_TEST 1
373 #if defined(TELEBT_V_0_1)
374 /* Discontinued and was never built with CC1111 chips needing this */
375 #define NEEDS_CC1111_CLOCK_HACK 0
379 #define HAS_BEEP_CONFIG 0
380 #define HAS_SERIAL_1 1
381 #define HAS_SERIAL_1_ALT_1 1
382 #define HAS_SERIAL_1_ALT_2 0
383 #define HAS_SERIAL_1_HW_FLOW 1
384 #define USE_SERIAL_1_STDIN 1
385 #define DELAY_SERIAL_1_STDIN 1
390 #define USE_INTERNAL_FLASH 0
394 #define IGNITE_ON_P2 0
395 #define IGNITE_ON_P0 0
396 #define PACKET_HAS_MASTER 1
397 #define PACKET_HAS_SLAVE 0
399 #define AO_LED_GREEN 2
400 #define AO_MONITOR_LED AO_LED_RED
401 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
402 #define SPI_CS_ON_P1 1
403 #define SPI_CS_ON_P0 0
404 #define AO_M25_SPI_CS_MASK 0x04 /* CS0 is P1_2 */
405 #define M25_MAX_CHIPS 1
408 #define HAS_IGNITE_REPORT 1
409 #define BT_LINK_ON_P2 0
410 #define BT_LINK_ON_P1 1
411 #define BT_LINK_PIN_INDEX 7
412 #define BT_LINK_PIN P1_7
413 #define HAS_MONITOR 1
414 #define LEGACY_MONITOR 1
417 #define HAS_TELEMETRY 0
418 #define AO_RADIO_REG_TEST 1
421 #if defined(TELELAUNCH_V_0_1)
422 /* Discontinued and was never built with CC1111 chips needing this */
423 #define NEEDS_CC1111_CLOCK_HACK 0
428 #define HAS_SERIAL_1 1
433 #define USE_INTERNAL_FLASH 1
436 #define IGNITE_ON_P2 1
437 #define IGNITE_ON_P0 0
438 #define PACKET_HAS_MASTER 0
439 #define PACKET_HAS_SLAVE 0
441 #define AO_LED_GREEN 1
442 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
443 #define HAS_EXTERNAL_TEMP 1
444 #define HAS_ACCEL_REF 0
445 #define SPI_CS_ON_P1 1
446 #define SPI_CS_ON_P0 0
449 #define HAS_MONITOR 0
451 #define HAS_TELEMETRY 0
456 #define DBG_CLOCK (1 << 4) /* mi0 */
457 #define DBG_DATA (1 << 5) /* mo0 */
458 #define DBG_RESET_N (1 << 3) /* c0 */
460 #define DBG_CLOCK_PIN (P1_4)
461 #define DBG_DATA_PIN (P1_5)
462 #define DBG_RESET_N_PIN (P1_3)
464 #define DBG_PORT_NUM 1
466 #define DBG_PORT_SEL P1SEL
467 #define DBG_PORT_INP P1INP
468 #define DBG_PORT_DIR P1DIR
470 #endif /* DBG_ON_P1 */
474 #define DBG_CLOCK (1 << 3)
475 #define DBG_DATA (1 << 4)
476 #define DBG_RESET_N (1 << 5)
478 #define DBG_CLOCK_PIN (P0_3)
479 #define DBG_DATA_PIN (P0_4)
480 #define DBG_RESET_N_PIN (P0_5)
482 #define DBG_PORT_NUM 0
484 #define DBG_PORT_SEL P0SEL
485 #define DBG_PORT_INP P0INP
486 #define DBG_PORT_DIR P0DIR
488 #endif /* DBG_ON_P0 */
490 #if COMPANION_CS_ON_P1
491 #define COMPANION_CS_PORT P1
492 #define COMPANION_CS_SEL P1SEL
493 #define COMPANION_CS_DIR P1DIR
497 #define SPI_CS_PORT P1
498 #define SPI_CS_SEL P1SEL
499 #define SPI_CS_DIR P1DIR
503 #define SPI_CS_PORT P0
504 #define SPI_CS_SEL P0SEL
505 #define SPI_CS_DIR P0DIR
508 #define AO_M25_SPI_CS_PORT SPI_CS_PORT
511 #error Please define IGNITE_ON_P2
515 #error Please define IGNITE_ON_P0
519 #error Please define HAS_ADC
523 #error Please define HAS_EEPROM
527 #error Please define HAS_LOG
531 #ifndef USE_INTERNAL_FLASH
532 #error Please define USE_INTERNAL_FLASH
537 #error Please define HAS_DBG
541 #error Please define HAS_IGNITE
545 #define HAS_IGNITE_REPORT 1
548 #ifndef PACKET_HAS_MASTER
549 #error Please define PACKET_HAS_MASTER
552 #ifndef PACKET_HAS_SLAVE
553 #error Please define PACKET_HAS_SLAVE
557 #error Please define HAS_MONITOR
562 #error Please define HAS_RSSI
567 #error Please define HAS_ADC
573 #ifndef HAS_ACCEL_REF
574 #error Please define HAS_ACCEL_REF
577 #define HAS_ACCEL_REF 0
583 #define AO_IGNITER_PORT P2
584 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
585 #define AO_IGNITER_DROGUE P2_3
586 #define AO_IGNITER_MAIN P2_4
587 #define AO_IGNITER_DIR P2DIR
588 #define AO_IGNITER_DROGUE_BIT (1 << 3)
589 #define AO_IGNITER_MAIN_BIT (1 << 4)
590 #define AO_IGNITER_DROGUE_PIN 3
591 #define AO_IGNITER_MAIN_PIN 4
595 #define AO_IGNITER_PORT P0
596 #define AO_IGNITER_DROGUE P0_5
597 #define AO_IGNITER_MAIN P0_4
598 #define AO_IGNITER_DIR P0DIR
599 #define AO_IGNITER_DROGUE_BIT (1 << 5)
600 #define AO_IGNITER_MAIN_BIT (1 << 4)
601 #define AO_IGNITER_DROGUE_PIN 5
602 #define AO_IGNITER_MAIN_PIN 4
605 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
606 #define AO_IGNITER_MAIN_PORT AO_IGNITER_PORT
608 /* test these values with real igniters */
609 #define AO_IGNITER_OPEN 1000
610 #define AO_IGNITER_CLOSED 7000
611 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
612 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
615 int16_t accel; /* accelerometer */
616 int16_t pres; /* pressure sensor */
617 int16_t temp; /* temperature sensor */
618 int16_t v_batt; /* battery voltage */
619 int16_t sense_d; /* drogue continuity sense */
620 int16_t sense_m; /* main continuity sense */
622 uint16_t accel_ref; /* acceleration reference */
627 * Voltage divider on ADC battery sampler
629 #define AO_BATTERY_DIV_PLUS 5 /* 5k */
630 #define AO_BATTERY_DIV_MINUS 10 /* 10k */
633 * Voltage divider on ADC igniter samplers
635 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
636 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
639 * ADC reference in decivolts
641 #define AO_ADC_REFERENCE_DV 33
643 #endif /* _AO_PINS_H_ */