9d6e1c1d7681576360c2170abf25b1ba709a5700
[fw/altos] / src / cc1111 / ao_pins.h
1 /*
2  * Copyright © 2010 Keith Packard <keithp@keithp.com>
3  *
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; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18
19 #ifndef _AO_PINS_H_
20 #define _AO_PINS_H_
21
22 #define HAS_RADIO               1
23 #define DISABLE_LOG_SPACE       1
24 #define AO_VALUE_32             0
25 #define HAS_WIDE_GPS            0
26
27 #if defined(TELEMETRUM_V_1_0)
28         /* Discontinued and was never built with CC1111 chips needing this */
29         #define NEEDS_CC1111_CLOCK_HACK 0
30         #define HAS_FLIGHT              1
31         #define HAS_USB                 1
32         #define HAS_BEEP                1
33         #define HAS_BEEP_CONFIG         0
34         #define HAS_GPS                 1
35         #define HAS_SERIAL_1            1
36         #define HAS_ADC                 1
37         #define HAS_EEPROM              1
38         #define HAS_LOG                 1
39         #define USE_INTERNAL_FLASH      0
40         #define HAS_DBG                 1
41         #define DBG_ON_P1               1
42         #define DBG_ON_P0               0
43         #define IGNITE_ON_P2            1
44         #define IGNITE_ON_P0            0
45         #define PACKET_HAS_MASTER       0
46         #define PACKET_HAS_SLAVE        1
47         #define NOISY_ACCEL             1
48
49         #define HAS_COMPANION           1
50         #define COMPANION_CS_ON_P1      1
51         #define AO_COMPANION_CS_PORT    P1
52         #define AO_COMPANION_CS_PIN     2
53         #define AO_COMPANION_CS         P1_2
54
55         #define AO_LED_RED              1
56         #define LEDS_AVAILABLE          (AO_LED_RED)
57         #define HAS_EXTERNAL_TEMP       0
58         #define HAS_ACCEL_REF           0
59         #define HAS_ACCEL               1
60         #define HAS_IGNITE              1
61         #define HAS_MONITOR             0
62         #define HAS_TELEMETRY           1
63         #define HAS_RADIO_RATE          0       /* not enough space for this */
64         #define HAS_MUTEX_TRY           0
65         #define HAS_TASK_INFO           0       /* not enough space for this either */
66         #define AO_LOG_FORMAT           AO_LOG_FORMAT_FULL
67 #endif
68
69 #if defined(TELEMETRUM_V_1_1)
70         /* Discontinued and was never built with CC1111 chips needing this */
71         #define NEEDS_CC1111_CLOCK_HACK 0
72         #define HAS_FLIGHT              1
73         #define HAS_USB                 1
74         #define HAS_BEEP                1
75         #define HAS_BEEP_CONFIG         0
76         #define HAS_BATTERY_REPORT      1
77         #define HAS_GPS                 1
78         #define HAS_SERIAL_1            1
79         #define HAS_ADC                 1
80         #define HAS_EEPROM              1
81         #define HAS_LOG                 1
82         #define USE_INTERNAL_FLASH      0
83         #define HAS_DBG                 1
84         #define DBG_ON_P1               1
85         #define DBG_ON_P0               0
86         #define IGNITE_ON_P2            1
87         #define IGNITE_ON_P0            0
88         #define PACKET_HAS_MASTER       0
89         #define PACKET_HAS_SLAVE        1
90
91         #define HAS_COMPANION           1
92         #define AO_COMPANION_CS_PORT    P1
93         #define AO_COMPANION_CS_PIN     2
94         #define AO_COMPANION_CS         P1_2
95
96         #define AO_LED_RED              1
97         #define LEDS_AVAILABLE          (AO_LED_RED)
98         #define HAS_EXTERNAL_TEMP       0
99         #define HAS_ACCEL_REF           1
100         #define SPI_CS_ON_P1            1
101         #define SPI_CS_ON_P0            0
102         #define AO_M25_SPI_CS_MASK      0x02    /* CS0 is P1_1 */
103         #define M25_MAX_CHIPS           1
104         #define HAS_ACCEL               1
105         #define HAS_IGNITE              1
106         #define HAS_MONITOR             0
107         #define HAS_TELEMETRY           1
108         #define HAS_RADIO_RATE          0       /* not enough space for this */
109         #define HAS_MUTEX_TRY           0
110         #define AO_LOG_FORMAT           AO_LOG_FORMAT_FULL
111 #endif
112
113 #if defined(TELEMETRUM_V_1_2)
114         /* Discontinued and was never built with CC1111 chips needing this */
115         #define NEEDS_CC1111_CLOCK_HACK 0
116         #define HAS_FLIGHT              1
117         #define HAS_USB                 1
118         #define HAS_BEEP                1
119         #define HAS_BEEP_CONFIG         0
120         #define HAS_BATTERY_REPORT      1
121         #define HAS_GPS                 1
122         #define HAS_SERIAL_1            1
123         #define HAS_ADC                 1
124         #define HAS_EEPROM              1
125         #define HAS_LOG                 1
126         #define USE_INTERNAL_FLASH      0
127         #define HAS_DBG                 1
128         #define DBG_ON_P1               1
129         #define DBG_ON_P0               0
130         #define IGNITE_ON_P2            1
131         #define IGNITE_ON_P0            0
132         #define PACKET_HAS_MASTER       0
133         #define PACKET_HAS_SLAVE        1
134
135         #define HAS_COMPANION           1
136         #define AO_COMPANION_CS_PORT    P1
137         #define AO_COMPANION_CS_PIN     2
138         #define AO_COMPANION_CS         P1_2
139
140         #define AO_LED_RED              1
141         #define LEDS_AVAILABLE          (AO_LED_RED)
142         #define HAS_EXTERNAL_TEMP       0
143         #define HAS_ACCEL_REF           1
144         #define SPI_CS_ON_P1            1
145         #define SPI_CS_ON_P0            0
146         #define AO_M25_SPI_CS_MASK      0x02    /* CS0 is P1_1 */
147         #define M25_MAX_CHIPS           1
148         #define HAS_ACCEL               1
149         #define HAS_IGNITE              1
150         #define HAS_MONITOR             0
151         #define HAS_TELEMETRY           1
152         #define HAS_RADIO_RATE          0       /* not enough space for this */
153         #define HAS_MUTEX_TRY           0
154         #define AO_LOG_FORMAT           AO_LOG_FORMAT_FULL
155 #endif
156
157 #if defined(TELEDONGLE_V_0_2)
158         #define HAS_FLIGHT              0
159         #define HAS_USB                 1
160         #define HAS_BEEP                0
161         #define HAS_SERIAL_1            0
162         #define HAS_ADC                 0
163         #define HAS_DBG                 1
164         #define HAS_EEPROM              0
165         #define HAS_LOG                 0
166         #define DBG_ON_P1               1
167         #define DBG_ON_P0               0
168         #define IGNITE_ON_P2            0
169         #define IGNITE_ON_P0            0
170         #define PACKET_HAS_MASTER       1
171         #define PACKET_HAS_SLAVE        0
172         #define AO_LED_RED              1
173         #define AO_LED_GREEN            2
174         #define AO_MONITOR_LED          AO_LED_GREEN
175         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
176         #define SPI_CS_ON_P1            1
177         #define SPI_CS_ON_P0            0
178         #define HAS_IGNITE              0
179         #define HAS_MONITOR             1
180         #define LEGACY_MONITOR          1
181         #define HAS_RSSI                1
182         #define HAS_AES                 0
183         #define HAS_TELEMETRY           0
184         #define AO_RADIO_REG_TEST       1
185 #endif
186
187 #if defined(TELEMINI_V_1_0)
188         /* Discontinued and was never built with CC1111 chips needing this */
189         #define NEEDS_CC1111_CLOCK_HACK 0
190         #define HAS_FLIGHT              1
191         #define HAS_USB                 0
192         #define HAS_BEEP                0
193         #define HAS_GPS                 0
194         #define HAS_SERIAL_1            0
195         #define HAS_ADC                 1
196         #define HAS_EEPROM              1
197         #define HAS_LOG                 1
198         #define HAS_FORCE_FREQ          1
199         #define USE_INTERNAL_FLASH      1
200         #define HAS_DBG                 0
201         #define IGNITE_ON_P2            0
202         #define IGNITE_ON_P0            1
203         #define PACKET_HAS_MASTER       0
204         #define PACKET_HAS_SLAVE        1
205         #define USE_FAST_ASCENT_LOG     1
206
207         #define AO_LED_GREEN            1
208         #define AO_LED_RED              2
209         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
210         #define HAS_EXTERNAL_TEMP       0
211         #define HAS_ACCEL               0
212         #define HAS_IGNITE              1
213         #define HAS_MONITOR             0
214         #define HAS_TELEMETRY           1
215         #define HAS_RADIO_RATE          0       /* not enough space for this */
216         #define AO_LOG_FORMAT           AO_LOG_FORMAT_TINY
217 #endif
218
219 #if defined(TELENANO_V_0_1)
220         /* Discontinued and was never built with CC1111 chips needing this */
221         #define NEEDS_CC1111_CLOCK_HACK 0
222         #define HAS_FLIGHT              1
223         #define HAS_USB                 0
224         #define HAS_BEEP                0
225         #define HAS_GPS                 0
226         #define HAS_SERIAL_1            0
227         #define HAS_ADC                 1
228         #define HAS_EEPROM              1
229         #define HAS_LOG                 1
230         #define USE_INTERNAL_FLASH      1
231         #define HAS_DBG                 0
232         #define IGNITE_ON_P2            0
233         #define IGNITE_ON_P0            1
234         #define PACKET_HAS_MASTER       0
235         #define PACKET_HAS_SLAVE        1
236
237         #define AO_LED_GREEN            1
238         #define AO_LED_RED              2
239         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
240         #define HAS_EXTERNAL_TEMP       0
241         #define HAS_ACCEL               0
242         #define HAS_IGNITE              0
243         #define HAS_MONITOR             0
244         #define HAS_TELEMETRY           1
245         #define HAS_RADIO_RATE          0       /* not enough space for this */
246 #endif
247
248 #if defined(TELEMETRUM_V_0_1)
249         /* Discontinued and was never built with CC1111 chips needing this */
250         #define NEEDS_CC1111_CLOCK_HACK 0
251         #define HAS_FLIGHT              1
252         #define HAS_USB                 1
253         #define HAS_BEEP                1
254         #define HAS_BEEP_CONFIG         0
255         #define HAS_GPS                 1
256         #define HAS_SERIAL_1            1
257         #define HAS_ADC                 1
258         #define HAS_DBG                 0
259         #define HAS_EEPROM              1
260         #define HAS_LOG                 1
261         #define USE_INTERNAL_FLASH      0
262         #define DBG_ON_P1               0
263         #define DBG_ON_P0               1
264         #define IGNITE_ON_P2            1
265         #define IGNITE_ON_P0            0
266         #define PACKET_HAS_MASTER       0
267         #define PACKET_HAS_SLAVE        1
268         #define AO_LED_RED              2
269         #define AO_LED_GREEN            1
270         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
271         #define HAS_EXTERNAL_TEMP       1
272         #define HAS_ACCEL_REF           0
273         #define SPI_CS_ON_P1            1
274         #define SPI_CS_ON_P0            0
275         #define HAS_ACCEL               1
276         #define HAS_IGNITE              1
277         #define HAS_MONITOR             0
278         #define HAS_TELEMETRY           1
279         #define HAS_RADIO_RATE          0       /* not enough space for this */
280         #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX        ((uint32_t) 127 * (uint32_t) 1024)
281         #define AO_LOG_FORMAT           AO_LOG_FORMAT_FULL
282 #endif
283
284 #if defined(TELEDONGLE_V_0_1)
285         /* Discontinued and was never built with CC1111 chips needing this */
286         #define NEEDS_CC1111_CLOCK_HACK 0
287         #define HAS_FLIGHT              0
288         #define HAS_USB                 1
289         #define HAS_BEEP                0
290         #define HAS_SERIAL_1            0
291         #define HAS_ADC                 0
292         #define HAS_DBG                 0
293         #define HAS_EEPROM              0
294         #define HAS_LOG                 0
295         #define DBG_ON_P1               0
296         #define DBG_ON_P0               1
297         #define IGNITE_ON_P2            0
298         #define IGNITE_ON_P0            0
299         #define PACKET_HAS_MASTER       1
300         #define PACKET_HAS_SLAVE        0
301         #define AO_LED_RED              2
302         #define AO_LED_GREEN            1
303         #define AO_MONITOR_LED          AO_LED_GREEN
304         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
305         #define SPI_CS_ON_P1            0
306         #define SPI_CS_ON_P0            1
307         #define HAS_IGNITE              0
308         #define HAS_MONITOR             1
309         #define LEGACY_MONITOR          1
310         #define HAS_RSSI                1
311         #define HAS_AES                 0
312         #define HAS_TELEMETRY           0
313 #endif
314
315 #if defined(TIDONGLE)
316         /* Discontinued and was never built with CC1111 chips needing this */
317         #define NEEDS_CC1111_CLOCK_HACK 0
318         #define HAS_FLIGHT              0
319         #define HAS_USB                 1
320         #define HAS_BEEP                0
321         #define HAS_SERIAL_1            0
322         #define HAS_ADC                 0
323         #define HAS_DBG                 1
324         #define HAS_EEPROM              0
325         #define HAS_LOG                 0
326         #define DBG_ON_P1               0
327         #define DBG_ON_P0               1
328         #define IGNITE_ON_P2            0
329         #define IGNITE_ON_P0            0
330         #define PACKET_HAS_MASTER       1
331         #define PACKET_HAS_SLAVE        0
332         #define AO_LED_RED              2
333         #define AO_MONITOR_LED          AO_LED_RED
334         #define LEDS_AVAILABLE          (AO_LED_RED)
335         #define SPI_CS_ON_P1            0
336         #define SPI_CS_ON_P0            1
337         #define HAS_IGNITE              0
338         #define HAS_MONITOR             1
339         #define LEGACY_MONITOR          1
340         #define HAS_RSSI                1
341         #define HAS_AES                 0
342         #define HAS_TELEMETRY           0
343 #endif
344
345 #if defined(TELEBT_V_0_0)
346         /* Discontinued and was never built with CC1111 chips needing this */
347         #define NEEDS_CC1111_CLOCK_HACK 0
348         #define HAS_FLIGHT              0
349         #define HAS_USB                 1
350         #define HAS_BEEP                0
351         #define HAS_SERIAL_1            1
352         #define USE_SERIAL_1_STDIN      1
353         #define DELAY_SERIAL_1_STDIN    1
354         #define HAS_ADC                 0
355         #define HAS_DBG                 1
356         #define HAS_EEPROM              0
357         #define HAS_LOG                 0
358         #define HAS_BTM                 1
359         #define DBG_ON_P1               0
360         #define DBG_ON_P0               1
361         #define IGNITE_ON_P2            0
362         #define IGNITE_ON_P0            0
363         #define PACKET_HAS_MASTER       1
364         #define PACKET_HAS_SLAVE        0
365         #define AO_LED_RED              2
366         #define AO_LED_GREEN            1
367         #define AO_MONITOR_LED          AO_LED_RED
368         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
369         #define SPI_CS_ON_P1            1
370         #define SPI_CS_ON_P0            0
371         #define HAS_IGNITE              0
372         #define HAS_IGNITE_REPORT       1
373         #define BT_LINK_ON_P2           1
374         #define BT_LINK_ON_P1           0
375         #define BT_LINK_PIN_INDEX       7
376         #define BT_LINK_PIN             P2_1
377         #define HAS_MONITOR             1
378         #define LEGACY_MONITOR          1
379         #define HAS_RSSI                0
380         #define HAS_AES                 0
381         #define HAS_TELEMETRY           0
382         #define AO_RADIO_REG_TEST       1
383 #endif
384
385 #if defined(TELEBT_V_0_1)
386         /* Discontinued and was never built with CC1111 chips needing this */
387         #define NEEDS_CC1111_CLOCK_HACK 0
388         #define HAS_FLIGHT              0
389         #define HAS_USB                 1
390         #define HAS_BEEP                1
391         #define HAS_BEEP_CONFIG         0
392         #define HAS_SERIAL_1            1
393         #define HAS_SERIAL_1_ALT_1      1
394         #define HAS_SERIAL_1_ALT_2      0
395         #define HAS_SERIAL_1_HW_FLOW    1
396         #define USE_SERIAL_1_STDIN      1
397         #define DELAY_SERIAL_1_STDIN    1
398         #define HAS_ADC                 0
399         #define HAS_DBG                 1
400         #define HAS_EEPROM              1
401         #define HAS_LOG                 1
402         #define USE_INTERNAL_FLASH      0
403         #define HAS_BTM                 1
404         #define DBG_ON_P1               1
405         #define DBG_ON_P0               0
406         #define IGNITE_ON_P2            0
407         #define IGNITE_ON_P0            0
408         #define PACKET_HAS_MASTER       1
409         #define PACKET_HAS_SLAVE        0
410         #define AO_LED_RED              1
411         #define AO_LED_GREEN            2
412         #define AO_MONITOR_LED          AO_LED_RED
413         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
414         #define SPI_CS_ON_P1            1
415         #define SPI_CS_ON_P0            0
416         #define AO_M25_SPI_CS_MASK      0x04    /* CS0 is P1_2 */
417         #define M25_MAX_CHIPS           1
418         #define HAS_ACCEL               0
419         #define HAS_IGNITE              0
420         #define HAS_IGNITE_REPORT       1
421         #define BT_LINK_ON_P2           0
422         #define BT_LINK_ON_P1           1
423         #define BT_LINK_PIN_INDEX       7
424         #define BT_LINK_PIN             P1_7
425         #define HAS_MONITOR             1
426         #define LEGACY_MONITOR          1
427         #define HAS_RSSI                0
428         #define HAS_AES                 0
429         #define HAS_TELEMETRY           0
430         #define AO_RADIO_REG_TEST       1
431 #endif
432
433 #if defined(TELELAUNCH_V_0_1)
434         /* Discontinued and was never built with CC1111 chips needing this */
435         #define NEEDS_CC1111_CLOCK_HACK 0
436         #define HAS_FLIGHT              0
437         #define HAS_USB                 1
438         #define HAS_BEEP                1
439         #define HAS_GPS                 0
440         #define HAS_SERIAL_1            1
441         #define HAS_ADC                 1
442         #define HAS_DBG                 0
443         #define HAS_EEPROM              1
444         #define HAS_LOG                 0
445         #define USE_INTERNAL_FLASH      1
446         #define DBG_ON_P1               0
447         #define DBG_ON_P0               1
448         #define IGNITE_ON_P2            1
449         #define IGNITE_ON_P0            0
450         #define PACKET_HAS_MASTER       0
451         #define PACKET_HAS_SLAVE        0
452         #define AO_LED_RED              2
453         #define AO_LED_GREEN            1
454         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
455         #define HAS_EXTERNAL_TEMP       1
456         #define HAS_ACCEL_REF           0
457         #define SPI_CS_ON_P1            1
458         #define SPI_CS_ON_P0            0
459         #define HAS_ACCEL               0
460         #define HAS_IGNITE              1
461         #define HAS_MONITOR             0
462         #define HAS_AES                 1
463         #define HAS_TELEMETRY           0
464 #endif
465
466 #if DBG_ON_P1
467
468         #define DBG_CLOCK       (1 << 4)        /* mi0 */
469         #define DBG_DATA        (1 << 5)        /* mo0 */
470         #define DBG_RESET_N     (1 << 3)        /* c0 */
471
472         #define DBG_CLOCK_PIN   (P1_4)
473         #define DBG_DATA_PIN    (P1_5)
474         #define DBG_RESET_N_PIN (P1_3)
475
476         #define DBG_PORT_NUM    1
477         #define DBG_PORT        P1
478         #define DBG_PORT_SEL    P1SEL
479         #define DBG_PORT_INP    P1INP
480         #define DBG_PORT_DIR    P1DIR
481
482 #endif /* DBG_ON_P1 */
483
484 #if DBG_ON_P0
485
486         #define DBG_CLOCK       (1 << 3)
487         #define DBG_DATA        (1 << 4)
488         #define DBG_RESET_N     (1 << 5)
489
490         #define DBG_CLOCK_PIN   (P0_3)
491         #define DBG_DATA_PIN    (P0_4)
492         #define DBG_RESET_N_PIN (P0_5)
493
494         #define DBG_PORT_NUM    0
495         #define DBG_PORT        P0
496         #define DBG_PORT_SEL    P0SEL
497         #define DBG_PORT_INP    P0INP
498         #define DBG_PORT_DIR    P0DIR
499
500 #endif /* DBG_ON_P0 */
501
502 #if COMPANION_CS_ON_P1
503         #define COMPANION_CS_PORT       P1
504         #define COMPANION_CS_SEL        P1SEL
505         #define COMPANION_CS_DIR        P1DIR
506 #endif
507
508 #if SPI_CS_ON_P1
509         #define SPI_CS_PORT     P1
510         #define SPI_CS_SEL      P1SEL
511         #define SPI_CS_DIR      P1DIR
512 #endif
513
514 #if SPI_CS_ON_P0
515         #define SPI_CS_PORT     P0
516         #define SPI_CS_SEL      P0SEL
517         #define SPI_CS_DIR      P0DIR
518 #endif
519
520 #define AO_M25_SPI_CS_PORT      SPI_CS_PORT
521
522 #ifndef IGNITE_ON_P2
523 #error Please define IGNITE_ON_P2
524 #endif
525
526 #ifndef IGNITE_ON_P0
527 #error Please define IGNITE_ON_P0
528 #endif
529
530 #ifndef HAS_ADC
531 #error Please define HAS_ADC
532 #endif
533
534 #ifndef HAS_EEPROM
535 #error Please define HAS_EEPROM
536 #endif
537
538 #ifndef HAS_LOG
539 #error Please define HAS_LOG
540 #endif
541
542 #if HAS_EEPROM
543 #ifndef USE_INTERNAL_FLASH
544 #error Please define USE_INTERNAL_FLASH
545 #endif
546 #endif
547
548 #ifndef HAS_DBG
549 #error Please define HAS_DBG
550 #endif
551
552 #ifndef HAS_IGNITE
553 #error Please define HAS_IGNITE
554 #endif
555
556 #if HAS_IGNITE
557 #define HAS_IGNITE_REPORT 1
558 #endif
559
560 #ifndef PACKET_HAS_MASTER
561 #error Please define PACKET_HAS_MASTER
562 #endif
563
564 #ifndef PACKET_HAS_SLAVE
565 #error Please define PACKET_HAS_SLAVE
566 #endif
567
568 #ifndef HAS_MONITOR
569 #error Please define HAS_MONITOR
570 #endif
571
572 #if HAS_MONITOR
573 #ifndef HAS_RSSI
574 #error Please define HAS_RSSI
575 #endif
576 #endif
577
578 #ifndef HAS_ADC
579 #error Please define HAS_ADC
580 #endif
581
582 #if HAS_ADC
583
584 #if HAS_ACCEL
585 #ifndef HAS_ACCEL_REF
586 #error Please define HAS_ACCEL_REF
587 #endif
588 #else
589 #define HAS_ACCEL_REF 0
590 #endif
591
592 #endif /* HAS_ADC */
593
594 #if IGNITE_ON_P2
595 #define AO_IGNITER_PORT         P2
596 #define AO_IGNITER_DROGUE_PORT  AO_IGNITER_PORT
597 #define AO_IGNITER_DROGUE       P2_3
598 #define AO_IGNITER_MAIN         P2_4
599 #define AO_IGNITER_DIR          P2DIR
600 #define AO_IGNITER_DROGUE_BIT   (1 << 3)
601 #define AO_IGNITER_MAIN_BIT     (1 << 4)
602 #define AO_IGNITER_DROGUE_PIN   3
603 #define AO_IGNITER_MAIN_PIN     4
604 #endif
605
606 #if IGNITE_ON_P0
607 #define AO_IGNITER_PORT         P0
608 #define AO_IGNITER_DROGUE       P0_5
609 #define AO_IGNITER_MAIN         P0_4
610 #define AO_IGNITER_DIR          P0DIR
611 #define AO_IGNITER_DROGUE_BIT   (1 << 5)
612 #define AO_IGNITER_MAIN_BIT     (1 << 4)
613 #define AO_IGNITER_DROGUE_PIN   5
614 #define AO_IGNITER_MAIN_PIN     4
615 #endif
616
617 #define AO_IGNITER_DROGUE_PORT  AO_IGNITER_PORT
618 #define AO_IGNITER_MAIN_PORT    AO_IGNITER_PORT
619
620 /* test these values with real igniters */
621 #define AO_IGNITER_OPEN         1000
622 #define AO_IGNITER_CLOSED       7000
623 #define AO_IGNITER_FIRE_TIME    AO_MS_TO_TICKS(50)
624 #define AO_IGNITER_CHARGE_TIME  AO_MS_TO_TICKS(2000)
625
626 struct ao_adc {
627         int16_t         accel;          /* accelerometer */
628         int16_t         pres;           /* pressure sensor */
629         int16_t         temp;           /* temperature sensor */
630         int16_t         v_batt;         /* battery voltage */
631         int16_t         sense_d;        /* drogue continuity sense */
632         int16_t         sense_m;        /* main continuity sense */
633 #if HAS_ACCEL_REF
634         uint16_t        accel_ref;      /* acceleration reference */
635 #endif
636 };
637
638 /*
639  * Voltage divider on ADC battery sampler
640  */
641 #define AO_BATTERY_DIV_PLUS     5       /* 5k */
642 #define AO_BATTERY_DIV_MINUS    10      /* 10k */
643
644 /*
645  * Voltage divider on ADC igniter samplers
646  */
647 #define AO_IGNITE_DIV_PLUS      100     /* 100k */
648 #define AO_IGNITE_DIV_MINUS     27      /* 27k */
649
650 /*
651  * ADC reference in decivolts
652  */
653 #define AO_ADC_REFERENCE_DV     33
654
655 #endif /* _AO_PINS_H_ */