|
@@ -45,7 +45,7 @@
|
45
|
45
|
#line 46
|
46
|
46
|
|
47
|
47
|
// manually add pins that have names that are macros which don't play well with these macros
|
48
|
|
-#if (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY || defined(ARDUINO_ARCH_SAM) || defined(TARGET_LPC1768))
|
|
48
|
+#if ANY(AVR_ATmega2560_FAMILY, AVR_ATmega1284_FAMILY, ARDUINO_ARCH_SAM, TARGET_LPC1768)
|
49
|
49
|
#if SERIAL_PORT == 0
|
50
|
50
|
static const char RXD_NAME_0[] PROGMEM = { "RXD0" };
|
51
|
51
|
static const char TXD_NAME_0[] PROGMEM = { "TXD0" };
|
|
@@ -110,83 +110,119 @@ const PinInfo pin_array[] PROGMEM = {
|
110
|
110
|
|
111
|
111
|
// manually add pins ...
|
112
|
112
|
#if SERIAL_PORT == 0
|
113
|
|
- #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
|
|
113
|
+ #if EITHER(AVR_ATmega2560_FAMILY, ARDUINO_ARCH_SAM)
|
114
|
114
|
{ RXD_NAME_0, 0, true },
|
115
|
115
|
{ TXD_NAME_0, 1, true },
|
116
|
116
|
#elif AVR_ATmega1284_FAMILY
|
117
|
117
|
{ RXD_NAME_0, 8, true },
|
118
|
118
|
{ TXD_NAME_0, 9, true },
|
119
|
|
- #elif defined(TARGET_LPC1768)
|
|
119
|
+ #elif defined(TARGET_LPC1768) // TX P0_02 RX P0_03
|
120
|
120
|
{ RXD_NAME_0, 3, true },
|
121
|
121
|
{ TXD_NAME_0, 2, true },
|
122
|
122
|
#endif
|
123
|
123
|
#elif SERIAL_PORT == 1
|
124
|
|
- #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
|
|
124
|
+ #if EITHER(AVR_ATmega2560_FAMILY, ARDUINO_ARCH_SAM)
|
125
|
125
|
{ RXD_NAME_1, 19, true },
|
126
|
126
|
{ TXD_NAME_1, 18, true },
|
127
|
127
|
#elif AVR_ATmega1284_FAMILY
|
128
|
128
|
{ RXD_NAME_1, 10, true },
|
129
|
129
|
{ TXD_NAME_1, 11, true },
|
130
|
130
|
#elif defined(TARGET_LPC1768)
|
131
|
|
- { RXD_NAME_1, 16, true },
|
132
|
|
- { TXD_NAME_1, 15, true },
|
|
131
|
+ #ifdef LPC_PINCFG_UART1_P2_00 // TX P2_00 RX P2_01
|
|
132
|
+ { RXD_NAME_1, 0x41, true },
|
|
133
|
+ { TXD_NAME_1, 0x40, true },
|
|
134
|
+ #else // TX P0_15 RX P0_16
|
|
135
|
+ { RXD_NAME_1, 16, true },
|
|
136
|
+ { TXD_NAME_1, 15, true },
|
|
137
|
+ #endif
|
133
|
138
|
#endif
|
134
|
139
|
#elif SERIAL_PORT == 2
|
135
|
|
- #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
|
|
140
|
+ #if EITHER(AVR_ATmega2560_FAMILY, ARDUINO_ARCH_SAM)
|
136
|
141
|
{ RXD_NAME_2, 17, true },
|
137
|
142
|
{ TXD_NAME_2, 16, true },
|
138
|
143
|
#elif defined(TARGET_LPC1768)
|
139
|
|
- { RXD_NAME_2, 11, true },
|
140
|
|
- { TXD_NAME_2, 10, true },
|
|
144
|
+ #ifdef LPC_PINCFG_UART2_P2_08 // TX P2_08 RX P2_09
|
|
145
|
+ { RXD_NAME_2, 0x49, true },
|
|
146
|
+ { TXD_NAME_2, 0x48, true },
|
|
147
|
+ #else // TX P0_10 RX P0_11
|
|
148
|
+ { RXD_NAME_2, 11, true },
|
|
149
|
+ { TXD_NAME_2, 10, true },
|
|
150
|
+ #endif
|
141
|
151
|
#endif
|
142
|
152
|
#elif SERIAL_PORT == 3
|
143
|
|
- #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
|
|
153
|
+ #if EITHER(AVR_ATmega2560_FAMILY, ARDUINO_ARCH_SAM)
|
144
|
154
|
{ RXD_NAME_3, 15, true },
|
145
|
155
|
{ TXD_NAME_3, 14, true },
|
146
|
156
|
#elif defined(TARGET_LPC1768)
|
147
|
|
- { RXD_NAME_3, 1, true },
|
148
|
|
- { TXD_NAME_3, 0, true },
|
|
157
|
+ #ifdef LPC_PINCFG_UART3_P0_25 // TX P0_25 RX P0_26
|
|
158
|
+ { RXD_NAME_3, 0x1A, true },
|
|
159
|
+ { TXD_NAME_3, 0x19, true },
|
|
160
|
+ #elif defined(LPC_PINCFG_UART3_P4_28) // TX P4_28 RX P4_29
|
|
161
|
+ { RXD_NAME_3, 0x9D, true },
|
|
162
|
+ { TXD_NAME_3, 0x9C, true },
|
|
163
|
+ #else // TX P0_00 RX P0_01
|
|
164
|
+ { RXD_NAME_3, 1, true },
|
|
165
|
+ { TXD_NAME_3, 0, true },
|
|
166
|
+ #endif
|
149
|
167
|
#endif
|
150
|
168
|
#endif
|
151
|
169
|
|
152
|
170
|
#ifdef SERIAL_PORT_2
|
153
|
171
|
#if SERIAL_PORT_2 == 0
|
154
|
|
- #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
|
|
172
|
+ #if EITHER(AVR_ATmega2560_FAMILY, ARDUINO_ARCH_SAM)
|
155
|
173
|
{ RXD_NAME_0, 0, true },
|
156
|
174
|
{ TXD_NAME_0, 1, true },
|
157
|
175
|
#elif AVR_ATmega1284_FAMILY
|
158
|
176
|
{ RXD_NAME_0, 8, true },
|
159
|
177
|
{ TXD_NAME_0, 9, true },
|
160
|
|
- #elif defined(TARGET_LPC1768)
|
|
178
|
+ #elif defined(TARGET_LPC1768) // TX P0_02 RX P0_03
|
161
|
179
|
{ RXD_NAME_0, 3, true },
|
162
|
180
|
{ TXD_NAME_0, 2, true },
|
163
|
181
|
#endif
|
164
|
182
|
#elif SERIAL_PORT_2 == 1
|
165
|
|
- #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
|
|
183
|
+ #if EITHER(AVR_ATmega2560_FAMILY, ARDUINO_ARCH_SAM)
|
166
|
184
|
{ RXD_NAME_1, 19, true },
|
167
|
185
|
{ TXD_NAME_1, 18, true },
|
168
|
186
|
#elif AVR_ATmega1284_FAMILY
|
169
|
187
|
{ RXD_NAME_1, 10, true },
|
170
|
188
|
{ TXD_NAME_1, 11, true },
|
171
|
189
|
#elif defined(TARGET_LPC1768)
|
172
|
|
- { RXD_NAME_1, 16, true },
|
173
|
|
- { TXD_NAME_1, 15, true },
|
|
190
|
+ #ifdef LPC_PINCFG_UART1_P2_00 // TX P2_00 RX P2_01
|
|
191
|
+ { RXD_NAME_1, 0x41, true },
|
|
192
|
+ { TXD_NAME_1, 0x40, true },
|
|
193
|
+ #else // TX P0_15 RX P0_16
|
|
194
|
+ { RXD_NAME_1, 16, true },
|
|
195
|
+ { TXD_NAME_1, 15, true },
|
|
196
|
+ #endif
|
174
|
197
|
#endif
|
175
|
198
|
#elif SERIAL_PORT_2 == 2
|
176
|
|
- #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
|
|
199
|
+ #if EITHER(AVR_ATmega2560_FAMILY, ARDUINO_ARCH_SAM)
|
177
|
200
|
{ RXD_NAME_2, 17, true },
|
178
|
201
|
{ TXD_NAME_2, 16, true },
|
179
|
202
|
#elif defined(TARGET_LPC1768)
|
180
|
|
- { RXD_NAME_2, 11, true },
|
181
|
|
- { TXD_NAME_2, 10, true },
|
|
203
|
+ #ifdef LPC_PINCFG_UART2_P2_08 // TX P2_08 RX P2_09
|
|
204
|
+ { RXD_NAME_2, 0x49, true },
|
|
205
|
+ { TXD_NAME_2, 0x48, true },
|
|
206
|
+ #else // TX P0_10 RX P0_11
|
|
207
|
+ { RXD_NAME_2, 11, true },
|
|
208
|
+ { TXD_NAME_2, 10, true },
|
|
209
|
+ #endif
|
182
|
210
|
#endif
|
183
|
211
|
#elif SERIAL_PORT_2 == 3
|
184
|
|
- #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
|
|
212
|
+ #if EITHER(AVR_ATmega2560_FAMILY, ARDUINO_ARCH_SAM)
|
185
|
213
|
{ RXD_NAME_3, 15, true },
|
186
|
214
|
{ TXD_NAME_3, 14, true },
|
187
|
215
|
#elif defined(TARGET_LPC1768)
|
188
|
|
- { RXD_NAME_3, 1, true },
|
189
|
|
- { TXD_NAME_3, 0, true },
|
|
216
|
+ #ifdef LPC_PINCFG_UART3_P0_25 // TX P0_25 RX P0_26
|
|
217
|
+ { RXD_NAME_3, 0x1A, true },
|
|
218
|
+ { TXD_NAME_3, 0x19, true },
|
|
219
|
+ #elif defined(LPC_PINCFG_UART3_P4_28) // TX P4_28 RX P4_29
|
|
220
|
+ { RXD_NAME_3, 0x9D, true },
|
|
221
|
+ { TXD_NAME_3, 0x9C, true },
|
|
222
|
+ #else // TX P0_00 RX P0_01
|
|
223
|
+ { RXD_NAME_3, 1, true },
|
|
224
|
+ { TXD_NAME_3, 0, true },
|
|
225
|
+ #endif
|
190
|
226
|
#endif
|
191
|
227
|
#endif
|
192
|
228
|
#endif
|