forked from sensorium/Mozzi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteensyPinMap.h
117 lines (92 loc) · 1.66 KB
/
teensyPinMap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
* teensyPinMap.h
*
* Copyright 2021 T. Combriat.
*
* This file is part of Mozzi.
*
* Mozzi is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
*
*/
#ifndef TEENSYPINMAP_H_
#define TEENSYPINMAP_H
#include "mozzi_config.h"
inline uint8_t teensyPinMap(uint8_t pin)
{
if (pin < 24) return pin-14; // common to all teensys
#if defined (__MK20DX128__) // Teensy 3.0
return pin - 24;
#elif defined (__MK20DX256__) // Teensy 3.1/3.2
switch (pin)
{
case 34:
return 10;
case 35:
return 11;
case 36:
return 12;
case 37:
return 13;
case 40:
return 14;
case 26:
return 15;
case 27:
return 16;
case 28:
return 17;
case 29:
return 18;
case 30:
return 19;
case 31:
return 20;
}
#elif defined (__MKL26Z64__) //TeensyLC
return pin-14;
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__) // Teensy 3.5//3.6
switch (pin)
{
case 64:
return 10;
case 65:
return 11;
case 31:
return 12;
case 32:
return 13;
case 33:
return 14;
case 34:
return 15;
case 35:
return 16;
case 36:
return 17;
case 37:
return 18;
case 38:
return 19;
case 39:
return 20;
case 66:
return 21;
case 67:
return 22;
case 49:
return 23;
case 50:
return 24;
case 68:
return 25;
case 69:
return 26;
}
#elif defined ARDUINO_TEENSY40
return pin-14;
#elif defined ARDUINO_TEENSY41
if (pin< 28) return pin-14;
return pin-24;
#endif
}
#endif