Skip to content

Commit 32d1c99

Browse files
authored
Merge pull request ARMmbed#14480 from jeromecoutant/PR_STM32_STANDARD
STM32: Standard Pin Names
2 parents 216965e + 992591e commit 32d1c99

File tree

71 files changed

+7983
-9320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+7983
-9320
lines changed

targets/TARGET_STM/TARGET_STM32F0/TARGET_STM32F070xB/TARGET_NUCLEO_F070RB/PinNames.h

Lines changed: 108 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
11
/* mbed Microcontroller Library
2-
*******************************************************************************
3-
* Copyright (c) 2018, STMicroelectronics
2+
* SPDX-License-Identifier: BSD-3-Clause
3+
******************************************************************************
4+
*
5+
* Copyright (c) 2016-2021 STMicroelectronics.
46
* All rights reserved.
57
*
6-
* Redistribution and use in source and binary forms, with or without
7-
* modification, are permitted provided that the following conditions are met:
8+
* This software component is licensed by ST under BSD 3-Clause license,
9+
* the "License"; You may not use this file except in compliance with the
10+
* License. You may obtain a copy of the License at:
11+
* opensource.org/licenses/BSD-3-Clause
812
*
9-
* 1. Redistributions of source code must retain the above copyright notice,
10-
* this list of conditions and the following disclaimer.
11-
* 2. Redistributions in binary form must reproduce the above copyright notice,
12-
* this list of conditions and the following disclaimer in the documentation
13-
* and/or other materials provided with the distribution.
14-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15-
* may be used to endorse or promote products derived from this software
16-
* without specific prior written permission.
13+
******************************************************************************
1714
*
18-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-
*******************************************************************************
15+
* Automatically generated from STM32CubeMX/db/mcu/STM32F070RBTx.xml
2916
*/
3017

