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
61 #if defined(TELEMETRUM_V_1_1)
62 /* Discontinued and was never built with CC1111 chips needing this */
63 #define NEEDS_CC1111_CLOCK_HACK 0
67 #define HAS_BEEP_CONFIG 0
68 #define HAS_BATTERY_REPORT 1
70 #define HAS_SERIAL_1 1
74 #define USE_INTERNAL_FLASH 0
78 #define IGNITE_ON_P2 1
79 #define IGNITE_ON_P0 0
80 #define PACKET_HAS_MASTER 0
81 #define PACKET_HAS_SLAVE 1
83 #define HAS_COMPANION 1
84 #define AO_COMPANION_CS_PORT P1
85 #define AO_COMPANION_CS_PIN 2
86 #define AO_COMPANION_CS P1_2
89 #define LEDS_AVAILABLE (AO_LED_RED)
90 #define HAS_EXTERNAL_TEMP 0
91 #define HAS_ACCEL_REF 1
92 #define SPI_CS_ON_P1 1
93 #define SPI_CS_ON_P0 0
94 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
95 #define M25_MAX_CHIPS 1
101 #if defined(TELEMETRUM_V_1_2)
102 /* Discontinued and was never built with CC1111 chips needing this */
103 #define NEEDS_CC1111_CLOCK_HACK 0
107 #define HAS_BEEP_CONFIG 0
108 #define HAS_BATTERY_REPORT 1
110 #define HAS_SERIAL_1 1
114 #define USE_INTERNAL_FLASH 0
118 #define IGNITE_ON_P2 1
119 #define IGNITE_ON_P0 0
120 #define PACKET_HAS_MASTER 0
121 #define PACKET_HAS_SLAVE 1
123 #define HAS_COMPANION 1
124 #define AO_COMPANION_CS_PORT P1
125 #define AO_COMPANION_CS_PIN 2
126 #define AO_COMPANION_CS P1_2
129 #define LEDS_AVAILABLE (AO_LED_RED)
130 #define HAS_EXTERNAL_TEMP 0
131 #define HAS_ACCEL_REF 1
132 #define SPI_CS_ON_P1 1
133 #define SPI_CS_ON_P0 0
134 #define AO_M25_SPI_CS_MASK 0x02 /* CS0 is P1_1 */
135 #define M25_MAX_CHIPS 1
138 #define HAS_MONITOR 0
141 #if defined(TELEDONGLE_V_0_2)
145 #define HAS_SERIAL_1 0
152 #define IGNITE_ON_P2 0
153 #define IGNITE_ON_P0 0
154 #define PACKET_HAS_MASTER 1
155 #define PACKET_HAS_SLAVE 0
157 #define AO_LED_GREEN 2
158 #define AO_MONITOR_LED AO_LED_GREEN
159 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
160 #define SPI_CS_ON_P1 1
161 #define SPI_CS_ON_P0 0
163 #define HAS_MONITOR 1
164 #define LEGACY_MONITOR 1
169 #if defined(TELEMINI_V_1_0)
170 /* Discontinued and was never built with CC1111 chips needing this */
171 #define NEEDS_CC1111_CLOCK_HACK 0
176 #define HAS_SERIAL_1 0
180 #define HAS_FORCE_FREQ 1
181 #define USE_INTERNAL_FLASH 1
183 #define IGNITE_ON_P2 0
184 #define IGNITE_ON_P0 1
185 #define PACKET_HAS_MASTER 0
186 #define PACKET_HAS_SLAVE 1
187 #define USE_FAST_ASCENT_LOG 1
189 #define AO_LED_GREEN 1
191 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
192 #define HAS_EXTERNAL_TEMP 0
195 #define HAS_MONITOR 0
198 #if defined(TELENANO_V_0_1)
199 /* Discontinued and was never built with CC1111 chips needing this */
200 #define NEEDS_CC1111_CLOCK_HACK 0
205 #define HAS_SERIAL_1 0
209 #define USE_INTERNAL_FLASH 1
211 #define IGNITE_ON_P2 0
212 #define IGNITE_ON_P0 1
213 #define PACKET_HAS_MASTER 0
214 #define PACKET_HAS_SLAVE 1
216 #define AO_LED_GREEN 1
218 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
219 #define HAS_EXTERNAL_TEMP 0
222 #define HAS_MONITOR 0
225 #if defined(TELEMETRUM_V_0_1)
226 /* Discontinued and was never built with CC1111 chips needing this */
227 #define NEEDS_CC1111_CLOCK_HACK 0
231 #define HAS_BEEP_CONFIG 0
233 #define HAS_SERIAL_1 1
238 #define USE_INTERNAL_FLASH 0
241 #define IGNITE_ON_P2 1
242 #define IGNITE_ON_P0 0
243 #define PACKET_HAS_MASTER 0
244 #define PACKET_HAS_SLAVE 1
246 #define AO_LED_GREEN 1
247 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
248 #define HAS_EXTERNAL_TEMP 1
249 #define HAS_ACCEL_REF 0
250 #define SPI_CS_ON_P1 1
251 #define SPI_CS_ON_P0 0
254 #define HAS_MONITOR 0
255 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX ((uint32_t) 127 * (uint32_t) 1024)
258 #if defined(TELEDONGLE_V_0_1)
259 /* Discontinued and was never built with CC1111 chips needing this */
260 #define NEEDS_CC1111_CLOCK_HACK 0
264 #define HAS_SERIAL_1 0
271 #define IGNITE_ON_P2 0
272 #define IGNITE_ON_P0 0
273 #define PACKET_HAS_MASTER 1
274 #define PACKET_HAS_SLAVE 0
276 #define AO_LED_GREEN 1
277 #define AO_MONITOR_LED AO_LED_GREEN
278 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
279 #define SPI_CS_ON_P1 0
280 #define SPI_CS_ON_P0 1
282 #define HAS_MONITOR 1
283 #define LEGACY_MONITOR 1
288 #if defined(TIDONGLE)
289 /* Discontinued and was never built with CC1111 chips needing this */
290 #define NEEDS_CC1111_CLOCK_HACK 0
294 #define HAS_SERIAL_1 0
301 #define IGNITE_ON_P2 0
302 #define IGNITE_ON_P0 0
303 #define PACKET_HAS_MASTER 1
304 #define PACKET_HAS_SLAVE 0
306 #define AO_MONITOR_LED AO_LED_RED
307 #define LEDS_AVAILABLE (AO_LED_RED)
308 #define SPI_CS_ON_P1 0
309 #define SPI_CS_ON_P0 1
311 #define HAS_MONITOR 1
312 #define LEGACY_MONITOR 1
317 #if defined(TELEBT_V_0_0)
318 /* Discontinued and was never built with CC1111 chips needing this */
319 #define NEEDS_CC1111_CLOCK_HACK 0
323 #define HAS_SERIAL_1 1
324 #define USE_SERIAL_1_STDIN 1
325 #define DELAY_SERIAL_1_STDIN 1
333 #define IGNITE_ON_P2 0
334 #define IGNITE_ON_P0 0
335 #define PACKET_HAS_MASTER 1
336 #define PACKET_HAS_SLAVE 0
338 #define AO_LED_GREEN 1
339 #define AO_MONITOR_LED AO_LED_RED
340 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
341 #define SPI_CS_ON_P1 1
342 #define SPI_CS_ON_P0 0
344 #define HAS_IGNITE_REPORT 1
345 #define BT_LINK_ON_P2 1
346 #define BT_LINK_ON_P1 0
347 #define BT_LINK_PIN_INDEX 7
348 #define BT_LINK_PIN P2_1
349 #define HAS_MONITOR 1
350 #define LEGACY_MONITOR 1
355 #if defined(TELEBT_V_0_1)
356 /* Discontinued and was never built with CC1111 chips needing this */
357 #define NEEDS_CC1111_CLOCK_HACK 0
361 #define HAS_BEEP_CONFIG 0
362 #define HAS_SERIAL_1 1
363 #define HAS_SERIAL_1_ALT_1 1
364 #define HAS_SERIAL_1_ALT_2 0
365 #define HAS_SERIAL_1_HW_FLOW 1
366 #define USE_SERIAL_1_STDIN 1
367 #define DELAY_SERIAL_1_STDIN 1
372 #define USE_INTERNAL_FLASH 0
376 #define IGNITE_ON_P2 0
377 #define IGNITE_ON_P0 0
378 #define PACKET_HAS_MASTER 1
379 #define PACKET_HAS_SLAVE 0
381 #define AO_LED_GREEN 2
382 #define AO_MONITOR_LED AO_LED_RED
383 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
384 #define SPI_CS_ON_P1 1
385 #define SPI_CS_ON_P0 0
386 #define AO_M25_SPI_CS_MASK 0x04 /* CS0 is P1_2 */
387 #define M25_MAX_CHIPS 1
390 #define HAS_IGNITE_REPORT 1
391 #define BT_LINK_ON_P2 0
392 #define BT_LINK_ON_P1 1
393 #define BT_LINK_PIN_INDEX 7
394 #define BT_LINK_PIN P1_7
395 #define HAS_MONITOR 1
396 #define LEGACY_MONITOR 1
401 #if defined(TELELAUNCH_V_0_1)
402 /* Discontinued and was never built with CC1111 chips needing this */
403 #define NEEDS_CC1111_CLOCK_HACK 0
408 #define HAS_SERIAL_1 1
413 #define USE_INTERNAL_FLASH 1
416 #define IGNITE_ON_P2 1
417 #define IGNITE_ON_P0 0
418 #define PACKET_HAS_MASTER 0
419 #define PACKET_HAS_SLAVE 0
421 #define AO_LED_GREEN 1
422 #define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
423 #define HAS_EXTERNAL_TEMP 1
424 #define HAS_ACCEL_REF 0
425 #define SPI_CS_ON_P1 1
426 #define SPI_CS_ON_P0 0
429 #define HAS_MONITOR 0
435 #define DBG_CLOCK (1 << 4) /* mi0 */
436 #define DBG_DATA (1 << 5) /* mo0 */
437 #define DBG_RESET_N (1 << 3) /* c0 */
439 #define DBG_CLOCK_PIN (P1_4)
440 #define DBG_DATA_PIN (P1_5)
441 #define DBG_RESET_N_PIN (P1_3)
443 #define DBG_PORT_NUM 1
445 #define DBG_PORT_SEL P1SEL
446 #define DBG_PORT_INP P1INP
447 #define DBG_PORT_DIR P1DIR
449 #endif /* DBG_ON_P1 */
453 #define DBG_CLOCK (1 << 3)
454 #define DBG_DATA (1 << 4)
455 #define DBG_RESET_N (1 << 5)
457 #define DBG_CLOCK_PIN (P0_3)
458 #define DBG_DATA_PIN (P0_4)
459 #define DBG_RESET_N_PIN (P0_5)
461 #define DBG_PORT_NUM 0
463 #define DBG_PORT_SEL P0SEL
464 #define DBG_PORT_INP P0INP
465 #define DBG_PORT_DIR P0DIR
467 #endif /* DBG_ON_P0 */
469 #if COMPANION_CS_ON_P1
470 #define COMPANION_CS_PORT P1
471 #define COMPANION_CS_SEL P1SEL
472 #define COMPANION_CS_DIR P1DIR
476 #define SPI_CS_PORT P1
477 #define SPI_CS_SEL P1SEL
478 #define SPI_CS_DIR P1DIR
482 #define SPI_CS_PORT P0
483 #define SPI_CS_SEL P0SEL
484 #define SPI_CS_DIR P0DIR
487 #define AO_M25_SPI_CS_PORT SPI_CS_PORT
490 #error Please define IGNITE_ON_P2
494 #error Please define IGNITE_ON_P0
498 #error Please define HAS_ADC
502 #error Please define HAS_EEPROM
506 #error Please define HAS_LOG
510 #ifndef USE_INTERNAL_FLASH
511 #error Please define USE_INTERNAL_FLASH
516 #error Please define HAS_DBG
520 #error Please define HAS_IGNITE
524 #define HAS_IGNITE_REPORT 1
527 #ifndef PACKET_HAS_MASTER
528 #error Please define PACKET_HAS_MASTER
531 #ifndef PACKET_HAS_SLAVE
532 #error Please define PACKET_HAS_SLAVE
536 #error Please define HAS_MONITOR
541 #error Please define HAS_RSSI
546 #error Please define HAS_ADC
552 #ifndef HAS_ACCEL_REF
553 #error Please define HAS_ACCEL_REF
556 #define HAS_ACCEL_REF 0
562 #define AO_IGNITER_PORT P2
563 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
564 #define AO_IGNITER_DROGUE P2_3
565 #define AO_IGNITER_MAIN P2_4
566 #define AO_IGNITER_DIR P2DIR
567 #define AO_IGNITER_DROGUE_BIT (1 << 3)
568 #define AO_IGNITER_MAIN_BIT (1 << 4)
569 #define AO_IGNITER_DROGUE_PIN 3
570 #define AO_IGNITER_MAIN_PIN 4
574 #define AO_IGNITER_PORT P0
575 #define AO_IGNITER_DROGUE P0_5
576 #define AO_IGNITER_MAIN P0_4
577 #define AO_IGNITER_DIR P0DIR
578 #define AO_IGNITER_DROGUE_BIT (1 << 5)
579 #define AO_IGNITER_MAIN_BIT (1 << 4)
580 #define AO_IGNITER_DROGUE_PIN 5
581 #define AO_IGNITER_MAIN_PIN 4
584 #define AO_IGNITER_DROGUE_PORT AO_IGNITER_PORT
585 #define AO_IGNITER_MAIN_PORT AO_IGNITER_PORT
587 /* test these values with real igniters */
588 #define AO_IGNITER_OPEN 1000
589 #define AO_IGNITER_CLOSED 7000
590 #define AO_IGNITER_FIRE_TIME AO_MS_TO_TICKS(50)
591 #define AO_IGNITER_CHARGE_TIME AO_MS_TO_TICKS(2000)
594 int16_t accel; /* accelerometer */
595 int16_t pres; /* pressure sensor */
596 int16_t temp; /* temperature sensor */
597 int16_t v_batt; /* battery voltage */
598 int16_t sense_d; /* drogue continuity sense */
599 int16_t sense_m; /* main continuity sense */
601 uint16_t accel_ref; /* acceleration reference */
606 * Voltage divider on ADC battery sampler
608 #define AO_BATTERY_DIV_PLUS 5 /* 5k */
609 #define AO_BATTERY_DIV_MINUS 10 /* 10k */
612 * Voltage divider on ADC igniter samplers
614 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
615 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
618 * ADC reference in decivolts
620 #define AO_ADC_REFERENCE_DV 33
622 #endif /* _AO_PINS_H_ */