Change altos build process to support per-product compile-time changes
[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_0_2)
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
31         #define LEDS_AVAILABLE          (AO_LED_RED)
32         #define HAS_EXTERNAL_TEMP       0
33 #endif
34
35 #if defined(TELEDONGLE_V_0_2)
36         #define HAS_SERIAL_1            0
37         #define HAS_ADC                 0
38         #define HAS_DBG                 1
39         #define HAS_EEPROM              0
40         #define DBG_ON_P1               1
41         #define DBG_ON_P0               0
42         #define PACKET_HAS_MASTER       1
43         #define PACKET_HAS_SLAVE        0
44         #define LEDS_AVAILABLE          (AO_LED_RED)
45 #endif
46
47 #if defined(TELEMETRUM_V_0_1)
48         #define HAS_SERIAL_1            1
49         #define HAS_ADC                 1
50         #define HAS_DBG                 0
51         #define HAS_EEPROM              1
52         #define DBG_ON_P1               0
53         #define DBG_ON_P0               1
54         #define PACKET_HAS_MASTER       0
55         #define PACKET_HAS_SLAVE        1
56         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
57         #define HAS_EXTERNAL_TEMP       1
58 #endif
59
60 #if defined(TELEDONGLE_V_0_1)
61         #define HAS_SERIAL_1            0
62         #define HAS_ADC                 0
63         #define HAS_DBG                 0
64         #define HAS_EEPROM              0
65         #define DBG_ON_P1               0
66         #define DBG_ON_P0               1
67         #define PACKET_HAS_MASTER       1
68         #define PACKET_HAS_SLAVE        0
69         #define LEDS_AVAILABLE          (AO_LED_RED|AO_LED_GREEN)
70 #endif
71
72 #if defined(TIDONGLE)
73         #define HAS_SERIAL_1            0
74         #define HAS_ADC                 0
75         #define HAS_DBG                 1
76         #define HAS_EEPROM              0
77         #define DBG_ON_P1               0
78         #define DBG_ON_P0               1
79         #define PACKET_HAS_MASTER       1
80         #define PACKET_HAS_SLAVE        0
81         #define LEDS_AVAILABLE          (AO_LED_RED)
82 #endif
83
84 #if DBG_ON_P1
85
86         #define DBG_CLOCK       (1 << 4)        /* mi0 */
87         #define DBG_DATA        (1 << 5)        /* mo0 */
88         #define DBG_RESET_N     (1 << 3)        /* c0 */
89
90         #define DBG_CLOCK_PIN   (P1_4)
91         #define DBG_DATA_PIN    (P1_5)
92         #define DBG_RESET_N_PIN (P1_3)
93
94         #define DBG_PORT_NUM    1
95         #define DBG_PORT        P1
96         #define DBG_PORT_SEL    P1SEL
97         #define DBG_PORT_INP    P1INP
98         #define DBG_PORT_DIR    P1DIR
99
100 #endif /* DBG_ON_P1 */
101
102 #if DBG_ON_P0
103
104         #define DBG_CLOCK       (1 << 3)
105         #define DBG_DATA        (1 << 4)
106         #define DBG_RESET_N     (1 << 5)
107
108         #define DBG_CLOCK_PIN   (P0_3)
109         #define DBG_DATA_PIN    (P0_4)
110         #define DBG_RESET_N_PIN (P0_5)
111
112         #define DBG_PORT_NUM    0
113         #define DBG_PORT        P0
114         #define DBG_PORT_SEL    P0SEL
115         #define DBG_PORT_INP    P0INP
116         #define DBG_PORT_DIR    P0DIR
117
118 #endif /* DBG_ON_P0 */
119
120 #ifndef HAS_SERIAL_1
121 #error Please define HAS_SERIAL_1
122 #endif
123
124 #ifndef HAS_ADC
125 #error Please define HAS_ADC
126 #endif
127
128 #ifndef HAS_EEPROM
129 #error Please define HAS_EEPROM
130 #endif
131
132 #ifndef HAS_DBG
133 #error Please define HAS_DBG
134 #endif
135
136 #ifndef PACKET_HAS_MASTER
137 #error Please define PACKET_HAS_MASTER
138 #endif
139
140 #ifndef PACKET_HAS_SLAVE
141 #error Please define PACKET_HAS_SLAVE
142 #endif
143
144 #endif /* _AO_PINS_H_ */