Mistake on this page?
Report an issue in GitHub or email us
PinNames_test.h
1 /*
2  * Copyright (c) 2020 ARM Limited
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef MBED_PINNAMES_H
19 #define MBED_PINNAMES_H
20 
21 #include "cmsis.h"
22 #include "PinNamesTypes.h"
23 
24 typedef enum {
25  // valid pin definitions
26  PA_0 = 0x00,
27  PA_1 = 0x01,
28  PA_2 = 0x02,
29  PA_3 = 0x03,
30  PA_4 = 0x04,
31  PA_5 = 0x05,
32  PA_6 = 0x06,
33  PA_7 = 0x07,
34  PA_8 = 0x08,
35  PA_9 = 0x09,
36  PA_10 = 0x0A,
37  PA_11 = 0x0B,
38  PA_12 = 0x0C,
39  PA_13 = 0x0D,
40  PA_14 = 0x0E,
41  PA_15 = 0x0F,
42 
43  // valid pin definitions
44  PB_0 = 0x10,
45  PB_1 = 0x11,
46  PB_2 = 0x12,
47  PB_3 = 0x13,
48  PB_4 = 0x14,
49  PB_5 = 0x15,
50  PB_6 = 0x16,
51  PB_7 = 0x17,
52  PB_8 = 0x18,
53  PB_9 = 0x19,
54  PB_10 = 0x1A,
55  PB_11 = 0x1B,
56  PB_12 = 0x1C,
57  PB_13 = 0x1D,
58  PB_14 = 0x1E,
59  PB_15 = 0x1F,
60 
61  // valid pin definitions
62  PC_0 = 0x20,
63  PC_1 = 0x21,
64  PC_2 = 0x22,
65  PC_3 = 0x23,
66  PC_4 = 0x24,
67  PC_5 = 0x25,
68  PC_6 = 0x26,
69  PC_7 = 0x27,
70  PC_8 = 0x28,
71  PC_9 = 0x29,
72  PC_10 = 0x2A,
73  PC_11 = 0x2B,
74  PC_12 = 0x2C,
75  PC_13 = 0x2D,
76  PC_14 = 0x2E,
77  PC_15 = 0x2F,
78 
79  // valid pin definitions
80  PD_0 = 0x30,
81  PD_1 = 0x31,
82  PD_2 = 0x32,
83  PD_3 = 0x33,
84  PD_4 = 0x34,
85  PD_5 = 0x35,
86  PD_6 = 0x36,
87  PD_7 = 0x37,
88  PD_8 = 0x38,
89  PD_9 = 0x39,
90  PD_10 = 0x3A,
91  PD_11 = 0x3B,
92  PD_12 = 0x3C,
93  PD_13 = 0x3D,
94  PD_14 = 0x3E,
95  PD_15 = 0x3F,
96 
97  // valid (except D7, D8) Arduino Uno(Rev3) header pin definitions
98  ARDUINO_UNO_A0 = PC_5, // ADC / GPIO
99  ARDUINO_UNO_A1 = PC_4, // ADC / GPIO
100  ARDUINO_UNO_A2 = PC_3, // ADC / GPIO
101  ARDUINO_UNO_A3 = PC_2, // ADC / GPIO
102  ARDUINO_UNO_A4 = PC_1, // ADC / GPIO
103  ARDUINO_UNO_A5 = PC_0, // ADC / GPIO
104  ARDUINO_UNO_D0 = PA_1, // UART RX / GPIO
105  ARDUINO_UNO_D1 = PA_0, // UART RX / GPIO
106  ARDUINO_UNO_D2 = PD_14, // GPIO
107  ARDUINO_UNO_D3 = PB_0, // PWM / GPIO
108  ARDUINO_UNO_D4 = PA_3, // GPIO
109  ARDUINO_UNO_D5 = PB_4, // PWM / GPIO
110  ARDUINO_UNO_D6 = PB_1, // PWM / GPIO
111  //ARDUINO_UNO_D7 = PA_4,// invalid - missing definition (GPIO)
112  ARDUINO_UNO_D8 = PB_1, // invalid - duplicate pin (GPIO)
113  ARDUINO_UNO_D9 = PA_15, // PWM / GPIO
114  ARDUINO_UNO_D10 = PA_2, // SPI CS / PWM / GPIO
115  ARDUINO_UNO_D11 = NC, // invalid - NC assignment
116  ARDUINO_UNO_D12 = PA_6, // SPI MISO / PWM / GPIO
117  ARDUINO_UNO_D13 = PA_5, // SPI SCK / GPIO
118  ARDUINO_UNO_D14 = PB_9, // I2C SDA / GPIO
119  ARDUINO_UNO_D15 = PB_8, // I2C SCL / GPIO
120 
121  // valid STDIO definitions for console print
122  CONSOLE_TX = PB_6,
123  CONSOLE_RX = PB_7,
124 
125  // invalid legacy LED/BUTTON definitions
126  // these should be a #define, not in an enum
127  LED1 = PA_5,
128  BUTTON1 = PC_2,
129 } PinName;
130 
131 // valid standardized LED and button definitions
132 #define LED2 PB_14
133 #define LED3 PC_9
134 #define BUTTON2 PC_13
135 
136 // invalid LED definitions
137 #define LED4 LED3 // duplicate
138 #define LED5 PC_9 // duplicate
139 #define LED6 LED6 // identity
140 #define LED7 NC // NC
141 
142 // invalid button definitions
143 #define BUTTON3 PC_13 // duplicate
144 #define BUTTON4 BUTTON1 // duplicate
145 #define BUTTON5 NC // NC
146 #define BUTTON6 BUTTON6 // identity
147 
148 #endif
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.