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