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