altos: Add nickle kalman implementation.
[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 HAS_EEPROM              1
29         #define USE_INTERNAL_FLASH      0
30         #define HAS_DBG                 1
31         #define USE_KALMAN              0
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 AO_LED_RED              1
40         #define LEDS_AVAILABLE          (AO_LED_RED)
41         #define HAS_EXTERNAL_TEMP       0
42         #define HAS_ACCEL_REF           0
43         #define HAS_ACCEL               1
44 #endif
45
46 #if defined(TELEMETRUM_V_1_1)
47         #define HAS_FLIGHT              1
48         #define HAS_USB                 1
49         #define HAS_BEEP                1
50         #define HAS_GPS                 1
51         #define HAS_SERIAL_1            1
52         #define HAS_ADC                 1
53         #define HAS_EEPROM              1
54         #define USE_INTERNAL_FLASH      0
55         #define HAS_DBG                 1
56         #define USE_KALMAN              0
57         #define DBG_ON_P1               1
58         #define DBG_ON_P0               0
59         #define IGNITE_ON_P2            1
60         #define IGNITE_ON_P0            0
61         #define PACKET_HAS_MASTER       0
62         #define PACKET_HAS_SLAVE        1
63
64         #define AO_LED_RED              1
65         #define LEDS_AVAILABLE          (AO_LED_RED)
66         #define HAS_EXTERNAL_TEMP       0
67         #define HAS_ACCEL_REF           1
68         #define SPI_CS_ON_P1            1
69         #define SPI_CS_ON_P0            0
70         #define M25_CS_MASK             0x02    /* CS0 is P1_1 */
71         #define M25_MAX_CHIPS           1
72         #define HAS_ACCEL               1
73 #endif
74
75 #if defined(TELEDONGLE_V_0_2)
76         #define HAS_FLIGHT              0
77         #define HAS_USB                 1
78         #define HAS_BEEP                0
79         #define HAS_SERIAL_1            0
80         #define HAS_ADC                 0
81         #define HAS_DBG                 1
82         #define HAS_EEPROM              0
83         #define DBG_ON_P1               1
84         #define DBG_ON_P0               0
85         #define IGNITE_ON_P2            0
86         #define IGNITE_ON_P0            0
87         #define PACKET_HAS_MASTER       1
88         #define PACKET_HAS_SLAVE        0
89         #define AO_LED_RED              1
90         #define AO_LED_GREEN            2
91         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
92         #define SPI_CS_ON_P1            1
93         #define SPI_CS_ON_P0            0
94 #endif
95
96 #if defined(TELEMINI_V_0_1)
97         #define HAS_FLIGHT              1
98         #define HAS_USB                 0
99         #define HAS_BEEP                0
100         #define HAS_GPS                 0
101         #define HAS_SERIAL_1            0
102         #define HAS_ADC                 1
103         #define HAS_EEPROM              1
104         #define USE_INTERNAL_FLASH      1
105         #define HAS_DBG                 0
106         #define USE_KALMAN              1
107         #define IGNITE_ON_P2            0
108         #define IGNITE_ON_P0            1
109         #define PACKET_HAS_MASTER       0
110         #define PACKET_HAS_SLAVE        1
111
112         #define AO_LED_GREEN            1
113         #define AO_LED_RED              2
114         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
115         #define HAS_EXTERNAL_TEMP       0
116         #define HAS_ACCEL               0
117 #endif
118
119 #if defined(TELENANO_V_0_1)
120         #define HAS_FLIGHT              1
121         #define HAS_USB                 0
122         #define HAS_BEEP                0
123         #define HAS_GPS                 0
124         #define HAS_SERIAL_1            0
125         #define HAS_ADC                 1
126         #define HAS_EEPROM              1
127         #define USE_INTERNAL_FLASH      1
128         #define HAS_DBG                 0
129         #define USE_KALMAN              1
130         #define IGNITE_ON_P2            0
131         #define IGNITE_ON_P0            1
132         #define PACKET_HAS_MASTER       0
133         #define PACKET_HAS_SLAVE        1
134
135         #define AO_LED_GREEN            1
136         #define AO_LED_RED              2
137         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
138         #define HAS_EXTERNAL_TEMP       0
139         #define HAS_ACCEL               0
140 #endif
141
142 #if defined(TELEMETRUM_V_0_1)
143         #define HAS_FLIGHT              1
144         #define HAS_USB                 1
145         #define HAS_BEEP                1
146         #define HAS_GPS                 1
147         #define HAS_SERIAL_1            1
148         #define HAS_ADC                 1
149         #define HAS_DBG                 0
150         #define USE_KALMAN              0
151         #define HAS_EEPROM              1
152         #define USE_INTERNAL_FLASH      0
153         #define DBG_ON_P1               0
154         #define DBG_ON_P0               1
155         #define IGNITE_ON_P2            1
156         #define IGNITE_ON_P0            0
157         #define PACKET_HAS_MASTER       0
158         #define PACKET_HAS_SLAVE        1
159         #define AO_LED_RED              2
160         #define AO_LED_GREEN            1
161         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
162         #define HAS_EXTERNAL_TEMP       1
163         #define HAS_ACCEL_REF           0
164         #define SPI_CS_ON_P1            1
165         #define SPI_CS_ON_P0            0
166         #define HAS_ACCEL               1
167 #endif
168
169 #if defined(TELEDONGLE_V_0_1)
170         #define HAS_FLIGHT              0
171         #define HAS_USB                 1
172         #define HAS_BEEP                0
173         #define HAS_SERIAL_1            0
174         #define HAS_ADC                 0
175         #define HAS_DBG                 0
176         #define HAS_EEPROM              0
177         #define DBG_ON_P1               0
178         #define DBG_ON_P0               1
179         #define IGNITE_ON_P2            0
180         #define IGNITE_ON_P0            0
181         #define PACKET_HAS_MASTER       1
182         #define PACKET_HAS_SLAVE        0
183         #define AO_LED_RED              2
184         #define AO_LED_GREEN            1
185         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
186         #define SPI_CS_ON_P1            0
187         #define SPI_CS_ON_P0            1
188 #endif
189
190 #if defined(TIDONGLE)
191         #define HAS_FLIGHT              0
192         #define HAS_USB                 1
193         #define HAS_BEEP                0
194         #define HAS_SERIAL_1            0
195         #define HAS_ADC                 0
196         #define HAS_DBG                 1
197         #define HAS_EEPROM              0
198         #define DBG_ON_P1               0
199         #define DBG_ON_P0               1
200         #define IGNITE_ON_P2            0
201         #define IGNITE_ON_P0            0
202         #define PACKET_HAS_MASTER       1
203         #define PACKET_HAS_SLAVE        0
204         #define AO_LED_RED              2
205         #define LEDS_AVAILABLE          (AO_LED_RED)
206         #define SPI_CS_ON_P1            0
207         #define SPI_CS_ON_P0            1
208 #endif
209
210 #if DBG_ON_P1
211
212         #define DBG_CLOCK       (1 << 4)        /* mi0 */
213         #define DBG_DATA        (1 << 5)        /* mo0 */
214         #define DBG_RESET_N     (1 << 3)        /* c0 */
215
216         #define DBG_CLOCK_PIN   (P1_4)
217         #define DBG_DATA_PIN    (P1_5)
218         #define DBG_RESET_N_PIN (P1_3)
219
220         #define DBG_PORT_NUM    1
221         #define DBG_PORT        P1
222         #define DBG_PORT_SEL    P1SEL
223         #define DBG_PORT_INP    P1INP
224         #define DBG_PORT_DIR    P1DIR
225
226 #endif /* DBG_ON_P1 */
227
228 #if DBG_ON_P0
229
230         #define DBG_CLOCK       (1 << 3)
231         #define DBG_DATA        (1 << 4)
232         #define DBG_RESET_N     (1 << 5)
233
234         #define DBG_CLOCK_PIN   (P0_3)
235         #define DBG_DATA_PIN    (P0_4)
236         #define DBG_RESET_N_PIN (P0_5)
237
238         #define DBG_PORT_NUM    0
239         #define DBG_PORT        P0
240         #define DBG_PORT_SEL    P0SEL
241         #define DBG_PORT_INP    P0INP
242         #define DBG_PORT_DIR    P0DIR
243
244 #endif /* DBG_ON_P0 */
245
246 #if SPI_CS_ON_P1
247         #define SPI_CS_PORT     P1
248         #define SPI_CS_SEL      P1SEL
249         #define SPI_CS_DIR      P1DIR
250 #endif
251
252 #if SPI_CS_ON_P0
253         #define SPI_CS_PORT     P0
254         #define SPI_CS_SEL      P0SEL
255         #define SPI_CS_DIR      P0DIR
256 #endif
257
258 #ifndef IGNITE_ON_P2
259 #error Please define IGNITE_ON_P2
260 #endif
261
262 #ifndef IGNITE_ON_P0
263 #error Please define IGNITE_ON_P0
264 #endif
265
266 #ifndef HAS_SERIAL_1
267 #error Please define HAS_SERIAL_1
268 #endif
269
270 #ifndef HAS_ADC
271 #error Please define HAS_ADC
272 #endif
273
274 #ifndef HAS_EEPROM
275 #error Please define HAS_EEPROM
276 #endif
277
278 #if HAS_EEPROM
279 #ifndef USE_INTERNAL_FLASH
280 #error Please define USE_INTERNAL_FLASH
281 #endif
282 #endif
283
284 #ifndef HAS_DBG
285 #error Please define HAS_DBG
286 #endif
287
288 #ifndef PACKET_HAS_MASTER
289 #error Please define PACKET_HAS_MASTER
290 #endif
291
292 #ifndef PACKET_HAS_SLAVE
293 #error Please define PACKET_HAS_SLAVE
294 #endif
295
296 #endif /* _AO_PINS_H_ */