3118
/* MBED TARGET LIST: NUCLEO_F070RB */
@@ -43,137 +30,112 @@ extern "C" {
4330
typedef enum {
4431
ALT0 = 0x100,
4532
ALT1 = 0x200,
46-
ALT2 = 0x300,
47-
ALT3 = 0x400
4833
} ALTx;
4934

5035
typedef enum {
51-
PA_0 = 0x00,
52-
PA_1 = 0x01,
53-
PA_2 = 0x02,
54-
PA_3 = 0x03,
55-
PA_4 = 0x04,
56-
PA_5 = 0x05,
57-
PA_6 = 0x06,
58-
PA_6_ALT0 = PA_6 | ALT0,
59-
PA_7 = 0x07,
60-
PA_7_ALT0 = PA_7 | ALT0,
61-
PA_7_ALT1 = PA_7 | ALT1,
62-
PA_7_ALT2 = PA_7 | ALT2,
63-
PA_8 = 0x08,
64-
PA_9 = 0x09,
65-
PA_10 = 0x0A,
66-
PA_11 = 0x0B,
67-
PA_12 = 0x0C,
68-
PA_13 = 0x0D,
69-
PA_14 = 0x0E,
70-
PA_15 = 0x0F,
71-
72-
PB_0 = 0x10,
73-
PB_1 = 0x11,
74-
PB_1_ALT0 = PB_1 | ALT0,
75-
PB_1_ALT1 = PB_1 | ALT1,
76-
PB_2 = 0x12,
77-
PB_3 = 0x13,
78-
PB_4 = 0x14,
79-
PB_5 = 0x15,
80-
PB_6 = 0x16,
81-
PB_7 = 0x17,
82-
PB_8 = 0x18,
83-
PB_9 = 0x19,
84-
PB_10 = 0x1A,
85-
PB_11 = 0x1B,
86-
PB_12 = 0x1C,
87-
PB_13 = 0x1D,
88-
PB_14 = 0x1E,
89-
PB_15 = 0x1F,
90-
PB_15_ALT0 = PB_15 | ALT0,
91-
PB_15_ALT1 = PB_15 | ALT1,
92-
93-
PC_0 = 0x20,
94-
PC_1 = 0x21,
95-
PC_2 = 0x22,
96-
PC_3 = 0x23,
97-
PC_4 = 0x24,
98-
PC_5 = 0x25,
99-
PC_6 = 0x26,
100-
PC_7 = 0x27,
101-
PC_8 = 0x28,
102-
PC_9 = 0x29,
103-
PC_10 = 0x2A,
104-
PC_10_ALT0 = PC_10 | ALT0,
105-
PC_11 = 0x2B,
106-
PC_11_ALT0 = PC_11 | ALT0,
107-
PC_12 = 0x2C,
108-
PC_13 = 0x2D,
109-
PC_14 = 0x2E,
110-
PC_15 = 0x2F,
111-
112-
PD_2 = 0x32,
113-
114-
PF_0 = 0x50,
115-
PF_1 = 0x51,
116-
117-
// ADC internal channels
118-
ADC_TEMP = 0xF0,
119-
ADC_VREF = 0xF1,
120-
121-
// Arduino connector namings
122-
A0 = PA_0,
123-
A1 = PA_1,
124-
A2 = PA_4,
125-
A3 = PB_0,
126-
A4 = PC_1,
127-
A5 = PC_0,
128-
D0 = PA_3,
129-
D1 = PA_2,
130-
D2 = PA_10,
131-
D3 = PB_3,
132-
D4 = PB_5,
133-
D5 = PB_4,
134-
D6 = PB_10,
135-
D7 = PA_8,
136-
D8 = PA_9,
137-
D9 = PC_7,
138-
D10 = PB_6,
139-
D11 = PA_7,
140-
D12 = PA_6,
141-
D13 = PA_5,
142-
D14 = PB_9,
143-
D15 = PB_8,
36+
PA_0 = 0x00,
37+
PA_1 = 0x01,
38+
PA_2 = 0x02,
39+
PA_3 = 0x03,
40+
PA_4 = 0x04,
41+
PA_5 = 0x05,
42+
PA_6 = 0x06,
43+
PA_6_ALT0 = PA_6 | ALT0, // same pin used for alternate HW
44+
PA_7 = 0x07,
45+
PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
46+
PA_7_ALT1 = PA_7 | ALT1, // same pin used for alternate HW
47+
PA_8 = 0x08,
48+
PA_9 = 0x09,
49+
PA_10 = 0x0A,
50+
PA_11 = 0x0B,
51+
PA_12 = 0x0C,
52+
PA_13 = 0x0D,
53+
PA_14 = 0x0E,
54+
PA_15 = 0x0F,
55+
PB_0 = 0x10,
56+
PB_1 = 0x11,
57+
PB_1_ALT0 = PB_1 | ALT0, // same pin used for alternate HW
58+
PB_2 = 0x12,
59+
PB_3 = 0x13,
60+
PB_4 = 0x14,
61+
PB_5 = 0x15,
62+
PB_6 = 0x16,
63+
PB_7 = 0x17,
64+
PB_8 = 0x18,
65+
PB_9 = 0x19,
66+
PB_10 = 0x1A,
67+
PB_11 = 0x1B,
68+
PB_12 = 0x1C,
69+
PB_13 = 0x1D,
70+
PB_14 = 0x1E,
71+
PB_15 = 0x1F,
72+
PB_15_ALT0 = PB_15 | ALT0, // same pin used for alternate HW
73+
PC_0 = 0x20,
74+
PC_1 = 0x21,
75+
PC_2 = 0x22,
76+
PC_3 = 0x23,
77+
PC_4 = 0x24,
78+
PC_5 = 0x25,
79+
PC_6 = 0x26,
80+
PC_7 = 0x27,
81+
PC_8 = 0x28,
82+
PC_9 = 0x29,
83+
PC_10 = 0x2A,
84+
PC_10_ALT0 = PC_10 | ALT0, // same pin used for alternate HW
85+
PC_11 = 0x2B,
86+
PC_11_ALT0 = PC_11 | ALT0, // same pin used for alternate HW
87+
PC_12 = 0x2C,
88+
PC_13 = 0x2D,
89+
PC_14 = 0x2E,
90+
PC_15 = 0x2F,
91+
PD_2 = 0x32,
92+
PF_0 = 0x50,
93+
PF_1 = 0x51,
94+
95+
/**** ADC internal channels ****/
96+
97+
ADC_TEMP = 0xF0, // Internal pin virtual value
98+
ADC_VREF = 0xF1, // Internal pin virtual value
99+
100+
#ifdef TARGET_FF_ARDUINO_UNO
101+
// Arduino Uno (Rev3) pins
102+
ARDUINO_UNO_A0 = PA_0,
103+
ARDUINO_UNO_A1 = PA_1,
104+
ARDUINO_UNO_A2 = PA_4,
105+
ARDUINO_UNO_A3 = PB_0,
106+
ARDUINO_UNO_A4 = PC_1,
107+
ARDUINO_UNO_A5 = PC_0,
108+
109+
ARDUINO_UNO_D0 = PA_3,
110+
ARDUINO_UNO_D1 = PA_2,
111+
ARDUINO_UNO_D2 = PA_10,
112+
ARDUINO_UNO_D3 = PB_3,
113+
ARDUINO_UNO_D4 = PB_5,
114+
ARDUINO_UNO_D5 = PB_4,
115+
ARDUINO_UNO_D6 = PB_10,
116+
ARDUINO_UNO_D7 = PA_8,
117+
ARDUINO_UNO_D8 = PA_9,
118+
ARDUINO_UNO_D9 = PC_7,
119+
ARDUINO_UNO_D10 = PB_6,
120+
ARDUINO_UNO_D11 = PA_7,
121+
ARDUINO_UNO_D12 = PA_6,
122+
ARDUINO_UNO_D13 = PA_5,
123+
ARDUINO_UNO_D14 = PB_9,
124+
ARDUINO_UNO_D15 = PB_8,
125+
#endif
144126

145127
// STDIO for console print
146128
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
147-
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
129+
CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
148130
#else
149-
STDIO_UART_TX = PA_2,
131+
CONSOLE_TX = PA_2,
150132
#endif
151133
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
152-
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
134+
CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
153135
#else
154-
STDIO_UART_RX = PA_3,
136+
CONSOLE_RX = PA_3,
155137
#endif
156138

157-
// Generic signals namings
158-
LED1 = PA_5,
159-
LED2 = PA_5,
160-
LED3 = PA_5,
161-
LED4 = PA_5,
162-
USER_BUTTON = PC_13,
163-
// Standardized button names
164-
BUTTON1 = USER_BUTTON,
165-
SERIAL_TX = STDIO_UART_TX,
166-
SERIAL_RX = STDIO_UART_RX,
167-
CONSOLE_TX = STDIO_UART_TX,
168-
CONSOLE_RX = STDIO_UART_RX,
169-
I2C_SCL = PB_8,
170-
I2C_SDA = PB_9,
171-
SPI_MOSI = PA_7,
172-
SPI_MISO = PA_6,
173-
SPI_SCK = PA_5,
174-
SPI_CS = PB_6,
175-
PWM_OUT = PB_3,
176-
177139
/**** USB pins ****/
178140
USB_DM = PA_11,
179141
USB_DP = PA_12,
@@ -199,6 +161,10 @@ typedef enum {
199161
NC = (int)0xFFFFFFFF
200162
} PinName;
201163

164+
// Standardized LED and button names
165+
#define LED1 PA_5 // LD2 [Green Led]
166+
#define BUTTON1 PC_13 // B1 [Blue PushButton]
167+
202168
#ifdef __cplusplus
203169
}
204170
#endif

0 commit comments

Comments
 (0)