changes in preparation for upload to Debian
[fw/altos] / src / 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 #if defined(TELEMETRUM_V_1_0)
22         #define HAS_FLIGHT              1
23         #define HAS_USB                 1
24         #define HAS_BEEP                1
25         #define HAS_GPS                 1
26         #define HAS_SERIAL_1            1
27         #define HAS_ADC                 1
28         #define USE_SERIAL_STDIN        0
29         #define HAS_EEPROM              1
30         #define USE_INTERNAL_FLASH      0
31         #define HAS_DBG                 1
32         #define DBG_ON_P1               1
33         #define DBG_ON_P0               0
34         #define IGNITE_ON_P2            1
35         #define IGNITE_ON_P0            0
36         #define PACKET_HAS_MASTER       0
37         #define PACKET_HAS_SLAVE        1
38
39         #define HAS_COMPANION           1
40         #define COMPANION_CS_ON_P1      1
41         #define COMPANION_CS_MASK       0x4     /* CS1 is P1_2 */
42         #define COMPANION_CS            P1_2
43
44         #define AO_LED_RED              1
45         #define LEDS_AVAILABLE          (AO_LED_RED)
46         #define HAS_EXTERNAL_TEMP       0
47         #define HAS_ACCEL_REF           0
48         #define HAS_ACCEL               1
49         #define HAS_IGNITE              1
50         #define HAS_MONITOR             0
51 #endif
52
53 #if defined(TELEMETRUM_V_1_1)
54         #define HAS_FLIGHT              1
55         #define HAS_USB                 1
56         #define HAS_BEEP                1
57         #define HAS_GPS                 1
58         #define HAS_SERIAL_1            1
59         #define USE_SERIAL_STDIN        0
60         #define HAS_ADC                 1
61         #define HAS_EEPROM              1
62         #define USE_INTERNAL_FLASH      0
63         #define HAS_DBG                 1
64         #define DBG_ON_P1               1
65         #define DBG_ON_P0               0
66         #define IGNITE_ON_P2            1
67         #define IGNITE_ON_P0            0
68         #define PACKET_HAS_MASTER       0
69         #define PACKET_HAS_SLAVE        1
70
71         #define HAS_COMPANION           1
72         #define COMPANION_CS_ON_P1      1
73         #define COMPANION_CS_MASK       0x4     /* CS1 is P1_2 */
74         #define COMPANION_CS            P1_2
75
76         #define AO_LED_RED              1
77         #define LEDS_AVAILABLE          (AO_LED_RED)
78         #define HAS_EXTERNAL_TEMP       0
79         #define HAS_ACCEL_REF           1
80         #define SPI_CS_ON_P1            1
81         #define SPI_CS_ON_P0            0
82         #define M25_CS_MASK             0x02    /* CS0 is P1_1 */
83         #define M25_MAX_CHIPS           1
84         #define HAS_ACCEL               1
85         #define HAS_IGNITE              1
86         #define HAS_MONITOR             0
87 #endif
88
89 #if defined(TELEDONGLE_V_0_2)
90         #define HAS_FLIGHT              0
91         #define HAS_USB                 1
92         #define HAS_BEEP                0
93         #define HAS_SERIAL_1            0
94         #define USE_SERIAL_STDIN        0
95         #define HAS_ADC                 0
96         #define HAS_DBG                 1
97         #define HAS_EEPROM              0
98         #define DBG_ON_P1               1
99         #define DBG_ON_P0               0
100         #define IGNITE_ON_P2            0
101         #define IGNITE_ON_P0            0
102         #define PACKET_HAS_MASTER       1
103         #define PACKET_HAS_SLAVE        0
104         #define AO_LED_RED              1
105         #define AO_LED_GREEN            2
106         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
107         #define SPI_CS_ON_P1            1
108         #define SPI_CS_ON_P0            0
109         #define HAS_IGNITE              0
110         #define HAS_MONITOR             1
111 #endif
112
113 #if defined(TELEMINI_V_1_0)
114         #define HAS_FLIGHT              1
115         #define HAS_USB                 0
116         #define HAS_BEEP                0
117         #define HAS_GPS                 0
118         #define HAS_SERIAL_1            0
119         #define USE_SERIAL_STDIN        0
120         #define HAS_ADC                 1
121         #define HAS_EEPROM              1
122         #define USE_INTERNAL_FLASH      1
123         #define HAS_DBG                 0
124         #define IGNITE_ON_P2            0
125         #define IGNITE_ON_P0            1
126         #define PACKET_HAS_MASTER       0
127         #define PACKET_HAS_SLAVE        1
128         #define USE_FAST_ASCENT_LOG     1
129
130         #define AO_LED_GREEN            1
131         #define AO_LED_RED              2
132         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
133         #define HAS_EXTERNAL_TEMP       0
134         #define HAS_ACCEL               0
135         #define HAS_IGNITE              1
136         #define HAS_MONITOR             0
137 #endif
138
139 #if defined(TELENANO_V_0_1)
140         #define HAS_FLIGHT              1
141         #define HAS_USB                 0
142         #define HAS_BEEP                0
143         #define HAS_GPS                 0
144         #define HAS_SERIAL_1            0
145         #define USE_SERIAL_STDIN        0
146         #define HAS_ADC                 1
147         #define HAS_EEPROM              1
148         #define USE_INTERNAL_FLASH      1
149         #define HAS_DBG                 0
150         #define IGNITE_ON_P2            0
151         #define IGNITE_ON_P0            1
152         #define PACKET_HAS_MASTER       0
153         #define PACKET_HAS_SLAVE        1
154
155         #define AO_LED_GREEN            1
156         #define AO_LED_RED              2
157         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
158         #define HAS_EXTERNAL_TEMP       0
159         #define HAS_ACCEL               0
160         #define HAS_IGNITE              0
161         #define HAS_MONITOR             0
162 #endif
163
164 #if defined(TELEMETRUM_V_0_1)
165         #define HAS_FLIGHT              1
166         #define HAS_USB                 1
167         #define HAS_BEEP                1
168         #define HAS_GPS                 1
169         #define HAS_SERIAL_1            1
170         #define USE_SERIAL_STDIN        0
171         #define HAS_ADC                 1
172         #define HAS_DBG                 0
173         #define HAS_EEPROM              1
174         #define USE_INTERNAL_FLASH      0
175         #define DBG_ON_P1               0
176         #define DBG_ON_P0               1
177         #define IGNITE_ON_P2            1
178         #define IGNITE_ON_P0            0
179         #define PACKET_HAS_MASTER       0
180         #define PACKET_HAS_SLAVE        1
181         #define AO_LED_RED              2
182         #define AO_LED_GREEN            1
183         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
184         #define HAS_EXTERNAL_TEMP       1
185         #define HAS_ACCEL_REF           0
186         #define SPI_CS_ON_P1            1
187         #define SPI_CS_ON_P0            0
188         #define HAS_ACCEL               1
189         #define HAS_IGNITE              1
190         #define HAS_MONITOR             0
191 #endif
192
193 #if defined(TELEDONGLE_V_0_1)
194         #define HAS_FLIGHT              0
195         #define HAS_USB                 1
196         #define HAS_BEEP                0
197         #define HAS_SERIAL_1            0
198         #define USE_SERIAL_STDIN        0
199         #define HAS_ADC                 0
200         #define HAS_DBG                 0
201         #define HAS_EEPROM              0
202         #define DBG_ON_P1               0
203         #define DBG_ON_P0               1
204         #define IGNITE_ON_P2            0
205         #define IGNITE_ON_P0            0
206         #define PACKET_HAS_MASTER       1
207         #define PACKET_HAS_SLAVE        0
208         #define AO_LED_RED              2
209         #define AO_LED_GREEN            1
210         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
211         #define SPI_CS_ON_P1            0
212         #define SPI_CS_ON_P0            1
213         #define HAS_IGNITE              0
214         #define HAS_MONITOR             1
215 #endif
216
217 #if defined(TIDONGLE)
218         #define HAS_FLIGHT              0
219         #define HAS_USB                 1
220         #define HAS_BEEP                0
221         #define HAS_SERIAL_1            0
222         #define USE_SERIAL_STDIN        0
223         #define HAS_ADC                 0
224         #define HAS_DBG                 1
225         #define HAS_EEPROM              0
226         #define DBG_ON_P1               0
227         #define DBG_ON_P0               1
228         #define IGNITE_ON_P2            0
229         #define IGNITE_ON_P0            0
230         #define PACKET_HAS_MASTER       1
231         #define PACKET_HAS_SLAVE        0
232         #define AO_LED_RED              2
233         #define LEDS_AVAILABLE          (AO_LED_RED)
234         #define SPI_CS_ON_P1            0
235         #define SPI_CS_ON_P0            1
236         #define HAS_IGNITE              0
237         #define HAS_MONITOR             1
238 #endif
239
240 #if defined(TELEBT_V_0_0)
241         #define HAS_FLIGHT              0
242         #define HAS_USB                 1
243         #define HAS_BEEP                0
244         #define HAS_SERIAL_1            1
245         #define USE_SERIAL_STDIN        1
246         #define HAS_ADC                 0
247         #define HAS_DBG                 1
248         #define HAS_EEPROM              0
249         #define HAS_BTM                 1
250         #define DBG_ON_P1               0
251         #define DBG_ON_P0               1
252         #define IGNITE_ON_P2            0
253         #define IGNITE_ON_P0            0
254         #define PACKET_HAS_MASTER       1
255         #define PACKET_HAS_SLAVE        0
256         #define AO_LED_RED              2
257         #define AO_LED_GREEN            1
258         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
259         #define SPI_CS_ON_P1            1
260         #define SPI_CS_ON_P0            0
261         #define HAS_IGNITE              0
262         #define BT_LINK_ON_P2           1
263         #define BT_LINK_ON_P1           0
264         #define BT_LINK_PIN_INDEX       7
265         #define BT_LINK_PIN             P2_1
266         #define HAS_MONITOR             1
267 #endif
268
269 #if defined(TELEBT_V_0_1)
270         #define HAS_FLIGHT              0
271         #define HAS_USB                 1
272         #define HAS_BEEP                1
273         #define HAS_SERIAL_1            1
274         #define HAS_SERIAL_1_ALT_1      1
275         #define HAS_SERIAL_1_ALT_2      0
276         #define HAS_SERIAL_1_HW_FLOW    1
277         #define USE_SERIAL_STDIN        1
278         #define HAS_ADC                 0
279         #define HAS_DBG                 1
280         #define HAS_EEPROM              1
281         #define USE_INTERNAL_FLASH      0
282         #define HAS_BTM                 1
283         #define DBG_ON_P1               1
284         #define DBG_ON_P0               0
285         #define IGNITE_ON_P2            0
286         #define IGNITE_ON_P0            0
287         #define PACKET_HAS_MASTER       1
288         #define PACKET_HAS_SLAVE        0
289         #define AO_LED_RED              1
290         #define AO_LED_GREEN            2
291         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
292         #define SPI_CS_ON_P1            1
293         #define SPI_CS_ON_P0            0
294         #define M25_CS_MASK             0x04    /* CS0 is P1_2 */
295         #define M25_MAX_CHIPS           1
296         #define HAS_ACCEL               0
297         #define HAS_IGNITE              0
298         #define BT_LINK_ON_P2           0
299         #define BT_LINK_ON_P1           1
300         #define BT_LINK_PIN_INDEX       7
301         #define BT_LINK_PIN             P1_7
302         #define HAS_MONITOR             1
303 #endif
304
305 #if DBG_ON_P1
306
307         #define DBG_CLOCK       (1 << 4)        /* mi0 */
308         #define DBG_DATA        (1 << 5)        /* mo0 */
309         #define DBG_RESET_N     (1 << 3)        /* c0 */
310
311         #define DBG_CLOCK_PIN   (P1_4)
312         #define DBG_DATA_PIN    (P1_5)
313         #define DBG_RESET_N_PIN (P1_3)
314
315         #define DBG_PORT_NUM    1
316         #define DBG_PORT        P1
317         #define DBG_PORT_SEL    P1SEL
318         #define DBG_PORT_INP    P1INP
319         #define DBG_PORT_DIR    P1DIR
320
321 #endif /* DBG_ON_P1 */
322
323 #if DBG_ON_P0
324
325         #define DBG_CLOCK       (1 << 3)
326         #define DBG_DATA        (1 << 4)
327         #define DBG_RESET_N     (1 << 5)
328
329         #define DBG_CLOCK_PIN   (P0_3)
330         #define DBG_DATA_PIN    (P0_4)
331         #define DBG_RESET_N_PIN (P0_5)
332
333         #define DBG_PORT_NUM    0
334         #define DBG_PORT        P0
335         #define DBG_PORT_SEL    P0SEL
336         #define DBG_PORT_INP    P0INP
337         #define DBG_PORT_DIR    P0DIR
338
339 #endif /* DBG_ON_P0 */
340
341 #if COMPANION_CS_ON_P1
342         #define COMPANION_CS_PORT       P1
343         #define COMPANION_CS_SEL        P1SEL
344         #define COMPANION_CS_DIR        P1DIR
345 #endif
346
347 #if SPI_CS_ON_P1
348         #define SPI_CS_PORT     P1
349         #define SPI_CS_SEL      P1SEL
350         #define SPI_CS_DIR      P1DIR
351 #endif
352
353 #if SPI_CS_ON_P0
354         #define SPI_CS_PORT     P0
355         #define SPI_CS_SEL      P0SEL
356         #define SPI_CS_DIR      P0DIR
357 #endif
358
359 #ifndef IGNITE_ON_P2
360 #error Please define IGNITE_ON_P2
361 #endif
362
363 #ifndef IGNITE_ON_P0
364 #error Please define IGNITE_ON_P0
365 #endif
366
367 #ifndef HAS_SERIAL_1
368 #error Please define HAS_SERIAL_1
369 #endif
370
371 #ifndef USE_SERIAL_STDIN
372 #error Please define USE_SERIAL_STDIN
373 #endif
374
375 #ifndef HAS_ADC
376 #error Please define HAS_ADC
377 #endif
378
379 #ifndef HAS_EEPROM
380 #error Please define HAS_EEPROM
381 #endif
382
383 #if HAS_EEPROM
384 #ifndef USE_INTERNAL_FLASH
385 #error Please define USE_INTERNAL_FLASH
386 #endif
387 #endif
388
389 #ifndef HAS_DBG
390 #error Please define HAS_DBG
391 #endif
392
393 #ifndef HAS_IGNITE
394 #error Please define HAS_IGNITE
395 #endif
396
397 #ifndef PACKET_HAS_MASTER
398 #error Please define PACKET_HAS_MASTER
399 #endif
400
401 #ifndef PACKET_HAS_SLAVE
402 #error Please define PACKET_HAS_SLAVE
403 #endif
404
405 #ifndef HAS_MONITOR
406 #error Please define HAS_MONITOR
407 #endif
408 #endif /* _AO_PINS_H_ */