1
1
/* mbed Microcontroller Library
2
- * Copyright (c) 2006-2013 ARM Limited
2
+ * Copyright (c) 2006-2021 ARM Limited
3
3
* SPDX-License-Identifier: Apache-2.0
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -198,63 +198,37 @@ typedef enum {
198
198
PTE30 = (4 << GPIO_PORT_SHIFT | 30 ),
199
199
PTE31 = (4 << GPIO_PORT_SHIFT | 31 ),
200
200
201
- LED_RED = PTB22 ,
202
- LED_GREEN = PTE26 ,
203
- LED_BLUE = PTB21 ,
204
-
205
- // mbed original LED naming
206
- LED1 = LED_RED ,
207
- LED2 = LED_GREEN ,
208
- LED3 = LED_BLUE ,
209
- LED4 = LED_RED ,
210
-
211
- //Push buttons
212
- SW2 = PTC6 ,
213
- SW3 = PTA4 ,
214
- // Standardized button names
215
- BUTTON1 = SW2 ,
216
- BUTTON2 = SW3 ,
217
-
218
201
// USB Pins
219
202
CONSOLE_TX = PTB17 ,
220
203
CONSOLE_RX = PTB16 ,
221
204
222
205
// Arduino Headers
223
- D0 = PTC16 ,
224
- D1 = PTC17 ,
225
- D2 = PTB9 ,
226
- D3 = PTA1 ,
227
- D4 = PTB23 ,
228
- D5 = PTA2 ,
229
- D6 = PTC2 ,
230
- D7 = PTC3 ,
231
- D8 = PTC12 ,
232
- D9 = PTC4 ,
233
- D10 = PTD0 ,
234
- D11 = PTD2 ,
235
- D12 = PTD3 ,
236
- D13 = PTD1 ,
237
- D14 = PTE25 ,
238
- D15 = PTE24 ,
239
-
240
- I2C_SCL = D15 ,
241
- I2C_SDA = D14 ,
206
+ ARDUINO_UNO_D0 = PTC16 ,
207
+ ARDUINO_UNO_D1 = PTC17 ,
208
+ ARDUINO_UNO_D2 = PTB9 ,
209
+ ARDUINO_UNO_D3 = PTA1 ,
210
+ ARDUINO_UNO_D4 = PTB23 ,
211
+ ARDUINO_UNO_D5 = PTA2 ,
212
+ ARDUINO_UNO_D6 = PTC2 ,
213
+ ARDUINO_UNO_D7 = PTC3 ,
214
+ ARDUINO_UNO_D8 = PTC12 ,
215
+ ARDUINO_UNO_D9 = PTC4 ,
216
+ ARDUINO_UNO_D10 = PTD0 ,
217
+ ARDUINO_UNO_D11 = PTD2 ,
218
+ ARDUINO_UNO_D12 = PTD3 ,
219
+ ARDUINO_UNO_D13 = PTD1 ,
220
+ ARDUINO_UNO_D14 = PTE25 ,
221
+ ARDUINO_UNO_D15 = PTE24 ,
242
222
243
- A0 = PTB2 ,
244
- A1 = PTB3 ,
245
- A2 = PTB10 ,
246
- A3 = PTB11 ,
247
- A4 = PTC11 ,
248
- A5 = PTC10 ,
223
+ ARDUINO_UNO_A0 = PTB2 ,
224
+ ARDUINO_UNO_A1 = PTB3 ,
225
+ ARDUINO_UNO_A2 = PTB10 ,
226
+ ARDUINO_UNO_A3 = PTB11 ,
227
+ ARDUINO_UNO_A4 = PTC11 ,
228
+ ARDUINO_UNO_A5 = PTC10 ,
249
229
250
230
DAC0_OUT = 0xFEFE , /* DAC does not have Pin Name in RM */
251
231
252
- //SPI Pins configuration
253
- SPI_MOSI = PTE3 ,
254
- SPI_MISO = PTE1 ,
255
- SPI_SCK = PTE2 ,
256
- SPI_CS = PTE4 ,
257
-
258
232
// Not connected
259
233
NC = (int )0xFFFFFFFF
260
234
} PinName ;
@@ -267,6 +241,38 @@ typedef enum {
267
241
PullDefault = PullUp
268
242
} PinMode ;
269
243
244
+
245
+ // LEDs
246
+ #define LED_RED PTB22
247
+ #define LED_GREEN PTE26
248
+ #define LED_BLUE PTB21
249
+
250
+ // Standardized LED names
251
+ #define LED1 LED_RED
252
+ #define LED2 LED_GREEN
253
+ #define LED3 LED_BLUE
254
+
255
+
256
+ //Push buttons
257
+ #define SW2 PTC6
258
+ #define SW3 PTA4
259
+
260
+ // Standardized button names
261
+ #define BUTTON1 SW2
262
+ #define BUTTON2 SW3
263
+
264
+
265
+ // SPI Pins for SD card.
266
+ // Note: They are different from the Arduino Uno SPI pins
267
+ // (ARDUINO_UNO_SPI_xxx) for general purpose uses.
268
+ // By default, Mbed OS maps those alias to Arduino Uno pins, but
269
+ // for backward compatibility we map them to the SD card SPI.
270
+ #define SPI_MOSI PTE3
271
+ #define SPI_MISO PTE1
272
+ #define SPI_SCK PTE2
273
+ #define SPI_CS PTE4
274
+
275
+
270
276
#ifdef __cplusplus
271
277
}
272
278
#endif
0 commit comments