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
173 #if defined(TELEMINI_V_1_0)
174 /* Discontinued and was never built with CC1111 chips needing this */
175 #define NEEDS_CC1111_CLOCK_HACK 0
180 #define HAS_SERIAL_1 0
184 #define HAS_FORCE_FREQ 1
185 #define USE_INTERNAL_FLASH 1
187 #define IGNITE_ON_P2 0
188 #define IGNITE_ON_P0 1
189 #define PACKET_HAS_MASTER 0
190 #define PACKET_HAS_SLAVE 1
191 #define USE_FAST_ASCENT_LOG 1
193 #define AO_LED_GREEN 1
195 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
196 #define HAS_EXTERNAL_TEMP 0
199 #define HAS_MONITOR 0
200 #define HAS_TELEMETRY 1
201 #define HAS_RADIO_RATE 0 /* not enough space for this */
204 #if defined(TELENANO_V_0_1)
205 /* Discontinued and was never built with CC1111 chips needing this */
206 #define NEEDS_CC1111_CLOCK_HACK 0
211 #define HAS_SERIAL_1 0
215 #define USE_INTERNAL_FLASH 1
217 #define IGNITE_ON_P2 0
218 #define IGNITE_ON_P0 1
219 #define PACKET_HAS_MASTER 0
220 #define PACKET_HAS_SLAVE 1
222 #define AO_LED_GREEN 1
224 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
225 #define HAS_EXTERNAL_TEMP 0
228 #define HAS_MONITOR 0
229 #define HAS_TELEMETRY 1
230 #define HAS_RADIO_RATE 0 /* not enough space for this */
233 #if defined(TELEMETRUM_V_0_1)
234 /* Discontinued and was never built with CC1111 chips needing this */
235 #define NEEDS_CC1111_CLOCK_HACK 0
239 #define HAS_BEEP_CONFIG 0
241 #define HAS_SERIAL_1 1
246 #define USE_INTERNAL_FLASH 0
249 #define IGNITE_ON_P2 1
250 #define IGNITE_ON_P0 0
251 #define PACKET_HAS_MASTER 0
252 #define PACKET_HAS_SLAVE 1
254 #define AO_LED_GREEN 1
255 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
256 #define HAS_EXTERNAL_TEMP 1
257 #define HAS_ACCEL_REF 0
258 #define SPI_CS_ON_P1 1
259 #define SPI_CS_ON_P0 0
262 #define HAS_MONITOR 0
263 #define HAS_TELEMETRY 1
264 #define HAS_RADIO_RATE 0 /* not enough space for this */
265 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
268 #if defined(TELEDONGLE_V_0_1)
269 /* Discontinued and was never built with CC1111 chips needing this */
270 #define NEEDS_CC1111_CLOCK_HACK 0
274 #define HAS_SERIAL_1 0
281 #define IGNITE_ON_P2 0
282 #define IGNITE_ON_P0 0
283 #define PACKET_HAS_MASTER 1
284 #define PACKET_HAS_SLAVE 0
286 #define AO_LED_GREEN 1
287 #define AO_MONITOR_LED AO_LED_GREEN
288 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
289 #define SPI_CS_ON_P1 0
290 #define SPI_CS_ON_P0 1
292 #define HAS_MONITOR 1
293 #define LEGACY_MONITOR 1
296 #define HAS_TELEMETRY 0
299 #if defined(TIDONGLE)
300 /* Discontinued and was never built with CC1111 chips needing this */
301 #define NEEDS_CC1111_CLOCK_HACK 0
305 #define HAS_SERIAL_1 0
312 #define IGNITE_ON_P2 0
313 #define IGNITE_ON_P0 0
314 #define PACKET_HAS_MASTER 1
315 #define PACKET_HAS_SLAVE 0
317 #define AO_MONITOR_LED AO_LED_RED
318 #define LEDS_AVAILABLE (AO_LED_RED)
319 #define SPI_CS_ON_P1 0
320 #define SPI_CS_ON_P0 1
322 #define HAS_MONITOR 1
323 #define LEGACY_MONITOR 1
326 #define HAS_TELEMETRY 0
329 #if defined(TELEBT_V_0_0)
330 /* Discontinued and was never built with CC1111 chips needing this */
331 #define NEEDS_CC1111_CLOCK_HACK 0
335 #define HAS_SERIAL_1 1
336 #define USE_SERIAL_1_STDIN 1
337 #define DELAY_SERIAL_1_STDIN 1
345 #define IGNITE_ON_P2 0
346 #define IGNITE_ON_P0 0
347 #define PACKET_HAS_MASTER 1
348 #define PACKET_HAS_SLAVE 0
350 #define AO_LED_GREEN 1
351 #define AO_MONITOR_LED AO_LED_RED
352 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
353 #define SPI_CS_ON_P1 1
354 #define SPI_CS_ON_P0 0
356 #define HAS_IGNITE_REPORT 1
357 #define BT_LINK_ON_P2 1
358 #define BT_LINK_ON_P1 0
359 #define BT_LINK_PIN_INDEX 7
360 #define BT_LINK_PIN P2_1
361 #define HAS_MONITOR 1
362 #define LEGACY_MONITOR 1
365 #define HAS_TELEMETRY 0
368 #if defined(TELEBT_V_0_1)
369 /* Discontinued and was never built with CC1111 chips needing this */
370 #define NEEDS_CC1111_CLOCK_HACK 0
374 #define HAS_BEEP_CONFIG 0
375 #define HAS_SERIAL_1 1
376 #define HAS_SERIAL_1_ALT_1 1
377 #define HAS_SERIAL_1_ALT_2 0
378 #define HAS_SERIAL_1_HW_FLOW 1
379 #define USE_SERIAL_1_STDIN 1
380 #define DELAY_SERIAL_1_STDIN 1
385 #define USE_INTERNAL_FLASH 0
389 #define IGNITE_ON_P2 0
390 #define IGNITE_ON_P0 0
391 #define PACKET_HAS_MASTER 1
392 #define PACKET_HAS_SLAVE 0
394 #define AO_LED_GREEN 2
395 #define AO_MONITOR_LED AO_LED_RED
396 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
397 #define SPI_CS_ON_P1 1
398 #define SPI_CS_ON_P0 0
399 #define AO_M25_SPI_CS_MASK 0x04 /* CS0 is P1_2 */
400 #define M25_MAX_CHIPS 1
403 #define HAS_IGNITE_REPORT 1
404 #define BT_LINK_ON_P2 0
405 #define BT_LINK_ON_P1 1
406 #define BT_LINK_PIN_INDEX 7
407 #define BT_LINK_PIN P1_7
408 #define HAS_MONITOR 1
409 #define LEGACY_MONITOR 1
412 #define HAS_TELEMETRY 0
415 #if defined(TELELAUNCH_V_0_1)
416 /* Discontinued and was never built with CC1111 chips needing this */
417 #define NEEDS_CC1111_CLOCK_HACK 0
422 #define HAS_SERIAL_1 1
427 #define USE_INTERNAL_FLASH 1
430 #define IGNITE_ON_P2 1
431 #define IGNITE_ON_P0 0
432 #define PACKET_HAS_MASTER 0
433 #define PACKET_HAS_SLAVE 0
435 #define AO_LED_GREEN 1
436 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
437 #define HAS_EXTERNAL_TEMP 1
438 #define HAS_ACCEL_REF 0
439 #define SPI_CS_ON_P1 1
440 #define SPI_CS_ON_P0 0
443 #define HAS_MONITOR 0
445 #define HAS_TELEMETRY 0
450 #define DBG_CLOCK (1 << 4) /* mi0 */
451 #define DBG_DATA (1 << 5) /* mo0 */
452 #define DBG_RESET_N (1 << 3) /* c0 */
454 #define DBG_CLOCK_PIN (P1_4)
455 #define DBG_DATA_PIN (P1_5)
456 #define DBG_RESET_N_PIN (P1_3)
458 #define DBG_PORT_NUM 1
460 #define DBG_PORT_SEL P1SEL
461 #define DBG_PORT_INP P1INP
462 #define DBG_PORT_DIR P1DIR
464 #endif /* DBG_ON_P1 */
468 #define DBG_CLOCK (1 << 3)
469 #define DBG_DATA (1 << 4)
470 #define DBG_RESET_N (1 << 5)
472 #define DBG_CLOCK_PIN (P0_3)
473 #define DBG_DATA_PIN (P0_4)
474 #define DBG_RESET_N_PIN (P0_5)
476 #define DBG_PORT_NUM 0
478 #define DBG_PORT_SEL P0SEL
479 #define DBG_PORT_INP P0INP
480 #define DBG_PORT_DIR P0DIR
482 #endif /* DBG_ON_P0 */
484 #if COMPANION_CS_ON_P1
485 #define COMPANION_CS_PORT P1
486 #define COMPANION_CS_SEL P1SEL
487 #define COMPANION_CS_DIR P1DIR
491 #define SPI_CS_PORT P1
492 #define SPI_CS_SEL P1SEL
493 #define SPI_CS_DIR P1DIR
497 #define SPI_CS_PORT P0
498 #define SPI_CS_SEL P0SEL
499 #define SPI_CS_DIR P0DIR
502 #define AO_M25_SPI_CS_PORT SPI_CS_PORT
505 #error Please define IGNITE_ON_P2
509 #error Please define IGNITE_ON_P0
513 #error Please define HAS_ADC
517 #error Please define HAS_EEPROM
521 #error Please define HAS_LOG
525 #ifndef USE_INTERNAL_FLASH
526 #error Please define USE_INTERNAL_FLASH
531 #error Please define HAS_DBG
535 #error Please define HAS_IGNITE
539 #define HAS_IGNITE_REPORT 1
542 #ifndef PACKET_HAS_MASTER
543 #error Please define PACKET_HAS_MASTER
546 #ifndef PACKET_HAS_SLAVE
547 #error Please define PACKET_HAS_SLAVE
551 #error Please define HAS_MONITOR
556 #error Please define HAS_RSSI
561 #error Please define HAS_ADC
567 #ifndef HAS_ACCEL_REF
568 #error Please define HAS_ACCEL_REF
571 #define HAS_ACCEL_REF 0
577 #define AO_IGNITER_PORT P2
578 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
579 #define AO_IGNITER_DROGUE P2_3
580 #define AO_IGNITER_MAIN P2_4
581 #define AO_IGNITER_DIR P2DIR
582 #define AO_IGNITER_DROGUE_BIT (1 << 3)
583 #define AO_IGNITER_MAIN_BIT (1 << 4)
584 #define AO_IGNITER_DROGUE_PIN 3
585 #define AO_IGNITER_MAIN_PIN 4
589 #define AO_IGNITER_PORT P0
590 #define AO_IGNITER_DROGUE P0_5
591 #define AO_IGNITER_MAIN P0_4
592 #define AO_IGNITER_DIR P0DIR
593 #define AO_IGNITER_DROGUE_BIT (1 << 5)
594 #define AO_IGNITER_MAIN_BIT (1 << 4)
595 #define AO_IGNITER_DROGUE_PIN 5
596 #define AO_IGNITER_MAIN_PIN 4
599 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
600 #define AO_IGNITER_MAIN_PORT AO_IGNITER_PORT
602 /* test these values with real igniters */
603 #define AO_IGNITER_OPEN 1000
604 #define AO_IGNITER_CLOSED 7000
605 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
606 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
609 int16_t accel; /* accelerometer */
610 int16_t pres; /* pressure sensor */
611 int16_t temp; /* temperature sensor */
612 int16_t v_batt; /* battery voltage */
613 int16_t sense_d; /* drogue continuity sense */
614 int16_t sense_m; /* main continuity sense */
616 uint16_t accel_ref; /* acceleration reference */
621 * Voltage divider on ADC battery sampler
623 #define AO_BATTERY_DIV_PLUS 5 /* 5k */
624 #define AO_BATTERY_DIV_MINUS 10 /* 10k */
627 * Voltage divider on ADC igniter samplers
629 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
630 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
633 * ADC reference in decivolts
635 #define AO_ADC_REFERENCE_DV 33
637 #endif /* _AO_PINS_H_ */