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