aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_3_6/board.h
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-04-10 12:13:40 +0100
committerAkshay <[email protected]>2022-04-10 12:13:40 +0100
commitdc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch)
tree4ccb8fa5886b66fa9d480edef74236c27f035e16 /lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_3_6/board.h
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_3_6/board.h')
-rw-r--r--lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_3_6/board.h345
1 files changed, 345 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_3_6/board.h b/lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_3_6/board.h
new file mode 100644
index 000000000..0607d56f0
--- /dev/null
+++ b/lib/chibios-contrib/os/hal/boards/PJRC_TEENSY_3_6/board.h
@@ -0,0 +1,345 @@
1/*
2 ChibiOS - Copyright (C) 2015 RedoX https://github.com/RedoXyde
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 3.6 board.
22 */
23
24/*
25 * Board identifier.
26 */
27#define BOARD_PJRC_TEENSY_3_6
28#define BOARD_NAME "PJRC Teensy 3.6"
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 OSC0_CR_SC8P_SET(1) | OSC0_CR_SC2P_SET(1) | OSC0_CR_ERCLKEN_SET(1)
35
36/*
37 * MCU type
38 */
39#define MK66F18
40
41/*
42 * IO pins assignments.
43 */
44#define PORTA_PIN0 0
45#define PORTA_PIN1 1
46#define PORTA_PIN2 2
47#define PORTA_PIN3 3
48#define PORTA_PIN4 4
49#define TEENSY_PIN25 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 TEENSY_PIN3 12
57#define TEENSY_PIN4 13
58#define TEENSY_PIN26 14
59#define TEENSY_PIN27 15
60#define TEENSY_PIN28 16
61#define TEENSY_PIN39 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 TEENSY_PIN42 26
71#define PORTA_PIN27 27
72#define TEENSY_PIN40 28
73#define TEENSY_PIN41 29
74#define PORTA_PIN30 30
75#define PORTA_PIN31 31
76
77#define TEENSY_PIN40_IOPORT IOPORT1
78#define TEENSY_PIN41_IOPORT IOPORT1
79#define TEENSY_PIN42_IOPORT IOPORT1
80#define TEENSY_PIN3_IOPORT IOPORT1
81#define TEENSY_PIN4_IOPORT IOPORT1
82#define TEENSY_PIN25_IOPORT IOPORT1
83#define TEENSY_PIN26_IOPORT IOPORT1
84#define TEENSY_PIN27_IOPORT IOPORT1
85#define TEENSY_PIN28_IOPORT IOPORT1
86#define TEENSY_PIN39_IOPORT IOPORT1
87
88#define TEENSY_PIN16 0
89#define TEENSY_PIN17 1
90#define TEENSY_PIN19 2
91#define TEENSY_PIN18 3
92#define TEENSY_PIN49 4
93#define TEENSY_PIN50 5
94#define PORTB_PIN6 6
95#define PORTB_PIN7 7
96#define PORTB_PIN8 8
97#define PORTB_PIN9 9
98#define TEENSY_PIN31 10
99#define TEENSY_PIN32 11
100#define PORTB_PIN12 12
101#define PORTB_PIN13 13
102#define PORTB_PIN14 14
103#define PORTB_PIN15 15
104#define TEENSY_PIN0 16
105#define TEENSY_PIN1 17
106#define TEENSY_PIN29 18
107#define TEENSY_PIN30 19
108#define TEENSY_PIN43 20
109#define TEENSY_PIN46 21
110#define TEENSY_PIN44 22
111#define TEENSY_PIN45 23
112#define PORTB_PIN24 24
113#define PORTB_PIN25 25
114#define PORTB_PIN26 26
115#define PORTB_PIN27 27
116#define PORTB_PIN28 28
117#define PORTB_PIN29 29
118#define PORTB_PIN30 30
119#define PORTB_PIN31 31
120
121#define TEENSY_PIN49_IOPORT IOPORT2
122#define TEENSY_PIN50_IOPORT IOPORT2
123#define TEENSY_PIN43_IOPORT IOPORT2
124#define TEENSY_PIN44_IOPORT IOPORT2
125#define TEENSY_PIN45_IOPORT IOPORT2
126#define TEENSY_PIN46_IOPORT IOPORT2
127#define TEENSY_PIN0_IOPORT IOPORT2
128#define TEENSY_PIN1_IOPORT IOPORT2
129#define TEENSY_PIN29_IOPORT IOPORT2
130#define TEENSY_PIN30_IOPORT IOPORT2
131#define TEENSY_PIN31_IOPORT IOPORT2
132#define TEENSY_PIN32_IOPORT IOPORT2
133#define TEENSY_PIN16_IOPORT IOPORT2
134#define TEENSY_PIN17_IOPORT IOPORT2
135#define TEENSY_PIN19_IOPORT IOPORT2
136#define TEENSY_PIN18_IOPORT IOPORT2
137
138#define TEENSY_PIN15 0
139#define TEENSY_PIN22 1
140#define TEENSY_PIN23 2
141#define TEENSY_PIN9 3
142#define TEENSY_PIN10 4
143#define TEENSY_PIN13 5
144#define TEENSY_PIN11 6
145#define TEENSY_PIN12 7
146#define TEENSY_PIN35 8
147#define TEENSY_PIN36 9
148#define TEENSY_PIN37 10
149#define TEENSY_PIN38 11
150#define PORTC_PIN12 12
151#define PORTC_PIN13 13
152#define PORTC_PIN14 14
153#define PORTC_PIN15 15
154#define PORTC_PIN16 16
155#define PORTC_PIN17 17
156#define PORTC_PIN18 18
157#define PORTC_PIN19 19
158#define PORTC_PIN20 20
159#define PORTC_PIN21 21
160#define PORTC_PIN22 22
161#define PORTC_PIN23 23
162#define PORTC_PIN24 24
163#define PORTC_PIN25 25
164#define PORTC_PIN26 26
165#define PORTC_PIN27 27
166#define PORTC_PIN28 28
167#define PORTC_PIN29 29
168#define PORTC_PIN30 30
169#define PORTC_PIN31 31
170
171#define TEENSY_PIN9_IOPORT IOPORT3
172#define TEENSY_PIN10_IOPORT IOPORT3
173#define TEENSY_PIN11_IOPORT IOPORT3
174#define TEENSY_PIN12_IOPORT IOPORT3
175#define TEENSY_PIN35_IOPORT IOPORT3
176#define TEENSY_PIN36_IOPORT IOPORT3
177#define TEENSY_PIN37_IOPORT IOPORT3
178#define TEENSY_PIN38_IOPORT IOPORT3
179#define TEENSY_PIN13_IOPORT IOPORT3
180#define TEENSY_PIN15_IOPORT IOPORT3
181#define TEENSY_PIN22_IOPORT IOPORT3
182#define TEENSY_PIN23_IOPORT IOPORT3
183
184#define TEENSY_PIN2 0
185#define TEENSY_PIN14 1
186#define TEENSY_PIN7 2
187#define TEENSY_PIN8 3
188#define TEENSY_PIN6 4
189#define TEENSY_PIN20 5
190#define TEENSY_PIN21 6
191#define TEENSY_PIN5 7
192#define TEENSY_PIN47 8
193#define TEENSY_PIN48 9
194#define PORTD_PIN10 10
195#define TEENSY_PIN55 11
196#define TEENSY_PIN53 12
197#define TEENSY_PIN52 13
198#define TEENSY_PIN51 14
199#define TEENSY_PIN54 15
200#define PORTD_PIN16 16
201#define PORTD_PIN17 17
202#define PORTD_PIN18 18
203#define PORTD_PIN19 19
204#define PORTD_PIN20 20
205#define PORTD_PIN21 21
206#define PORTD_PIN22 22
207#define PORTD_PIN23 23
208#define PORTD_PIN24 24
209#define PORTD_PIN25 25
210#define PORTD_PIN26 26
211#define PORTD_PIN27 27
212#define PORTD_PIN28 28
213#define PORTD_PIN29 29
214#define PORTD_PIN30 30
215#define PORTD_PIN31 31
216
217#define TEENSY_PIN51_IOPORT IOPORT4
218#define TEENSY_PIN52_IOPORT IOPORT4
219#define TEENSY_PIN53_IOPORT IOPORT4
220#define TEENSY_PIN54_IOPORT IOPORT4
221#define TEENSY_PIN55_IOPORT IOPORT4
222#define TEENSY_PIN47_IOPORT IOPORT4
223#define TEENSY_PIN48_IOPORT IOPORT4
224#define TEENSY_PIN2_IOPORT IOPORT4
225#define TEENSY_PIN5_IOPORT IOPORT4
226#define TEENSY_PIN6_IOPORT IOPORT4
227#define TEENSY_PIN7_IOPORT IOPORT4
228#define TEENSY_PIN8_IOPORT IOPORT4
229#define TEENSY_PIN14_IOPORT IOPORT4
230#define TEENSY_PIN20_IOPORT IOPORT4
231#define TEENSY_PIN21_IOPORT IOPORT4
232
233#define PORTE_PIN0 0
234#define PORTE_PIN1 1
235#define PORTE_PIN2 2
236#define PORTE_PIN3 3
237#define PORTE_PIN4 4
238#define PORTE_PIN5 5
239#define PORTE_PIN6 6
240#define PORTE_PIN7 7
241#define PORTE_PIN8 8
242#define PORTE_PIN9 9
243#define TEENSY_PIN56 10
244#define TEENSY_PIN57 11
245#define PORTE_PIN12 12
246#define PORTE_PIN13 13
247#define PORTE_PIN14 14
248#define PORTE_PIN15 15
249#define PORTE_PIN16 16
250#define PORTE_PIN17 17
251#define PORTE_PIN18 18
252#define PORTE_PIN19 19
253#define PORTE_PIN20 20
254#define PORTE_PIN21 21
255#define PORTE_PIN22 22
256#define PORTE_PIN23 23
257#define TEENSY_PIN33 24
258#define TEENSY_PIN34 25
259#define TEENSY_PIN24 26
260#define PORTE_PIN27 27
261#define PORTE_PIN28 28
262#define PORTE_PIN29 29
263#define PORTE_PIN30 30
264#define PORTE_PIN31 31
265
266#define TEENSY_PIN56_IOPORT IOPORT5
267#define TEENSY_PIN57_IOPORT IOPORT5
268#define TEENSY_PIN24_IOPORT IOPORT5
269#define TEENSY_PIN33_IOPORT IOPORT5
270#define TEENSY_PIN34_IOPORT IOPORT5
271
272
273#define LINE_PIN0 PAL_LINE(TEENSY_PIN0_IOPORT, TEENSY_PIN0)
274#define LINE_PIN1 PAL_LINE(TEENSY_PIN1_IOPORT, TEENSY_PIN1)
275#define LINE_PIN2 PAL_LINE(TEENSY_PIN2_IOPORT, TEENSY_PIN2)
276#define LINE_PIN3 PAL_LINE(TEENSY_PIN3_IOPORT, TEENSY_PIN3)
277#define LINE_PIN4 PAL_LINE(TEENSY_PIN4_IOPORT, TEENSY_PIN4)
278#define LINE_PIN5 PAL_LINE(TEENSY_PIN5_IOPORT, TEENSY_PIN5)
279#define LINE_PIN6 PAL_LINE(TEENSY_PIN6_IOPORT, TEENSY_PIN6)
280#define LINE_PIN7 PAL_LINE(TEENSY_PIN7_IOPORT, TEENSY_PIN7)
281#define LINE_PIN8 PAL_LINE(TEENSY_PIN8_IOPORT, TEENSY_PIN8)
282#define LINE_PIN9 PAL_LINE(TEENSY_PIN9_IOPORT, TEENSY_PIN9)
283#define LINE_PIN10 PAL_LINE(TEENSY_PIN10_IOPORT, TEENSY_PIN10)
284#define LINE_PIN11 PAL_LINE(TEENSY_PIN11_IOPORT, TEENSY_PIN11)
285#define LINE_PIN12 PAL_LINE(TEENSY_PIN12_IOPORT, TEENSY_PIN12)
286#define LINE_PIN13 PAL_LINE(TEENSY_PIN13_IOPORT, TEENSY_PIN13)
287#define LINE_PIN14 PAL_LINE(TEENSY_PIN14_IOPORT, TEENSY_PIN14)
288#define LINE_PIN15 PAL_LINE(TEENSY_PIN15_IOPORT, TEENSY_PIN15)
289#define LINE_PIN16 PAL_LINE(TEENSY_PIN16_IOPORT, TEENSY_PIN16)
290#define LINE_PIN17 PAL_LINE(TEENSY_PIN17_IOPORT, TEENSY_PIN17)
291#define LINE_PIN18 PAL_LINE(TEENSY_PIN18_IOPORT, TEENSY_PIN18)
292#define LINE_PIN19 PAL_LINE(TEENSY_PIN19_IOPORT, TEENSY_PIN19)
293#define LINE_PIN20 PAL_LINE(TEENSY_PIN20_IOPORT, TEENSY_PIN20)
294#define LINE_PIN21 PAL_LINE(TEENSY_PIN21_IOPORT, TEENSY_PIN21)
295#define LINE_PIN22 PAL_LINE(TEENSY_PIN22_IOPORT, TEENSY_PIN22)
296#define LINE_PIN23 PAL_LINE(TEENSY_PIN23_IOPORT, TEENSY_PIN23)
297#define LINE_PIN24 PAL_LINE(TEENSY_PIN24_IOPORT, TEENSY_PIN24)
298#define LINE_PIN25 PAL_LINE(TEENSY_PIN25_IOPORT, TEENSY_PIN25)
299#define LINE_PIN25 PAL_LINE(TEENSY_PIN25_IOPORT, TEENSY_PIN25)
300#define LINE_PIN26 PAL_LINE(TEENSY_PIN26_IOPORT, TEENSY_PIN26)
301#define LINE_PIN27 PAL_LINE(TEENSY_PIN27_IOPORT, TEENSY_PIN27)
302#define LINE_PIN28 PAL_LINE(TEENSY_PIN28_IOPORT, TEENSY_PIN28)
303#define LINE_PIN29 PAL_LINE(TEENSY_PIN29_IOPORT, TEENSY_PIN29)
304#define LINE_PIN30 PAL_LINE(TEENSY_PIN30_IOPORT, TEENSY_PIN30)
305#define LINE_PIN31 PAL_LINE(TEENSY_PIN31_IOPORT, TEENSY_PIN31)
306#define LINE_PIN32 PAL_LINE(TEENSY_PIN32_IOPORT, TEENSY_PIN32)
307#define LINE_PIN33 PAL_LINE(TEENSY_PIN33_IOPORT, TEENSY_PIN33)
308#define LINE_PIN34 PAL_LINE(TEENSY_PIN34_IOPORT, TEENSY_PIN34)
309#define LINE_PIN35 PAL_LINE(TEENSY_PIN35_IOPORT, TEENSY_PIN35)
310#define LINE_PIN36 PAL_LINE(TEENSY_PIN36_IOPORT, TEENSY_PIN36)
311#define LINE_PIN37 PAL_LINE(TEENSY_PIN37_IOPORT, TEENSY_PIN37)
312#define LINE_PIN38 PAL_LINE(TEENSY_PIN38_IOPORT, TEENSY_PIN38)
313#define LINE_PIN39 PAL_LINE(TEENSY_PIN39_IOPORT, TEENSY_PIN39)
314#define LINE_PIN40 PAL_LINE(TEENSY_PIN40_IOPORT, TEENSY_PIN40)
315#define LINE_PIN41 PAL_LINE(TEENSY_PIN41_IOPORT, TEENSY_PIN41)
316#define LINE_PIN42 PAL_LINE(TEENSY_PIN42_IOPORT, TEENSY_PIN42)
317#define LINE_PIN43 PAL_LINE(TEENSY_PIN43_IOPORT, TEENSY_PIN43)
318#define LINE_PIN44 PAL_LINE(TEENSY_PIN44_IOPORT, TEENSY_PIN44)
319#define LINE_PIN45 PAL_LINE(TEENSY_PIN45_IOPORT, TEENSY_PIN45)
320#define LINE_PIN46 PAL_LINE(TEENSY_PIN46_IOPORT, TEENSY_PIN46)
321#define LINE_PIN47 PAL_LINE(TEENSY_PIN47_IOPORT, TEENSY_PIN47)
322#define LINE_PIN48 PAL_LINE(TEENSY_PIN48_IOPORT, TEENSY_PIN48)
323#define LINE_PIN49 PAL_LINE(TEENSY_PIN49_IOPORT, TEENSY_PIN49)
324#define LINE_PIN50 PAL_LINE(TEENSY_PIN50_IOPORT, TEENSY_PIN50)
325#define LINE_PIN51 PAL_LINE(TEENSY_PIN51_IOPORT, TEENSY_PIN50)
326#define LINE_PIN52 PAL_LINE(TEENSY_PIN52_IOPORT, TEENSY_PIN52)
327#define LINE_PIN53 PAL_LINE(TEENSY_PIN53_IOPORT, TEENSY_PIN53)
328#define LINE_PIN54 PAL_LINE(TEENSY_PIN54_IOPORT, TEENSY_PIN54)
329#define LINE_PIN55 PAL_LINE(TEENSY_PIN55_IOPORT, TEENSY_PIN55)
330#define LINE_PIN56 PAL_LINE(TEENSY_PIN56_IOPORT, TEENSY_PIN56)
331#define LINE_PIN57 PAL_LINE(TEENSY_PIN57_IOPORT, TEENSY_PIN57)
332
333#define LINE_LED LINE_PIN13
334
335#if !defined(_FROM_ASM_)
336#ifdef __cplusplus
337extern "C" {
338#endif
339 void boardInit(void);
340#ifdef __cplusplus
341}
342#endif
343#endif /* _FROM_ASM_ */
344
345#endif /* _BOARD_H_ */