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.
23 #if defined(TELEMETRUM_V_1_0)
24 /* Discontinued and was never built with CC1111 chips needing this */
25 #define NEEDS_CC1111_CLOCK_HACK 0
29 #define HAS_BEEP_CONFIG 0
31 #define HAS_SERIAL_1 1
35 #define USE_INTERNAL_FLASH 0
39 #define IGNITE_ON_P2 1
40 #define IGNITE_ON_P0 0
41 #define PACKET_HAS_MASTER 0
42 #define PACKET_HAS_SLAVE 1
45 #define HAS_COMPANION 1
46 #define COMPANION_CS_ON_P1 1
47 #define AO_COMPANION_CS_PORT P1
48 #define AO_COMPANION_CS_PIN 2
49 #define AO_COMPANION_CS P1_2
52 #define LEDS_AVAILABLE (AO_LED_RED)
53 #define HAS_EXTERNAL_TEMP 0
54 #define HAS_ACCEL_REF 0
60 #if defined(TELEMETRUM_V_1_1)
61 /* Discontinued and was never built with CC1111 chips needing this */
62 #define NEEDS_CC1111_CLOCK_HACK 0
66 #define HAS_BEEP_CONFIG 0
67 #define HAS_BATTERY_REPORT 1
69 #define HAS_SERIAL_1 1
73 #define USE_INTERNAL_FLASH 0
77 #define IGNITE_ON_P2 1
78 #define IGNITE_ON_P0 0
79 #define PACKET_HAS_MASTER 0
80 #define PACKET_HAS_SLAVE 1
82 #define HAS_COMPANION 1
83 #define AO_COMPANION_CS_PORT P1
84 #define AO_COMPANION_CS_PIN 2
85 #define AO_COMPANION_CS P1_2
88 #define LEDS_AVAILABLE (AO_LED_RED)
89 #define HAS_EXTERNAL_TEMP 0
90 #define HAS_ACCEL_REF 1
91 #define SPI_CS_ON_P1 1
92 #define SPI_CS_ON_P0 0
93 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
94 #define M25_MAX_CHIPS 1
100 #if defined(TELEMETRUM_V_1_2)
101 /* Discontinued and was never built with CC1111 chips needing this */
102 #define NEEDS_CC1111_CLOCK_HACK 0
106 #define HAS_BEEP_CONFIG 0
107 #define HAS_BATTERY_REPORT 1
109 #define HAS_SERIAL_1 1
113 #define USE_INTERNAL_FLASH 0
117 #define IGNITE_ON_P2 1
118 #define IGNITE_ON_P0 0
119 #define PACKET_HAS_MASTER 0
120 #define PACKET_HAS_SLAVE 1
122 #define HAS_COMPANION 1
123 #define AO_COMPANION_CS_PORT P1
124 #define AO_COMPANION_CS_PIN 2
125 #define AO_COMPANION_CS P1_2
128 #define LEDS_AVAILABLE (AO_LED_RED)
129 #define HAS_EXTERNAL_TEMP 0
130 #define HAS_ACCEL_REF 1
131 #define SPI_CS_ON_P1 1
132 #define SPI_CS_ON_P0 0
133 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
134 #define M25_MAX_CHIPS 1
137 #define HAS_MONITOR 0
140 #if defined(TELEDONGLE_V_0_2)
144 #define HAS_SERIAL_1 0
151 #define IGNITE_ON_P2 0
152 #define IGNITE_ON_P0 0
153 #define PACKET_HAS_MASTER 1
154 #define PACKET_HAS_SLAVE 0
156 #define AO_LED_GREEN 2
157 #define AO_MONITOR_LED AO_LED_GREEN
158 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
159 #define SPI_CS_ON_P1 1
160 #define SPI_CS_ON_P0 0
162 #define HAS_MONITOR 1
163 #define LEGACY_MONITOR 1
168 #if defined(TELEMINI_V_1_0)
169 /* Discontinued and was never built with CC1111 chips needing this */
170 #define NEEDS_CC1111_CLOCK_HACK 0
175 #define HAS_SERIAL_1 0
179 #define HAS_FORCE_FREQ 1
180 #define USE_INTERNAL_FLASH 1
182 #define IGNITE_ON_P2 0
183 #define IGNITE_ON_P0 1
184 #define PACKET_HAS_MASTER 0
185 #define PACKET_HAS_SLAVE 1
186 #define USE_FAST_ASCENT_LOG 1
188 #define AO_LED_GREEN 1
190 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
191 #define HAS_EXTERNAL_TEMP 0
194 #define HAS_MONITOR 0
197 #if defined(TELENANO_V_0_1)
198 /* Discontinued and was never built with CC1111 chips needing this */
199 #define NEEDS_CC1111_CLOCK_HACK 0
204 #define HAS_SERIAL_1 0
208 #define USE_INTERNAL_FLASH 1
210 #define IGNITE_ON_P2 0
211 #define IGNITE_ON_P0 1
212 #define PACKET_HAS_MASTER 0
213 #define PACKET_HAS_SLAVE 1
215 #define AO_LED_GREEN 1
217 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
218 #define HAS_EXTERNAL_TEMP 0
221 #define HAS_MONITOR 0
224 #if defined(TELEMETRUM_V_0_1)
225 /* Discontinued and was never built with CC1111 chips needing this */
226 #define NEEDS_CC1111_CLOCK_HACK 0
230 #define HAS_BEEP_CONFIG 0
232 #define HAS_SERIAL_1 1
237 #define USE_INTERNAL_FLASH 0
240 #define IGNITE_ON_P2 1
241 #define IGNITE_ON_P0 0
242 #define PACKET_HAS_MASTER 0
243 #define PACKET_HAS_SLAVE 1
245 #define AO_LED_GREEN 1
246 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
247 #define HAS_EXTERNAL_TEMP 1
248 #define HAS_ACCEL_REF 0
249 #define SPI_CS_ON_P1 1
250 #define SPI_CS_ON_P0 0
253 #define HAS_MONITOR 0
254 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
257 #if defined(TELEDONGLE_V_0_1)
258 /* Discontinued and was never built with CC1111 chips needing this */
259 #define NEEDS_CC1111_CLOCK_HACK 0
263 #define HAS_SERIAL_1 0
270 #define IGNITE_ON_P2 0
271 #define IGNITE_ON_P0 0
272 #define PACKET_HAS_MASTER 1
273 #define PACKET_HAS_SLAVE 0
275 #define AO_LED_GREEN 1
276 #define AO_MONITOR_LED AO_LED_GREEN
277 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
278 #define SPI_CS_ON_P1 0
279 #define SPI_CS_ON_P0 1
281 #define HAS_MONITOR 1
282 #define LEGACY_MONITOR 1
287 #if defined(TIDONGLE)
288 /* Discontinued and was never built with CC1111 chips needing this */
289 #define NEEDS_CC1111_CLOCK_HACK 0
293 #define HAS_SERIAL_1 0
300 #define IGNITE_ON_P2 0
301 #define IGNITE_ON_P0 0
302 #define PACKET_HAS_MASTER 1
303 #define PACKET_HAS_SLAVE 0
305 #define AO_MONITOR_LED AO_LED_RED
306 #define LEDS_AVAILABLE (AO_LED_RED)
307 #define SPI_CS_ON_P1 0
308 #define SPI_CS_ON_P0 1
310 #define HAS_MONITOR 1
311 #define LEGACY_MONITOR 1
316 #if defined(TELEBT_V_0_0)
317 /* Discontinued and was never built with CC1111 chips needing this */
318 #define NEEDS_CC1111_CLOCK_HACK 0
322 #define HAS_SERIAL_1 1
323 #define USE_SERIAL_1_STDIN 1
324 #define DELAY_SERIAL_1_STDIN 1
332 #define IGNITE_ON_P2 0
333 #define IGNITE_ON_P0 0
334 #define PACKET_HAS_MASTER 1
335 #define PACKET_HAS_SLAVE 0
337 #define AO_LED_GREEN 1
338 #define AO_MONITOR_LED AO_LED_RED
339 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
340 #define SPI_CS_ON_P1 1
341 #define SPI_CS_ON_P0 0
343 #define HAS_IGNITE_REPORT 1
344 #define BT_LINK_ON_P2 1
345 #define BT_LINK_ON_P1 0
346 #define BT_LINK_PIN_INDEX 7
347 #define BT_LINK_PIN P2_1
348 #define HAS_MONITOR 1
349 #define LEGACY_MONITOR 1
354 #if defined(TELEBT_V_0_1)
355 /* Discontinued and was never built with CC1111 chips needing this */
356 #define NEEDS_CC1111_CLOCK_HACK 0
360 #define HAS_BEEP_CONFIG 0
361 #define HAS_SERIAL_1 1
362 #define HAS_SERIAL_1_ALT_1 1
363 #define HAS_SERIAL_1_ALT_2 0
364 #define HAS_SERIAL_1_HW_FLOW 1
365 #define USE_SERIAL_1_STDIN 1
366 #define DELAY_SERIAL_1_STDIN 1
371 #define USE_INTERNAL_FLASH 0
375 #define IGNITE_ON_P2 0
376 #define IGNITE_ON_P0 0
377 #define PACKET_HAS_MASTER 1
378 #define PACKET_HAS_SLAVE 0
380 #define AO_LED_GREEN 2
381 #define AO_MONITOR_LED AO_LED_RED
382 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
383 #define SPI_CS_ON_P1 1
384 #define SPI_CS_ON_P0 0
385 #define AO_M25_SPI_CS_MASK 0x04 /* CS0 is P1_2 */
386 #define M25_MAX_CHIPS 1
389 #define HAS_IGNITE_REPORT 1
390 #define BT_LINK_ON_P2 0
391 #define BT_LINK_ON_P1 1
392 #define BT_LINK_PIN_INDEX 7
393 #define BT_LINK_PIN P1_7
394 #define HAS_MONITOR 1
395 #define LEGACY_MONITOR 1
400 #if defined(TELELAUNCH_V_0_1)
401 /* Discontinued and was never built with CC1111 chips needing this */
402 #define NEEDS_CC1111_CLOCK_HACK 0
407 #define HAS_SERIAL_1 1
412 #define USE_INTERNAL_FLASH 1
415 #define IGNITE_ON_P2 1
416 #define IGNITE_ON_P0 0
417 #define PACKET_HAS_MASTER 0
418 #define PACKET_HAS_SLAVE 0
420 #define AO_LED_GREEN 1
421 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
422 #define HAS_EXTERNAL_TEMP 1
423 #define HAS_ACCEL_REF 0
424 #define SPI_CS_ON_P1 1
425 #define SPI_CS_ON_P0 0
428 #define HAS_MONITOR 0
434 #define DBG_CLOCK (1 << 4) /* mi0 */
435 #define DBG_DATA (1 << 5) /* mo0 */
436 #define DBG_RESET_N (1 << 3) /* c0 */
438 #define DBG_CLOCK_PIN (P1_4)
439 #define DBG_DATA_PIN (P1_5)
440 #define DBG_RESET_N_PIN (P1_3)
442 #define DBG_PORT_NUM 1
444 #define DBG_PORT_SEL P1SEL
445 #define DBG_PORT_INP P1INP
446 #define DBG_PORT_DIR P1DIR
448 #endif /* DBG_ON_P1 */
452 #define DBG_CLOCK (1 << 3)
453 #define DBG_DATA (1 << 4)
454 #define DBG_RESET_N (1 << 5)
456 #define DBG_CLOCK_PIN (P0_3)
457 #define DBG_DATA_PIN (P0_4)
458 #define DBG_RESET_N_PIN (P0_5)
460 #define DBG_PORT_NUM 0
462 #define DBG_PORT_SEL P0SEL
463 #define DBG_PORT_INP P0INP
464 #define DBG_PORT_DIR P0DIR
466 #endif /* DBG_ON_P0 */
468 #if COMPANION_CS_ON_P1
469 #define COMPANION_CS_PORT P1
470 #define COMPANION_CS_SEL P1SEL
471 #define COMPANION_CS_DIR P1DIR
475 #define SPI_CS_PORT P1
476 #define SPI_CS_SEL P1SEL
477 #define SPI_CS_DIR P1DIR
481 #define SPI_CS_PORT P0
482 #define SPI_CS_SEL P0SEL
483 #define SPI_CS_DIR P0DIR
486 #define AO_M25_SPI_CS_PORT SPI_CS_PORT
489 #error Please define IGNITE_ON_P2
493 #error Please define IGNITE_ON_P0
497 #error Please define HAS_ADC
501 #error Please define HAS_EEPROM
505 #error Please define HAS_LOG
509 #ifndef USE_INTERNAL_FLASH
510 #error Please define USE_INTERNAL_FLASH
515 #error Please define HAS_DBG
519 #error Please define HAS_IGNITE
523 #define HAS_IGNITE_REPORT 1
526 #ifndef PACKET_HAS_MASTER
527 #error Please define PACKET_HAS_MASTER
530 #ifndef PACKET_HAS_SLAVE
531 #error Please define PACKET_HAS_SLAVE
535 #error Please define HAS_MONITOR
540 #error Please define HAS_RSSI
545 #error Please define HAS_ADC
551 #ifndef HAS_ACCEL_REF
552 #error Please define HAS_ACCEL_REF
555 #define HAS_ACCEL_REF 0
561 #define AO_IGNITER_PORT P2
562 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
563 #define AO_IGNITER_DROGUE P2_3
564 #define AO_IGNITER_MAIN P2_4
565 #define AO_IGNITER_DIR P2DIR
566 #define AO_IGNITER_DROGUE_BIT (1 << 3)
567 #define AO_IGNITER_MAIN_BIT (1 << 4)
568 #define AO_IGNITER_DROGUE_PIN 3
569 #define AO_IGNITER_MAIN_PIN 4
573 #define AO_IGNITER_PORT P0
574 #define AO_IGNITER_DROGUE P0_5
575 #define AO_IGNITER_MAIN P0_4
576 #define AO_IGNITER_DIR P0DIR
577 #define AO_IGNITER_DROGUE_BIT (1 << 5)
578 #define AO_IGNITER_MAIN_BIT (1 << 4)
579 #define AO_IGNITER_DROGUE_PIN 5
580 #define AO_IGNITER_MAIN_PIN 4
583 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
584 #define AO_IGNITER_MAIN_PORT AO_IGNITER_PORT
586 /* test these values with real igniters */
587 #define AO_IGNITER_OPEN 1000
588 #define AO_IGNITER_CLOSED 7000
589 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
590 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
593 int16_t accel; /* accelerometer */
594 int16_t pres; /* pressure sensor */
595 int16_t temp; /* temperature sensor */
596 int16_t v_batt; /* battery voltage */
597 int16_t sense_d; /* drogue continuity sense */
598 int16_t sense_m; /* main continuity sense */
600 uint16_t accel_ref; /* acceleration reference */
605 * Voltage divider on ADC battery sampler
607 #define AO_BATTERY_DIV_PLUS 5 /* 5k */
608 #define AO_BATTERY_DIV_MINUS 10 /* 10k */
611 * Voltage divider on ADC igniter samplers
613 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
614 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
617 * ADC reference in decivolts
619 #define AO_ADC_REFERENCE_DV 33
621 #endif /* _AO_PINS_H_ */