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