altos: Get AES CBC-MAC packet transfers running
[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 #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         #define HAS_AES                 1
112 #endif
113
114 #if defined(TELEMINI_V_1_0)
115         #define HAS_FLIGHT              1
116         #define HAS_USB                 0
117         #define HAS_BEEP                0
118         #define HAS_GPS                 0
119         #define HAS_SERIAL_1            0
120         #define USE_SERIAL_STDIN        0
121         #define HAS_ADC                 1
122         #define HAS_EEPROM              1
123         #define USE_INTERNAL_FLASH      1
124         #define HAS_DBG                 0
125         #define IGNITE_ON_P2            0
126         #define IGNITE_ON_P0            1
127         #define PACKET_HAS_MASTER       0
128         #define PACKET_HAS_SLAVE        1
129         #define USE_FAST_ASCENT_LOG     1
130
131         #define AO_LED_GREEN            1
132         #define AO_LED_RED              2
133         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
134         #define HAS_EXTERNAL_TEMP       0
135         #define HAS_ACCEL               0
136         #define HAS_IGNITE              1
137         #define HAS_MONITOR             0
138 #endif
139
140 #if defined(TELENANO_V_0_1)
141         #define HAS_FLIGHT              1
142         #define HAS_USB                 0
143         #define HAS_BEEP                0
144         #define HAS_GPS                 0
145         #define HAS_SERIAL_1            0
146         #define USE_SERIAL_STDIN        0
147         #define HAS_ADC                 1
148         #define HAS_EEPROM              1
149         #define USE_INTERNAL_FLASH      1
150         #define HAS_DBG                 0
151         #define IGNITE_ON_P2            0
152         #define IGNITE_ON_P0            1
153         #define PACKET_HAS_MASTER       0
154         #define PACKET_HAS_SLAVE        1
155
156         #define AO_LED_GREEN            1
157         #define AO_LED_RED              2
158         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
159         #define HAS_EXTERNAL_TEMP       0
160         #define HAS_ACCEL               0
161         #define HAS_IGNITE              0
162         #define HAS_MONITOR             0
163 #endif
164
165 #if defined(TELEMETRUM_V_0_1)
166         #define HAS_FLIGHT              1
167         #define HAS_USB                 1
168         #define HAS_BEEP                1
169         #define HAS_GPS                 1
170         #define HAS_SERIAL_1            1
171         #define USE_SERIAL_STDIN        0
172         #define HAS_ADC                 1
173         #define HAS_DBG                 0
174         #define HAS_EEPROM              1
175         #define USE_INTERNAL_FLASH      0
176         #define DBG_ON_P1               0
177         #define DBG_ON_P0               1
178         #define IGNITE_ON_P2            1
179         #define IGNITE_ON_P0            0
180         #define PACKET_HAS_MASTER       0
181         #define PACKET_HAS_SLAVE        1
182         #define AO_LED_RED              2
183         #define AO_LED_GREEN            1
184         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
185         #define HAS_EXTERNAL_TEMP       1
186         #define HAS_ACCEL_REF           0
187         #define SPI_CS_ON_P1            1
188         #define SPI_CS_ON_P0            0
189         #define HAS_ACCEL               1
190         #define HAS_IGNITE              1
191         #define HAS_MONITOR             0
192 #endif
193
194 #if defined(TELEDONGLE_V_0_1)
195         #define HAS_FLIGHT              0
196         #define HAS_USB                 1
197         #define HAS_BEEP                0
198         #define HAS_SERIAL_1            0
199         #define USE_SERIAL_STDIN        0
200         #define HAS_ADC                 0
201         #define HAS_DBG                 0
202         #define HAS_EEPROM              0
203         #define DBG_ON_P1               0
204         #define DBG_ON_P0               1
205         #define IGNITE_ON_P2            0
206         #define IGNITE_ON_P0            0
207         #define PACKET_HAS_MASTER       1
208         #define PACKET_HAS_SLAVE        0
209         #define AO_LED_RED              2
210         #define AO_LED_GREEN            1
211         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
212         #define SPI_CS_ON_P1            0
213         #define SPI_CS_ON_P0            1
214         #define HAS_IGNITE              0
215         #define HAS_MONITOR             1
216         #define HAS_AES                 1
217 #endif
218
219 #if defined(TIDONGLE)
220         #define HAS_FLIGHT              0
221         #define HAS_USB                 1
222         #define HAS_BEEP                0
223         #define HAS_SERIAL_1            0
224         #define USE_SERIAL_STDIN        0
225         #define HAS_ADC                 0
226         #define HAS_DBG                 1
227         #define HAS_EEPROM              0
228         #define DBG_ON_P1               0
229         #define DBG_ON_P0               1
230         #define IGNITE_ON_P2            0
231         #define IGNITE_ON_P0            0
232         #define PACKET_HAS_MASTER       1
233         #define PACKET_HAS_SLAVE        0
234         #define AO_LED_RED              2
235         #define LEDS_AVAILABLE          (AO_LED_RED)
236         #define SPI_CS_ON_P1            0
237         #define SPI_CS_ON_P0            1
238         #define HAS_IGNITE              0
239         #define HAS_MONITOR             1
240         #define HAS_AES                 1
241 #endif
242
243 #if defined(TELEBT_V_0_0)
244         #define HAS_FLIGHT              0
245         #define HAS_USB                 1
246         #define HAS_BEEP                0
247         #define HAS_SERIAL_1            1
248         #define USE_SERIAL_STDIN        1
249         #define HAS_ADC                 0
250         #define HAS_DBG                 1
251         #define HAS_EEPROM              0
252         #define HAS_BTM                 1
253         #define DBG_ON_P1               0
254         #define DBG_ON_P0               1
255         #define IGNITE_ON_P2            0
256         #define IGNITE_ON_P0            0
257         #define PACKET_HAS_MASTER       1
258         #define PACKET_HAS_SLAVE        0
259         #define AO_LED_RED              2
260         #define AO_LED_GREEN            1
261         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
262         #define SPI_CS_ON_P1            1
263         #define SPI_CS_ON_P0            0
264         #define HAS_IGNITE              0
265         #define BT_LINK_ON_P2           1
266         #define BT_LINK_ON_P1           0
267         #define BT_LINK_PIN_INDEX       7
268         #define BT_LINK_PIN             P2_1
269         #define HAS_MONITOR             1
270         #define HAS_AES                 1
271 #endif
272
273 #if defined(TELEBT_V_0_1)
274         #define HAS_FLIGHT              0
275         #define HAS_USB                 1
276         #define HAS_BEEP                1
277         #define HAS_SERIAL_1            1
278         #define HAS_SERIAL_1_ALT_1      1
279         #define HAS_SERIAL_1_ALT_2      0
280         #define HAS_SERIAL_1_HW_FLOW    1
281         #define USE_SERIAL_STDIN        1
282         #define HAS_ADC                 0
283         #define HAS_DBG                 1
284         #define HAS_EEPROM              1
285         #define USE_INTERNAL_FLASH      0
286         #define HAS_BTM                 1
287         #define DBG_ON_P1               1
288         #define DBG_ON_P0               0
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              1
294         #define AO_LED_GREEN            2
295         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
296         #define SPI_CS_ON_P1            1
297         #define SPI_CS_ON_P0            0
298         #define M25_CS_MASK             0x04    /* CS0 is P1_2 */
299         #define M25_MAX_CHIPS           1
300         #define HAS_ACCEL               0
301         #define HAS_IGNITE              0
302         #define BT_LINK_ON_P2           0
303         #define BT_LINK_ON_P1           1
304         #define BT_LINK_PIN_INDEX       7
305         #define BT_LINK_PIN             P1_7
306         #define HAS_MONITOR             1
307         #define HAS_AES                 1
308 #endif
309
310 #if defined(TELELAUNCH_V_0_1)
311         #define HAS_FLIGHT              0
312         #define HAS_USB                 1
313         #define HAS_BEEP                1
314         #define HAS_GPS                 0
315         #define HAS_SERIAL_1            1
316         #define USE_SERIAL_STDIN        0
317         #define HAS_ADC                 1
318         #define HAS_DBG                 0
319         #define HAS_EEPROM              1
320         #define USE_INTERNAL_FLASH      0
321         #define DBG_ON_P1               0
322         #define DBG_ON_P0               1
323         #define IGNITE_ON_P2            1
324         #define IGNITE_ON_P0            0
325         #define PACKET_HAS_MASTER       0
326         #define PACKET_HAS_SLAVE        0
327         #define AO_LED_RED              2
328         #define AO_LED_GREEN            1
329         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
330         #define HAS_EXTERNAL_TEMP       1
331         #define HAS_ACCEL_REF           0
332         #define SPI_CS_ON_P1            1
333         #define SPI_CS_ON_P0            0
334         #define HAS_ACCEL               0
335         #define HAS_IGNITE              1
336         #define HAS_MONITOR             0
337         #define HAS_AES                 1
338 #endif
339
340 #if DBG_ON_P1
341
342         #define DBG_CLOCK       (1 << 4)        /* mi0 */
343         #define DBG_DATA        (1 << 5)        /* mo0 */
344         #define DBG_RESET_N     (1 << 3)        /* c0 */
345
346         #define DBG_CLOCK_PIN   (P1_4)
347         #define DBG_DATA_PIN    (P1_5)
348         #define DBG_RESET_N_PIN (P1_3)
349
350         #define DBG_PORT_NUM    1
351         #define DBG_PORT        P1
352         #define DBG_PORT_SEL    P1SEL
353         #define DBG_PORT_INP    P1INP
354         #define DBG_PORT_DIR    P1DIR
355
356 #endif /* DBG_ON_P1 */
357
358 #if DBG_ON_P0
359
360         #define DBG_CLOCK       (1 << 3)
361         #define DBG_DATA        (1 << 4)
362         #define DBG_RESET_N     (1 << 5)
363
364         #define DBG_CLOCK_PIN   (P0_3)
365         #define DBG_DATA_PIN    (P0_4)
366         #define DBG_RESET_N_PIN (P0_5)
367
368         #define DBG_PORT_NUM    0
369         #define DBG_PORT        P0
370         #define DBG_PORT_SEL    P0SEL
371         #define DBG_PORT_INP    P0INP
372         #define DBG_PORT_DIR    P0DIR
373
374 #endif /* DBG_ON_P0 */
375
376 #if COMPANION_CS_ON_P1
377         #define COMPANION_CS_PORT       P1
378         #define COMPANION_CS_SEL        P1SEL
379         #define COMPANION_CS_DIR        P1DIR
380 #endif
381
382 #if SPI_CS_ON_P1
383         #define SPI_CS_PORT     P1
384         #define SPI_CS_SEL      P1SEL
385         #define SPI_CS_DIR      P1DIR
386 #endif
387
388 #if SPI_CS_ON_P0
389         #define SPI_CS_PORT     P0
390         #define SPI_CS_SEL      P0SEL
391         #define SPI_CS_DIR      P0DIR
392 #endif
393
394 #ifndef IGNITE_ON_P2
395 #error Please define IGNITE_ON_P2
396 #endif
397
398 #ifndef IGNITE_ON_P0
399 #error Please define IGNITE_ON_P0
400 #endif
401
402 #ifndef HAS_SERIAL_1
403 #error Please define HAS_SERIAL_1
404 #endif
405
406 #ifndef USE_SERIAL_STDIN
407 #error Please define USE_SERIAL_STDIN
408 #endif
409
410 #ifndef HAS_ADC
411 #error Please define HAS_ADC
412 #endif
413
414 #ifndef HAS_EEPROM
415 #error Please define HAS_EEPROM
416 #endif
417
418 #if HAS_EEPROM
419 #ifndef USE_INTERNAL_FLASH
420 #error Please define USE_INTERNAL_FLASH
421 #endif
422 #endif
423
424 #ifndef HAS_DBG
425 #error Please define HAS_DBG
426 #endif
427
428 #ifndef HAS_IGNITE
429 #error Please define HAS_IGNITE
430 #endif
431
432 #ifndef PACKET_HAS_MASTER
433 #error Please define PACKET_HAS_MASTER
434 #endif
435
436 #ifndef PACKET_HAS_SLAVE
437 #error Please define PACKET_HAS_SLAVE
438 #endif
439
440 #ifndef HAS_MONITOR
441 #error Please define HAS_MONITOR
442 #endif
443
444 #ifndef HAS_ADC
445 #error Please define HAS_ADC
446 #endif
447
448 #if HAS_ADC
449
450 #if HAS_ACCEL
451 #ifndef HAS_ACCEL_REF
452 #error Please define HAS_ACCEL_REF
453 #endif
454 #else
455 #define HAS_ACCEL_REF 0
456 #endif
457
458 #endif /* HAS_ADC */
459
460 #endif /* _AO_PINS_H_ */