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 */
61 #define HAS_MUTEX_TRY 0
64 #if defined(TELEMETRUM_V_1_1)
65 /* Discontinued and was never built with CC1111 chips needing this */
66 #define NEEDS_CC1111_CLOCK_HACK 0
70 #define HAS_BEEP_CONFIG 0
71 #define HAS_BATTERY_REPORT 1
73 #define HAS_SERIAL_1 1
77 #define USE_INTERNAL_FLASH 0
81 #define IGNITE_ON_P2 1
82 #define IGNITE_ON_P0 0
83 #define PACKET_HAS_MASTER 0
84 #define PACKET_HAS_SLAVE 1
86 #define HAS_COMPANION 1
87 #define AO_COMPANION_CS_PORT P1
88 #define AO_COMPANION_CS_PIN 2
89 #define AO_COMPANION_CS P1_2
92 #define LEDS_AVAILABLE (AO_LED_RED)
93 #define HAS_EXTERNAL_TEMP 0
94 #define HAS_ACCEL_REF 1
95 #define SPI_CS_ON_P1 1
96 #define SPI_CS_ON_P0 0
97 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
98 #define M25_MAX_CHIPS 1
101 #define HAS_MONITOR 0
102 #define HAS_TELEMETRY 1
103 #define HAS_RADIO_RATE 0 /* not enough space for this */
104 #define HAS_MUTEX_TRY 0
107 #if defined(TELEMETRUM_V_1_2)
108 /* Discontinued and was never built with CC1111 chips needing this */
109 #define NEEDS_CC1111_CLOCK_HACK 0
113 #define HAS_BEEP_CONFIG 0
114 #define HAS_BATTERY_REPORT 1
116 #define HAS_SERIAL_1 1
120 #define USE_INTERNAL_FLASH 0
124 #define IGNITE_ON_P2 1
125 #define IGNITE_ON_P0 0
126 #define PACKET_HAS_MASTER 0
127 #define PACKET_HAS_SLAVE 1
129 #define HAS_COMPANION 1
130 #define AO_COMPANION_CS_PORT P1
131 #define AO_COMPANION_CS_PIN 2
132 #define AO_COMPANION_CS P1_2
135 #define LEDS_AVAILABLE (AO_LED_RED)
136 #define HAS_EXTERNAL_TEMP 0
137 #define HAS_ACCEL_REF 1
138 #define SPI_CS_ON_P1 1
139 #define SPI_CS_ON_P0 0
140 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
141 #define M25_MAX_CHIPS 1
144 #define HAS_MONITOR 0
145 #define HAS_TELEMETRY 1
146 #define HAS_RADIO_RATE 0 /* not enough space for this */
147 #define HAS_MUTEX_TRY 0
150 #if defined(TELEDONGLE_V_0_2)
154 #define HAS_SERIAL_1 0
161 #define IGNITE_ON_P2 0
162 #define IGNITE_ON_P0 0
163 #define PACKET_HAS_MASTER 1
164 #define PACKET_HAS_SLAVE 0
166 #define AO_LED_GREEN 2
167 #define AO_MONITOR_LED AO_LED_GREEN
168 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
169 #define SPI_CS_ON_P1 1
170 #define SPI_CS_ON_P0 0
172 #define HAS_MONITOR 1
173 #define LEGACY_MONITOR 1
176 #define HAS_TELEMETRY 0
177 #define AO_RADIO_REG_TEST 1
180 #if defined(TELEMINI_V_1_0)
181 /* Discontinued and was never built with CC1111 chips needing this */
182 #define NEEDS_CC1111_CLOCK_HACK 0
187 #define HAS_SERIAL_1 0
191 #define HAS_FORCE_FREQ 1
192 #define USE_INTERNAL_FLASH 1
194 #define IGNITE_ON_P2 0
195 #define IGNITE_ON_P0 1
196 #define PACKET_HAS_MASTER 0
197 #define PACKET_HAS_SLAVE 1
198 #define USE_FAST_ASCENT_LOG 1
200 #define AO_LED_GREEN 1
202 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
203 #define HAS_EXTERNAL_TEMP 0
206 #define HAS_MONITOR 0
207 #define HAS_TELEMETRY 1
208 #define HAS_RADIO_RATE 0 /* not enough space for this */
211 #if defined(TELENANO_V_0_1)
212 /* Discontinued and was never built with CC1111 chips needing this */
213 #define NEEDS_CC1111_CLOCK_HACK 0
218 #define HAS_SERIAL_1 0
222 #define USE_INTERNAL_FLASH 1
224 #define IGNITE_ON_P2 0
225 #define IGNITE_ON_P0 1
226 #define PACKET_HAS_MASTER 0
227 #define PACKET_HAS_SLAVE 1
229 #define AO_LED_GREEN 1
231 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
232 #define HAS_EXTERNAL_TEMP 0
235 #define HAS_MONITOR 0
236 #define HAS_TELEMETRY 1
237 #define HAS_RADIO_RATE 0 /* not enough space for this */
240 #if defined(TELEMETRUM_V_0_1)
241 /* Discontinued and was never built with CC1111 chips needing this */
242 #define NEEDS_CC1111_CLOCK_HACK 0
246 #define HAS_BEEP_CONFIG 0
248 #define HAS_SERIAL_1 1
253 #define USE_INTERNAL_FLASH 0
256 #define IGNITE_ON_P2 1
257 #define IGNITE_ON_P0 0
258 #define PACKET_HAS_MASTER 0
259 #define PACKET_HAS_SLAVE 1
261 #define AO_LED_GREEN 1
262 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
263 #define HAS_EXTERNAL_TEMP 1
264 #define HAS_ACCEL_REF 0
265 #define SPI_CS_ON_P1 1
266 #define SPI_CS_ON_P0 0
269 #define HAS_MONITOR 0
270 #define HAS_TELEMETRY 1
271 #define HAS_RADIO_RATE 0 /* not enough space for this */
272 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
275 #if defined(TELEDONGLE_V_0_1)
276 /* Discontinued and was never built with CC1111 chips needing this */
277 #define NEEDS_CC1111_CLOCK_HACK 0
281 #define HAS_SERIAL_1 0
288 #define IGNITE_ON_P2 0
289 #define IGNITE_ON_P0 0
290 #define PACKET_HAS_MASTER 1
291 #define PACKET_HAS_SLAVE 0
293 #define AO_LED_GREEN 1
294 #define AO_MONITOR_LED AO_LED_GREEN
295 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
296 #define SPI_CS_ON_P1 0
297 #define SPI_CS_ON_P0 1
299 #define HAS_MONITOR 1
300 #define LEGACY_MONITOR 1
303 #define HAS_TELEMETRY 0
306 #if defined(TIDONGLE)
307 /* Discontinued and was never built with CC1111 chips needing this */
308 #define NEEDS_CC1111_CLOCK_HACK 0
312 #define HAS_SERIAL_1 0
319 #define IGNITE_ON_P2 0
320 #define IGNITE_ON_P0 0
321 #define PACKET_HAS_MASTER 1
322 #define PACKET_HAS_SLAVE 0
324 #define AO_MONITOR_LED AO_LED_RED
325 #define LEDS_AVAILABLE (AO_LED_RED)
326 #define SPI_CS_ON_P1 0
327 #define SPI_CS_ON_P0 1
329 #define HAS_MONITOR 1
330 #define LEGACY_MONITOR 1
333 #define HAS_TELEMETRY 0
336 #if defined(TELEBT_V_0_0)
337 /* Discontinued and was never built with CC1111 chips needing this */
338 #define NEEDS_CC1111_CLOCK_HACK 0
342 #define HAS_SERIAL_1 1
343 #define USE_SERIAL_1_STDIN 1
344 #define DELAY_SERIAL_1_STDIN 1
352 #define IGNITE_ON_P2 0
353 #define IGNITE_ON_P0 0
354 #define PACKET_HAS_MASTER 1
355 #define PACKET_HAS_SLAVE 0
357 #define AO_LED_GREEN 1
358 #define AO_MONITOR_LED AO_LED_RED
359 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
360 #define SPI_CS_ON_P1 1
361 #define SPI_CS_ON_P0 0
363 #define HAS_IGNITE_REPORT 1
364 #define BT_LINK_ON_P2 1
365 #define BT_LINK_ON_P1 0
366 #define BT_LINK_PIN_INDEX 7
367 #define BT_LINK_PIN P2_1
368 #define HAS_MONITOR 1
369 #define LEGACY_MONITOR 1
372 #define HAS_TELEMETRY 0
373 #define AO_RADIO_REG_TEST 1
376 #if defined(TELEBT_V_0_1)
377 /* Discontinued and was never built with CC1111 chips needing this */
378 #define NEEDS_CC1111_CLOCK_HACK 0
382 #define HAS_BEEP_CONFIG 0
383 #define HAS_SERIAL_1 1
384 #define HAS_SERIAL_1_ALT_1 1
385 #define HAS_SERIAL_1_ALT_2 0
386 #define HAS_SERIAL_1_HW_FLOW 1
387 #define USE_SERIAL_1_STDIN 1
388 #define DELAY_SERIAL_1_STDIN 1
393 #define USE_INTERNAL_FLASH 0
397 #define IGNITE_ON_P2 0
398 #define IGNITE_ON_P0 0
399 #define PACKET_HAS_MASTER 1
400 #define PACKET_HAS_SLAVE 0
402 #define AO_LED_GREEN 2
403 #define AO_MONITOR_LED AO_LED_RED
404 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
405 #define SPI_CS_ON_P1 1
406 #define SPI_CS_ON_P0 0
407 #define AO_M25_SPI_CS_MASK 0x04 /* CS0 is P1_2 */
408 #define M25_MAX_CHIPS 1
411 #define HAS_IGNITE_REPORT 1
412 #define BT_LINK_ON_P2 0
413 #define BT_LINK_ON_P1 1
414 #define BT_LINK_PIN_INDEX 7
415 #define BT_LINK_PIN P1_7
416 #define HAS_MONITOR 1
417 #define LEGACY_MONITOR 1
420 #define HAS_TELEMETRY 0
421 #define AO_RADIO_REG_TEST 1
424 #if defined(TELELAUNCH_V_0_1)
425 /* Discontinued and was never built with CC1111 chips needing this */
426 #define NEEDS_CC1111_CLOCK_HACK 0
431 #define HAS_SERIAL_1 1
436 #define USE_INTERNAL_FLASH 1
439 #define IGNITE_ON_P2 1
440 #define IGNITE_ON_P0 0
441 #define PACKET_HAS_MASTER 0
442 #define PACKET_HAS_SLAVE 0
444 #define AO_LED_GREEN 1
445 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
446 #define HAS_EXTERNAL_TEMP 1
447 #define HAS_ACCEL_REF 0
448 #define SPI_CS_ON_P1 1
449 #define SPI_CS_ON_P0 0
452 #define HAS_MONITOR 0
454 #define HAS_TELEMETRY 0
459 #define DBG_CLOCK (1 << 4) /* mi0 */
460 #define DBG_DATA (1 << 5) /* mo0 */
461 #define DBG_RESET_N (1 << 3) /* c0 */
463 #define DBG_CLOCK_PIN (P1_4)
464 #define DBG_DATA_PIN (P1_5)
465 #define DBG_RESET_N_PIN (P1_3)
467 #define DBG_PORT_NUM 1
469 #define DBG_PORT_SEL P1SEL
470 #define DBG_PORT_INP P1INP
471 #define DBG_PORT_DIR P1DIR
473 #endif /* DBG_ON_P1 */
477 #define DBG_CLOCK (1 << 3)
478 #define DBG_DATA (1 << 4)
479 #define DBG_RESET_N (1 << 5)
481 #define DBG_CLOCK_PIN (P0_3)
482 #define DBG_DATA_PIN (P0_4)
483 #define DBG_RESET_N_PIN (P0_5)
485 #define DBG_PORT_NUM 0
487 #define DBG_PORT_SEL P0SEL
488 #define DBG_PORT_INP P0INP
489 #define DBG_PORT_DIR P0DIR
491 #endif /* DBG_ON_P0 */
493 #if COMPANION_CS_ON_P1
494 #define COMPANION_CS_PORT P1
495 #define COMPANION_CS_SEL P1SEL
496 #define COMPANION_CS_DIR P1DIR
500 #define SPI_CS_PORT P1
501 #define SPI_CS_SEL P1SEL
502 #define SPI_CS_DIR P1DIR
506 #define SPI_CS_PORT P0
507 #define SPI_CS_SEL P0SEL
508 #define SPI_CS_DIR P0DIR
511 #define AO_M25_SPI_CS_PORT SPI_CS_PORT
514 #error Please define IGNITE_ON_P2
518 #error Please define IGNITE_ON_P0
522 #error Please define HAS_ADC
526 #error Please define HAS_EEPROM
530 #error Please define HAS_LOG
534 #ifndef USE_INTERNAL_FLASH
535 #error Please define USE_INTERNAL_FLASH
540 #error Please define HAS_DBG
544 #error Please define HAS_IGNITE
548 #define HAS_IGNITE_REPORT 1
551 #ifndef PACKET_HAS_MASTER
552 #error Please define PACKET_HAS_MASTER
555 #ifndef PACKET_HAS_SLAVE
556 #error Please define PACKET_HAS_SLAVE
560 #error Please define HAS_MONITOR
565 #error Please define HAS_RSSI
570 #error Please define HAS_ADC
576 #ifndef HAS_ACCEL_REF
577 #error Please define HAS_ACCEL_REF
580 #define HAS_ACCEL_REF 0
586 #define AO_IGNITER_PORT P2
587 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
588 #define AO_IGNITER_DROGUE P2_3
589 #define AO_IGNITER_MAIN P2_4
590 #define AO_IGNITER_DIR P2DIR
591 #define AO_IGNITER_DROGUE_BIT (1 << 3)
592 #define AO_IGNITER_MAIN_BIT (1 << 4)
593 #define AO_IGNITER_DROGUE_PIN 3
594 #define AO_IGNITER_MAIN_PIN 4
598 #define AO_IGNITER_PORT P0
599 #define AO_IGNITER_DROGUE P0_5
600 #define AO_IGNITER_MAIN P0_4
601 #define AO_IGNITER_DIR P0DIR
602 #define AO_IGNITER_DROGUE_BIT (1 << 5)
603 #define AO_IGNITER_MAIN_BIT (1 << 4)
604 #define AO_IGNITER_DROGUE_PIN 5
605 #define AO_IGNITER_MAIN_PIN 4
608 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
609 #define AO_IGNITER_MAIN_PORT AO_IGNITER_PORT
611 /* test these values with real igniters */
612 #define AO_IGNITER_OPEN 1000
613 #define AO_IGNITER_CLOSED 7000
614 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
615 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
618 int16_t accel; /* accelerometer */
619 int16_t pres; /* pressure sensor */
620 int16_t temp; /* temperature sensor */
621 int16_t v_batt; /* battery voltage */
622 int16_t sense_d; /* drogue continuity sense */
623 int16_t sense_m; /* main continuity sense */
625 uint16_t accel_ref; /* acceleration reference */
630 * Voltage divider on ADC battery sampler
632 #define AO_BATTERY_DIV_PLUS 5 /* 5k */
633 #define AO_BATTERY_DIV_MINUS 10 /* 10k */
636 * Voltage divider on ADC igniter samplers
638 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
639 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
642 * ADC reference in decivolts
644 #define AO_ADC_REFERENCE_DV 33
646 #endif /* _AO_PINS_H_ */