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