altos: Add telemetrum-v1.1 directory
[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_SERIAL_1            1
23         #define HAS_ADC                 1
24         #define HAS_EEPROM              1
25         #define HAS_DBG                 1
26         #define DBG_ON_P1               1
27         #define DBG_ON_P0               0
28         #define PACKET_HAS_MASTER       0
29         #define PACKET_HAS_SLAVE        1
30         #define HAS_ADC_5V              0
31
32         #define AO_LED_RED              1
33         #define LEDS_AVAILABLE          (AO_LED_RED)
34         #define HAS_EXTERNAL_TEMP       0
35 #endif
36
37 #if defined(TELEMETRUM_V_1_1)
38         #define HAS_SERIAL_1            1
39         #define HAS_ADC                 1
40         #define HAS_EEPROM              1
41         #define HAS_DBG                 1
42         #define DBG_ON_P1               1
43         #define DBG_ON_P0               0
44         #define PACKET_HAS_MASTER       0
45         #define PACKET_HAS_SLAVE        1
46         #define HAS_ADC_5V              1
47
48         #define AO_LED_RED              1
49         #define LEDS_AVAILABLE          (AO_LED_RED)
50         #define HAS_EXTERNAL_TEMP       0
51 #endif
52
53 #if defined(TELEDONGLE_V_0_2)
54         #define HAS_SERIAL_1            0
55         #define HAS_ADC                 0
56         #define HAS_DBG                 1
57         #define HAS_EEPROM              0
58         #define DBG_ON_P1               1
59         #define DBG_ON_P0               0
60         #define PACKET_HAS_MASTER       1
61         #define PACKET_HAS_SLAVE        0
62         #define AO_LED_RED              1
63         #define AO_LED_GREEN            2
64         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
65 #endif
66
67 #if defined(TELEMETRUM_V_0_1)
68         #define HAS_SERIAL_1            1
69         #define HAS_ADC                 1
70         #define HAS_DBG                 0
71         #define HAS_EEPROM              1
72         #define DBG_ON_P1               0
73         #define DBG_ON_P0               1
74         #define PACKET_HAS_MASTER       0
75         #define PACKET_HAS_SLAVE        1
76         #define AO_LED_RED              2
77         #define AO_LED_GREEN            1
78         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
79         #define HAS_EXTERNAL_TEMP       1
80 #endif
81
82 #if defined(TELEDONGLE_V_0_1)
83         #define HAS_SERIAL_1            0
84         #define HAS_ADC                 0
85         #define HAS_DBG                 0
86         #define HAS_EEPROM              0
87         #define DBG_ON_P1               0
88         #define DBG_ON_P0               1
89         #define PACKET_HAS_MASTER       1
90         #define PACKET_HAS_SLAVE        0
91         #define AO_LED_RED              2
92         #define AO_LED_GREEN            1
93         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
94 #endif
95
96 #if defined(TIDONGLE)
97         #define HAS_SERIAL_1            0
98         #define HAS_ADC                 0
99         #define HAS_DBG                 1
100         #define HAS_EEPROM              0
101         #define DBG_ON_P1               0
102         #define DBG_ON_P0               1
103         #define PACKET_HAS_MASTER       1
104         #define PACKET_HAS_SLAVE        0
105         #define AO_LED_RED              2
106         #define LEDS_AVAILABLE          (AO_LED_RED)
107 #endif
108
109 #if DBG_ON_P1
110
111         #define DBG_CLOCK       (1 << 4)        /* mi0 */
112         #define DBG_DATA        (1 << 5)        /* mo0 */
113         #define DBG_RESET_N     (1 << 3)        /* c0 */
114
115         #define DBG_CLOCK_PIN   (P1_4)
116         #define DBG_DATA_PIN    (P1_5)
117         #define DBG_RESET_N_PIN (P1_3)
118
119         #define DBG_PORT_NUM    1
120         #define DBG_PORT        P1
121         #define DBG_PORT_SEL    P1SEL
122         #define DBG_PORT_INP    P1INP
123         #define DBG_PORT_DIR    P1DIR
124
125 #endif /* DBG_ON_P1 */
126
127 #if DBG_ON_P0
128
129         #define DBG_CLOCK       (1 << 3)
130         #define DBG_DATA        (1 << 4)
131         #define DBG_RESET_N     (1 << 5)
132
133         #define DBG_CLOCK_PIN   (P0_3)
134         #define DBG_DATA_PIN    (P0_4)
135         #define DBG_RESET_N_PIN (P0_5)
136
137         #define DBG_PORT_NUM    0
138         #define DBG_PORT        P0
139         #define DBG_PORT_SEL    P0SEL
140         #define DBG_PORT_INP    P0INP
141         #define DBG_PORT_DIR    P0DIR
142
143 #endif /* DBG_ON_P0 */
144
145 #ifndef HAS_SERIAL_1
146 #error Please define HAS_SERIAL_1
147 #endif
148
149 #ifndef HAS_ADC
150 #error Please define HAS_ADC
151 #endif
152
153 #ifndef HAS_EEPROM
154 #error Please define HAS_EEPROM
155 #endif
156
157 #ifndef HAS_DBG
158 #error Please define HAS_DBG
159 #endif
160
161 #ifndef PACKET_HAS_MASTER
162 #error Please define PACKET_HAS_MASTER
163 #endif
164
165 #ifndef PACKET_HAS_SLAVE
166 #error Please define PACKET_HAS_SLAVE
167 #endif
168
169 #endif /* _AO_PINS_H_ */