diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_LC/board.h')
-rw-r--r-- | lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_LC/board.h | 280 |
1 files changed, 280 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_LC/board.h b/lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_LC/board.h new file mode 100644 index 000000000..6bfe094ce --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_LC/board.h | |||
@@ -0,0 +1,280 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2016 flabbergast <[email protected]> | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #ifndef _BOARD_H_ | ||
18 | #define _BOARD_H_ | ||
19 | |||
20 | /* | ||
21 | * Setup for the PJRC Teensy LC board. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * Board identifier. | ||
26 | */ | ||
27 | #define BOARD_PJRC_TEENSY_LC | ||
28 | #define BOARD_NAME "PJRC Teensy LC" | ||
29 | |||
30 | /* External 16 MHz crystal */ | ||
31 | #define KINETIS_XTAL_FREQUENCY 16000000UL | ||
32 | |||
33 | /* Use internal capacitors for the crystal */ | ||
34 | #define KINETIS_BOARD_OSCILLATOR_SETTING OSC_CR_SC8P|OSC_CR_SC2P|OSC_CR_ERCLKEN | ||
35 | |||
36 | /* | ||
37 | * MCU type | ||
38 | */ | ||
39 | #define KL26 | ||
40 | |||
41 | /* | ||
42 | * IO pins assignments. | ||
43 | */ | ||
44 | #define PORTA_PIN0 0 | ||
45 | #define TEENSY_PIN3 1 | ||
46 | #define TEENSY_PIN4 2 | ||
47 | #define PORTA_PIN3 3 | ||
48 | #define PORTA_PIN4 4 | ||
49 | #define PORTA_PIN5 5 | ||
50 | #define PORTA_PIN6 6 | ||
51 | #define PORTA_PIN7 7 | ||
52 | #define PORTA_PIN8 8 | ||
53 | #define PORTA_PIN9 9 | ||
54 | #define PORTA_PIN10 10 | ||
55 | #define PORTA_PIN11 11 | ||
56 | #define PORTA_PIN12 12 | ||
57 | #define PORTA_PIN13 13 | ||
58 | #define PORTA_PIN14 14 | ||
59 | #define PORTA_PIN15 15 | ||
60 | #define PORTA_PIN16 16 | ||
61 | #define PORTA_PIN17 17 | ||
62 | #define PORTA_PIN18 18 | ||
63 | #define PORTA_PIN19 19 | ||
64 | #define PORTA_PIN20 20 | ||
65 | #define PORTA_PIN21 21 | ||
66 | #define PORTA_PIN22 22 | ||
67 | #define PORTA_PIN23 23 | ||
68 | #define PORTA_PIN24 24 | ||
69 | #define PORTA_PIN25 25 | ||
70 | #define PORTA_PIN26 26 | ||
71 | #define PORTA_PIN27 27 | ||
72 | #define PORTA_PIN28 28 | ||
73 | #define PORTA_PIN29 29 | ||
74 | #define PORTA_PIN30 30 | ||
75 | #define PORTA_PIN31 31 | ||
76 | |||
77 | #define TEENSY_PIN3_IOPORT IOPORT1 | ||
78 | #define TEENSY_PIN4_IOPORT IOPORT1 | ||
79 | |||
80 | #define TEENSY_PIN16 0 | ||
81 | #define TEENSY_PIN17 1 | ||
82 | #define TEENSY_PIN19 2 | ||
83 | #define TEENSY_PIN18 3 | ||
84 | #define PORTB_PIN4 4 | ||
85 | #define PORTB_PIN5 5 | ||
86 | #define PORTB_PIN6 6 | ||
87 | #define PORTB_PIN7 7 | ||
88 | #define PORTB_PIN8 8 | ||
89 | #define PORTB_PIN9 9 | ||
90 | #define PORTB_PIN10 10 | ||
91 | #define PORTB_PIN11 11 | ||
92 | #define PORTB_PIN12 12 | ||
93 | #define PORTB_PIN13 13 | ||
94 | #define PORTB_PIN14 14 | ||
95 | #define PORTB_PIN15 15 | ||
96 | #define TEENSY_PIN0 16 | ||
97 | #define TEENSY_PIN1 17 | ||
98 | #define PORTB_PIN18 18 | ||
99 | #define PORTB_PIN19 19 | ||
100 | #define PORTB_PIN20 20 | ||
101 | #define PORTB_PIN21 21 | ||
102 | #define PORTB_PIN22 22 | ||
103 | #define PORTB_PIN23 23 | ||
104 | #define PORTB_PIN24 24 | ||
105 | #define PORTB_PIN25 25 | ||
106 | #define PORTB_PIN26 26 | ||
107 | #define PORTB_PIN27 27 | ||
108 | #define PORTB_PIN28 28 | ||
109 | #define PORTB_PIN29 29 | ||
110 | #define PORTB_PIN30 30 | ||
111 | #define PORTB_PIN31 31 | ||
112 | |||
113 | #define TEENSY_PIN0_IOPORT IOPORT2 | ||
114 | #define TEENSY_PIN1_IOPORT IOPORT2 | ||
115 | #define TEENSY_PIN16_IOPORT IOPORT2 | ||
116 | #define TEENSY_PIN17_IOPORT IOPORT2 | ||
117 | #define TEENSY_PIN18_IOPORT IOPORT2 | ||
118 | #define TEENSY_PIN19_IOPORT IOPORT2 | ||
119 | |||
120 | #define TEENSY_PIN15 0 | ||
121 | #define TEENSY_PIN22 1 | ||
122 | #define TEENSY_PIN23 2 | ||
123 | #define TEENSY_PIN9 3 | ||
124 | #define TEENSY_PIN10 4 | ||
125 | #define TEENSY_PIN13 5 | ||
126 | #define TEENSY_PIN11 6 | ||
127 | #define TEENSY_PIN12 7 | ||
128 | #define PORTC_PIN8 8 | ||
129 | #define PORTC_PIN9 9 | ||
130 | #define PORTC_PIN10 10 | ||
131 | #define PORTC_PIN11 11 | ||
132 | #define PORTC_PIN12 12 | ||
133 | #define PORTC_PIN13 13 | ||
134 | #define PORTC_PIN14 14 | ||
135 | #define PORTC_PIN15 15 | ||
136 | #define PORTC_PIN16 16 | ||
137 | #define PORTC_PIN17 17 | ||
138 | #define PORTC_PIN18 18 | ||
139 | #define PORTC_PIN19 19 | ||
140 | #define PORTC_PIN20 20 | ||
141 | #define PORTC_PIN21 21 | ||
142 | #define PORTC_PIN22 22 | ||
143 | #define PORTC_PIN23 23 | ||
144 | #define PORTC_PIN24 24 | ||
145 | #define PORTC_PIN25 25 | ||
146 | #define PORTC_PIN26 26 | ||
147 | #define PORTC_PIN27 27 | ||
148 | #define PORTC_PIN28 28 | ||
149 | #define PORTC_PIN29 29 | ||
150 | #define PORTC_PIN30 30 | ||
151 | #define PORTC_PIN31 31 | ||
152 | |||
153 | #define TEENSY_PIN9_IOPORT IOPORT3 | ||
154 | #define TEENSY_PIN10_IOPORT IOPORT3 | ||
155 | #define TEENSY_PIN11_IOPORT IOPORT3 | ||
156 | #define TEENSY_PIN12_IOPORT IOPORT3 | ||
157 | #define TEENSY_PIN13_IOPORT IOPORT3 | ||
158 | #define TEENSY_PIN15_IOPORT IOPORT3 | ||
159 | #define TEENSY_PIN22_IOPORT IOPORT3 | ||
160 | #define TEENSY_PIN23_IOPORT IOPORT3 | ||
161 | |||
162 | #define TEENSY_PIN2 0 | ||
163 | #define TEENSY_PIN14 1 | ||
164 | #define TEENSY_PIN7 2 | ||
165 | #define TEENSY_PIN8 3 | ||
166 | #define TEENSY_PIN6 4 | ||
167 | #define TEENSY_PIN20 5 | ||
168 | #define TEENSY_PIN21 6 | ||
169 | #define TEENSY_PIN5 7 | ||
170 | #define PORTD_PIN8 8 | ||
171 | #define PORTD_PIN9 9 | ||
172 | #define PORTD_PIN10 10 | ||
173 | #define PORTD_PIN11 11 | ||
174 | #define PORTD_PIN12 12 | ||
175 | #define PORTD_PIN13 13 | ||
176 | #define PORTD_PIN14 14 | ||
177 | #define PORTD_PIN15 15 | ||
178 | #define PORTD_PIN16 16 | ||
179 | #define PORTD_PIN17 17 | ||
180 | #define PORTD_PIN18 18 | ||
181 | #define PORTD_PIN19 19 | ||
182 | #define PORTD_PIN20 20 | ||
183 | #define PORTD_PIN21 21 | ||
184 | #define PORTD_PIN22 22 | ||
185 | #define PORTD_PIN23 23 | ||
186 | #define PORTD_PIN24 24 | ||
187 | #define PORTD_PIN25 25 | ||
188 | #define PORTD_PIN26 26 | ||
189 | #define PORTD_PIN27 27 | ||
190 | #define PORTD_PIN28 28 | ||
191 | #define PORTD_PIN29 29 | ||
192 | #define PORTD_PIN30 30 | ||
193 | #define PORTD_PIN31 31 | ||
194 | |||
195 | #define TEENSY_PIN2_IOPORT IOPORT4 | ||
196 | #define TEENSY_PIN5_IOPORT IOPORT4 | ||
197 | #define TEENSY_PIN6_IOPORT IOPORT4 | ||
198 | #define TEENSY_PIN7_IOPORT IOPORT4 | ||
199 | #define TEENSY_PIN8_IOPORT IOPORT4 | ||
200 | #define TEENSY_PIN14_IOPORT IOPORT4 | ||
201 | #define TEENSY_PIN20_IOPORT IOPORT4 | ||
202 | #define TEENSY_PIN21_IOPORT IOPORT4 | ||
203 | |||
204 | #define PORTE_PIN0 0 | ||
205 | #define PORTE_PIN1 1 | ||
206 | #define PORTE_PIN2 2 | ||
207 | #define PORTE_PIN3 3 | ||
208 | #define PORTE_PIN4 4 | ||
209 | #define PORTE_PIN5 5 | ||
210 | #define PORTE_PIN6 6 | ||
211 | #define PORTE_PIN7 7 | ||
212 | #define PORTE_PIN8 8 | ||
213 | #define PORTE_PIN9 9 | ||
214 | #define PORTE_PIN10 10 | ||
215 | #define PORTE_PIN11 11 | ||
216 | #define PORTE_PIN12 12 | ||
217 | #define PORTE_PIN13 13 | ||
218 | #define PORTE_PIN14 14 | ||
219 | #define PORTE_PIN15 15 | ||
220 | #define PORTE_PIN16 16 | ||
221 | #define PORTE_PIN17 17 | ||
222 | #define PORTE_PIN18 18 | ||
223 | #define PORTE_PIN19 19 | ||
224 | #define TEENSY_PIN24 20 | ||
225 | #define TEENSY_PIN25 21 | ||
226 | #define PORTE_PIN22 22 | ||
227 | #define PORTE_PIN23 23 | ||
228 | #define PORTE_PIN24 24 | ||
229 | #define PORTE_PIN25 25 | ||
230 | #define PORTE_PIN26 26 | ||
231 | #define PORTE_PIN27 27 | ||
232 | #define PORTE_PIN28 28 | ||
233 | #define PORTE_PIN29 29 | ||
234 | #define TEENSY_PIN26 30 | ||
235 | #define PORTE_PIN31 31 | ||
236 | |||
237 | #define TEENSY_PIN24_IOPORT IOPORT5 | ||
238 | #define TEENSY_PIN25_IOPORT IOPORT5 | ||
239 | #define TEENSY_PIN26_IOPORT IOPORT5 | ||
240 | |||
241 | #define LINE_PIN0 PAL_LINE(TEENSY_PIN0_IOPORT, TEENSY_PIN0) | ||
242 | #define LINE_PIN1 PAL_LINE(TEENSY_PIN1_IOPORT, TEENSY_PIN1) | ||
243 | #define LINE_PIN2 PAL_LINE(TEENSY_PIN2_IOPORT, TEENSY_PIN2) | ||
244 | #define LINE_PIN3 PAL_LINE(TEENSY_PIN3_IOPORT, TEENSY_PIN3) | ||
245 | #define LINE_PIN4 PAL_LINE(TEENSY_PIN4_IOPORT, TEENSY_PIN4) | ||
246 | #define LINE_PIN5 PAL_LINE(TEENSY_PIN5_IOPORT, TEENSY_PIN5) | ||
247 | #define LINE_PIN6 PAL_LINE(TEENSY_PIN6_IOPORT, TEENSY_PIN6) | ||
248 | #define LINE_PIN7 PAL_LINE(TEENSY_PIN7_IOPORT, TEENSY_PIN7) | ||
249 | #define LINE_PIN8 PAL_LINE(TEENSY_PIN8_IOPORT, TEENSY_PIN8) | ||
250 | #define LINE_PIN9 PAL_LINE(TEENSY_PIN9_IOPORT, TEENSY_PIN9) | ||
251 | #define LINE_PIN10 PAL_LINE(TEENSY_PIN10_IOPORT, TEENSY_PIN10) | ||
252 | #define LINE_PIN11 PAL_LINE(TEENSY_PIN11_IOPORT, TEENSY_PIN11) | ||
253 | #define LINE_PIN12 PAL_LINE(TEENSY_PIN12_IOPORT, TEENSY_PIN12) | ||
254 | #define LINE_PIN13 PAL_LINE(TEENSY_PIN13_IOPORT, TEENSY_PIN13) | ||
255 | #define LINE_PIN14 PAL_LINE(TEENSY_PIN14_IOPORT, TEENSY_PIN14) | ||
256 | #define LINE_PIN15 PAL_LINE(TEENSY_PIN15_IOPORT, TEENSY_PIN15) | ||
257 | #define LINE_PIN16 PAL_LINE(TEENSY_PIN16_IOPORT, TEENSY_PIN16) | ||
258 | #define LINE_PIN17 PAL_LINE(TEENSY_PIN17_IOPORT, TEENSY_PIN17) | ||
259 | #define LINE_PIN18 PAL_LINE(TEENSY_PIN18_IOPORT, TEENSY_PIN18) | ||
260 | #define LINE_PIN19 PAL_LINE(TEENSY_PIN19_IOPORT, TEENSY_PIN19) | ||
261 | #define LINE_PIN20 PAL_LINE(TEENSY_PIN20_IOPORT, TEENSY_PIN20) | ||
262 | #define LINE_PIN21 PAL_LINE(TEENSY_PIN21_IOPORT, TEENSY_PIN21) | ||
263 | #define LINE_PIN22 PAL_LINE(TEENSY_PIN22_IOPORT, TEENSY_PIN22) | ||
264 | #define LINE_PIN23 PAL_LINE(TEENSY_PIN23_IOPORT, TEENSY_PIN23) | ||
265 | #define LINE_PIN24 PAL_LINE(TEENSY_PIN24_IOPORT, TEENSY_PIN24) | ||
266 | #define LINE_PIN25 PAL_LINE(TEENSY_PIN25_IOPORT, TEENSY_PIN25) | ||
267 | |||
268 | #define LINE_LED LINE_PIN13 | ||
269 | |||
270 | #if !defined(_FROM_ASM_) | ||
271 | #ifdef __cplusplus | ||
272 | extern "C" { | ||
273 | #endif | ||
274 | void boardInit(void); | ||
275 | #ifdef __cplusplus | ||
276 | } | ||
277 | #endif | ||
278 | #endif /* _FROM_ASM_ */ | ||
279 | |||
280 | #endif /* _BOARD_H_ */ | ||