Skip to content

Commit 00ec5fb

Browse files
committed
STM32L4: standard pin names
1 parent bf12dad commit 00ec5fb

File tree

16 files changed

+1147
-1471
lines changed

16 files changed

+1147
-1471
lines changed

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/TARGET_NUCLEO_L432KC/PinNames.h

Lines changed: 74 additions & 104 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/STM32L432K(B-C)Ux.xml
2916
*/
3017

3118
/* MBED TARGET LIST: NUCLEO_L432KC */
@@ -41,77 +28,70 @@ extern "C" {
4128
#endif
4229

4330
typedef enum {
44-
ALT0 = 0x100,
45-
ALT1 = 0x200,
46-
ALT2 = 0x300,
47-
ALT3 = 0x400
48-
} ALTx;
4931

50-
typedef enum {
51-
PA_0 = 0x00,
52-
PA_1 = 0x01,
53-
PA_2 = 0x02,
54-
PA_2_ALT0 = PA_2 | ALT0,
55-
PA_3 = 0x03,
56-
PA_3_ALT0 = PA_3 | ALT0,
57-
PA_4 = 0x04,
58-
PA_4_ALT0 = PA_4 | ALT0,
59-
PA_5 = 0x05,
60-
PA_6 = 0x06,
61-
PA_7 = 0x07,
62-
PA_8 = 0x08,
63-
PA_9 = 0x09,
64-
PA_10 = 0x0A,
65-
PA_11 = 0x0B,
66-
PA_12 = 0x0C,
67-
PA_13 = 0x0D,
68-
PA_14 = 0x0E,
69-
PA_15 = 0x0F,
70-
PA_15_ALT0 = PA_15 | ALT0,
71-
72-
PB_0 = 0x10,
73-
PB_1 = 0x11,
74-
PB_2 = 0x12,
75-
PB_3 = 0x13,
76-
PB_3_ALT0 = PB_3 | ALT0,
77-
PB_4 = 0x14,
78-
PB_4_ALT0 = PB_4 | ALT0,
79-
PB_5 = 0x15,
80-
PB_5_ALT0 = PB_5 | ALT0,
81-
PB_6 = 0x16,
82-
PB_7 = 0x17,
83-
84-
PC_14 = 0x2E,
85-
PC_15 = 0x2F,
86-
87-
// ADC internal channels
88-
ADC_TEMP = 0xF0,
89-
ADC_VREF = 0xF1,
90-
ADC_VBAT = 0xF2,
91-
92-
// Arduino Nano connector namings
93-
A0 = PA_0,
94-
A1 = PA_1,
95-
A2 = PA_3,
96-
A3 = PA_4,
97-
A4 = PA_5,
98-
A5 = PA_6,
99-
A6 = PA_7,
100-
A7 = PA_2,
101-
D0 = PA_10,
102-
D1 = PA_9,
103-
D2 = PA_12,
104-
D3 = PB_0,
105-
D4 = PB_7,
106-
D5 = PB_6,
107-
D6 = PB_1,
108-
D7 = PC_14,
109-
D8 = PC_15,
110-
D9 = PA_8,
111-
D10 = PA_11,
112-
D11 = PB_5,
113-
D12 = PB_4,
114-
D13 = PB_3,
32+
PA_0 = 0x00,
33+
PA_1 = 0x01,
34+
PA_2 = 0x02,
35+
PA_2_ALT0 = PA_2 | ALT0, // same pin used for alternate HW
36+
PA_3 = 0x03,
37+
PA_3_ALT0 = PA_3 | ALT0, // same pin used for alternate HW
38+
PA_4 = 0x04,
39+
PA_4_ALT0 = PA_4 | ALT0, // same pin used for alternate HW
40+
PA_5 = 0x05,
41+
PA_6 = 0x06,
42+
PA_7 = 0x07,
43+
PA_8 = 0x08,
44+
PA_9 = 0x09,
45+
PA_10 = 0x0A,
46+
PA_11 = 0x0B,
47+
PA_12 = 0x0C,
48+
PA_13 = 0x0D,
49+
PA_14 = 0x0E,
50+
PA_15 = 0x0F,
51+
PA_15_ALT0 = PA_15 | ALT0, // same pin used for alternate HW
52+
PB_0 = 0x10,
53+
PB_1 = 0x11,
54+
PB_3 = 0x13,
55+
PB_3_ALT0 = PB_3 | ALT0, // same pin used for alternate HW
56+
PB_4 = 0x14,
57+
PB_4_ALT0 = PB_4 | ALT0, // same pin used for alternate HW
58+
PB_5 = 0x15,
59+
PB_5_ALT0 = PB_5 | ALT0, // same pin used for alternate HW
60+
PB_6 = 0x16,
61+
PB_7 = 0x17,
62+
PC_14 = 0x2E,
63+
PC_15 = 0x2F,
64+
PH_3 = 0x73,
65+
66+
/**** ADC internal channels ****/
67+
68+
ADC_TEMP = 0xF0, // Internal pin virtual value
69+
ADC_VREF = 0xF1, // Internal pin virtual value
70+
ADC_VBAT = 0xF2, // Internal pin virtual value
71+
72+
// Arduino Nano pins
73+
A0 = PA_0,
74+
A1 = PA_1,
75+
A2 = PA_3,
76+
A3 = PA_4,
77+
A4 = PA_5,
78+
A5 = PA_6,
79+
A6 = PA_7,
80+
A7 = PA_2,
81+
D0 = PA_10,
82+
D1 = PA_9,
83+
D2 = PA_12,
84+
D3 = PB_0,
85+
D4 = PB_7,
86+
D5 = PB_6,
87+
D6 = PB_1,
88+
D7 = PC_14,
89+
D8 = PC_15,
90+
D9 = PA_8,
91+
D10 = PA_11,
92+
D11 = PB_5,
93+
D12 = PB_4,
94+
D13 = PB_3,
11595

11696
// STDIO for console print
11797
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
@@ -125,14 +105,6 @@ typedef enum {
125105
CONSOLE_RX = PA_15,
126106
#endif
127107

128-
I2C_SCL = PB_6,
129-
I2C_SDA = PB_7,
130-
SPI_MOSI = PB_5,
131-
SPI_MISO = PB_4,
132-
SPI_SCK = PB_3,
133-
SPI_CS = PA_11,
134-
PWM_OUT = PB_0,
135-
136108
/**** USB pins ****/
137109
USB_DM = PA_11,
138110
USB_DP = PA_12,
@@ -156,9 +128,7 @@ typedef enum {
156128
NC = (int)0xFFFFFFFF
157129
} PinName;
158130

159-
// Standardized LED and button names
160-
#define LED1 PB_3
161-
131+
#define LED1 PB_3 // LD3 [Green]
162132

163133
#ifdef __cplusplus
164134
}

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L433xC/TARGET_NUCLEO_L433RC_P/PeripheralPins.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ MBED_WEAK const PinMap PinMap_ADC[] = {
6868
{PC_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
6969
{PC_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
7070
{PC_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13
71-
{PC_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 // Only STM32L433RC, not STM32L433RC-P
7271
{NC, NC, 0}
7372
};
7473

@@ -157,7 +156,6 @@ MBED_WEAK const PinMap PinMap_UART_TX[] = {
157156
{PB_11, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
158157
{PC_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
159158
{PC_4, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
160-
{PC_5, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // Only STM32L433RC, not STM32L433RC-P
161159
{PC_10, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
162160
{NC, NC, 0}
163161
};
@@ -171,7 +169,6 @@ MBED_WEAK const PinMap PinMap_UART_RX[] = {
171169
{PB_10, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
172170
{PB_11, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
173171
{PC_0, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
174-
{PC_5, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // Only STM32L433RC, not STM32L433RC-P
175172
{PC_11, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
176173
{NC, NC, 0}
177174
};
@@ -185,7 +182,6 @@ MBED_WEAK const PinMap PinMap_UART_RTS[] = {
185182
{PB_3, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
186183
{PB_12, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
187184
{PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
188-
{PD_2, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // Only STM32L433RC, not STM32L433RC-P
189185
{NC, NC, 0}
190186
};
191187

0 commit comments

Comments
 (0)