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