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