|
1 | 1 | /*
|
2 | 2 | * Copyright (C) 2015 Freie Universität Berlin
|
3 | 3 | * 2016 Laurent Navet <laurent.navet@gmail.com>
|
| 4 | + * 2017 Thomas Perrot <thomas.perrot@tupi.fr> |
4 | 5 | *
|
5 | 6 | * This file is subject to the terms and conditions of the GNU Lesser
|
6 | 7 | * General Public License v2.1. See the file LICENSE in the top level
|
|
20 | 21 | * @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
21 | 22 | * @author Daniel Nordahl <nordahl.d@gmail.com>
|
22 | 23 | * @author Laurent Navet <laurent.navet@gmail.com>
|
| 24 | + * @author Thomas Perrot <thomas.perrot@tupi.fr> |
23 | 25 | */
|
24 | 26 |
|
25 | 27 | #ifndef ARDUINO_PINMAP_H
|
@@ -71,6 +73,51 @@ extern "C" {
|
71 | 73 | #define ARDUINO_PIN_A5 ARDUINO_PIN_19
|
72 | 74 | #endif
|
73 | 75 |
|
| 76 | +#ifdef CPU_ATMEGA32U4 |
| 77 | +/* Digital pins */ |
| 78 | +#define ARDUINO_PIN_0 GPIO_PIN(PORT_D, 2) |
| 79 | +#define ARDUINO_PIN_1 GPIO_PIN(PORT_D, 3) |
| 80 | +#define ARDUINO_PIN_2 GPIO_PIN(PORT_D, 1) |
| 81 | +#define ARDUINO_PIN_3 GPIO_PIN(PORT_D, 0) |
| 82 | +#define ARDUINO_PIN_5 GPIO_PIN(PORT_C, 6) |
| 83 | +#define ARDUINO_PIN_7 GPIO_PIN(PORT_E, 6) |
| 84 | +#define ARDUINO_PIN_11 GPIO_PIN(PORT_B, 7) |
| 85 | +#define ARDUINO_PIN_13 GPIO_PIN(PORT_C, 7) |
| 86 | +#define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 3) |
| 87 | +#define ARDUINO_PIN_15 GPIO_PIN(PORT_B, 1) |
| 88 | +#define ARDUINO_PIN_16 GPIO_PIN(PORT_B, 2) |
| 89 | +#define ARDUINO_PIN_17 GPIO_PIN(PORT_B, 0) |
| 90 | +#define ARDUINO_PIN_30 GPIO_PIN(PORT_D, 5) |
| 91 | + |
| 92 | +/* Analog pins */ |
| 93 | +#define ARDUINO_PIN_4 GPIO_PIN(PORT_D, 4) |
| 94 | +#define ARDUINO_PIN_6 GPIO_PIN(PORT_D, 7) |
| 95 | +#define ARDUINO_PIN_8 GPIO_PIN(PORT_B, 4) |
| 96 | +#define ARDUINO_PIN_9 GPIO_PIN(PORT_B, 5) |
| 97 | +#define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 6) |
| 98 | +#define ARDUINO_PIN_12 GPIO_PIN(PORT_D, 6) |
| 99 | +#define ARDUINO_PIN_18 GPIO_PIN(PORT_F, 7) |
| 100 | +#define ARDUINO_PIN_19 GPIO_PIN(PORT_F, 6) |
| 101 | +#define ARDUINO_PIN_20 GPIO_PIN(PORT_F, 5) |
| 102 | +#define ARDUINO_PIN_21 GPIO_PIN(PORT_F, 4) |
| 103 | +#define ARDUINO_PIN_22 GPIO_PIN(PORT_F, 3) |
| 104 | +#define ARDUINO_PIN_23 GPIO_PIN(PORT_F, 2) |
| 105 | + |
| 106 | +/* Analog input */ |
| 107 | +#define ARDUINO_PIN_A0 ARDUINO_PIN_18 |
| 108 | +#define ARDUINO_PIN_A1 ARDUINO_PIN_19 |
| 109 | +#define ARDUINO_PIN_A2 ARDUINO_PIN_20 |
| 110 | +#define ARDUINO_PIN_A3 ARDUINO_PIN_21 |
| 111 | +#define ARDUINO_PIN_A4 ARDUINO_PIN_22 |
| 112 | +#define ARDUINO_PIN_A5 ARDUINO_PIN_23 |
| 113 | +#define ARDUINO_PIN_A6 ARDUINO_PIN_4 |
| 114 | +#define ARDUINO_PIN_A7 ARDUINO_PIN_6 |
| 115 | +#define ARDUINO_PIN_A8 ARDUINO_PIN_8 |
| 116 | +#define ARDUINO_PIN_A9 ARDUINO_PIN_9 |
| 117 | +#define ARDUINO_PIN_A10 ARDUINO_PIN_10 |
| 118 | +#define ARDUINO_PIN_A11 ARDUINO_PIN_12 |
| 119 | +#endif |
| 120 | + |
74 | 121 | #ifdef CPU_ATMEGA2560
|
75 | 122 | #define ARDUINO_PIN_0 GPIO_PIN(PORT_E, 0)
|
76 | 123 | #define ARDUINO_PIN_1 GPIO_PIN(PORT_E, 1)
|
|
0 commit comments