Skip to content

Commit b0d2b16

Browse files
committed
NUCLEO_WB55RG: enable PinMap_GPIO[]
1 parent 004ab22 commit b0d2b16

File tree

2 files changed

+149
-105
lines changed

2 files changed

+149
-105
lines changed

targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xx/TARGET_NUCLEO_WB55RG/PeripheralPins.c

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

3418
#include "PeripheralPins.h"
@@ -53,6 +37,61 @@
5337
//==============================================================================
5438

5539

40+
//*** GPIO ***
41+
42+
MBED_WEAK const PinMap PinMap_GPIO[] = {
43+
{PA_0, 0, 0},
44+
{PA_1, 0, 0},
45+
{PA_2, 0, 0},
46+
{PA_3, 0, 0},
47+
{PA_4, 0, 0},
48+
{PA_5, 0, 0},
49+
{PA_6, 0, 0},
50+
{PA_7, 0, 0},
51+
{PA_8, 0, 0},
52+
{PA_9, 0, 0},
53+
{PA_10, 0, 0},
54+
{PA_11, 0, 0}, // Connected to USB_DM
55+
{PA_12, 0, 0}, // Connected to USB_DP
56+
{PA_13, 0, 0}, // Connected to JTMS
57+
{PA_14, 0, 0}, // Connected to JTCK
58+
{PA_15, 0, 0},
59+
{PB_0, 0, 0}, // Connected to LD2 [Green Led]
60+
{PB_1, 0, 0}, // Connected to LD3 [Red Led]
61+
{PB_2, 0, 0},
62+
{PB_3, 0, 0}, // Connected to JTDO
63+
{PB_4, 0, 0},
64+
{PB_5, 0, 0}, // Connected to LD1 [Blue Led]
65+
// {PB_6, 0, 0}, // Connected to STDIO_UART_TX
66+
// {PB_7, 0, 0}, // Connected to STDIO_UART_RX
67+
{PB_8, 0, 0},
68+
{PB_9, 0, 0},
69+
{PB_10, 0, 0},
70+
{PB_11, 0, 0},
71+
{PB_12, 0, 0},
72+
{PB_13, 0, 0},
73+
{PB_14, 0, 0},
74+
{PB_15, 0, 0},
75+
{PC_0, 0, 0},
76+
{PC_1, 0, 0},
77+
{PC_2, 0, 0},
78+
{PC_3, 0, 0},
79+
{PC_4, 0, 0}, // Connected to B1 [Push Button]
80+
{PC_5, 0, 0},
81+
{PC_6, 0, 0},
82+
{PC_10, 0, 0},
83+
{PC_11, 0, 0},
84+
{PC_12, 0, 0},
85+
{PC_13, 0, 0}, // Connected to SYS_WKUP2
86+
// {PC_14, 0, 0}, // Connected to RCC_OSC32_IN // PC14-OSC32_IN
87+
// {PC_15, 0, 0}, // Connected to RCC_OSC32_OUT // PC15-OSC32_OUT
88+
{PD_0, 0, 0}, // Connected to B2 [Push Button]
89+
{PD_1, 0, 0}, // Connected to B3 [Push Button]
90+
{PE_4, 0, 0},
91+
{PH_3, 0, 0}, // PH3-BOOT0
92+
{NC, NC, 0}
93+
};
94+
5695
//*** ADC ***
5796

5897
MBED_WEAK const PinMap PinMap_ADC[] = {
@@ -109,6 +148,7 @@ MBED_WEAK const PinMap PinMap_I2C_SCL[] = {
109148
//*** PWM ***
110149

111150
// TIM16 cannot be used because already used by the us_ticker
151+
// (update us_ticker_data.h file if another timer is chosen)
112152
MBED_WEAK const PinMap PinMap_PWM[] = {
113153
{PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
114154
{PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
@@ -142,36 +182,36 @@ MBED_WEAK const PinMap PinMap_PWM[] = {
142182

143183
MBED_WEAK const PinMap PinMap_UART_TX[] = {
144184
{PA_2, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
145-
{PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
185+
{PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
146186
{PB_5, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to LD1 [Blue Led]
147-
{PB_6, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to STDIO_UART_TX
187+
{PB_6, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to STDIO_UART_TX
148188
{PB_11, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
149189
{PC_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
150190
{NC, NC, 0}
151191
};
152192

153193
MBED_WEAK const PinMap PinMap_UART_RX[] = {
154194
{PA_3, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
155-
{PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
195+
{PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
156196
{PA_12, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to USB_DP
157-
{PB_7, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to STDIO_UART_RX
197+
{PB_7, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to STDIO_UART_RX
158198
{PB_10, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
159199
{PC_0, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
160200
{NC, NC, 0}
161201
};
162202

163203
MBED_WEAK const PinMap PinMap_UART_RTS[] = {
164-
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to USB_DP
204+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to USB_DP
165205
{PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to LD3 [Red Led]
166-
{PB_3, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to JTDO
206+
{PB_3, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to JTDO
167207
{PB_12, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
168208
{NC, NC, 0}
169209
};
170210

171211
MBED_WEAK const PinMap PinMap_UART_CTS[] = {
172212
{PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
173-
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to USB_DM
174-
{PB_4, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
213+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to USB_DM
214+
{PB_4, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
175215
{PB_13, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
176216
{NC, NC, 0}
177217
};

targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xx/TARGET_NUCLEO_WB55RG/PinNames.h

Lines changed: 75 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2019 ARM Limited
3-
* SPDX-License-Identifier: Apache-2.0
2+
* SPDX-License-Identifier: BSD-3-Clause
3+
******************************************************************************
44
*
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
5+
* Copyright (c) 2016-2020 STMicroelectronics.
6+
* All rights reserved.
87
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
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
1012
*
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.
13+
******************************************************************************
14+
*
15+
* Automatically generated from STM32CubeMX/db/mcu/STM32WB55RGVx.xml
1616
*/
17+
1718
#ifndef MBED_PINNAMES_H
1819
#define MBED_PINNAMES_H
1920

2021
#include "cmsis.h"
2122
#include "PinNamesTypes.h"
2223

24+
/* If this macro is defined, then PinMap_GPIO is present in PeripheralPins.c */
25+
#define GPIO_PINMAP_READY 1
26+
2327
#ifdef __cplusplus
2428
extern "C" {
2529
#endif
@@ -28,69 +32,69 @@ typedef enum {
2832
ALT0 = 0x100,
2933
ALT1 = 0x200,
3034
ALT2 = 0x300,
31-
ALT3 = 0x400
35+
ALT3 = 0x400,
36+
ALT4 = 0x500
3237
} ALTx;
3338

3439
typedef enum {
35-
PA_0 = 0x00,
36-
PA_1 = 0x01,
37-
PA_2 = 0x02,
38-
PA_3 = 0x03,
39-
PA_4 = 0x04,
40-
PA_5 = 0x05,
41-
PA_6 = 0x06,
42-
PA_7 = 0x07,
43-
PA_7_ALT0 = PA_7 | ALT0,
44-
PA_8 = 0x08,
45-
PA_9 = 0x09,
46-
PA_10 = 0x0A,
47-
PA_11 = 0x0B,
48-
PA_12 = 0x0C,
49-
PA_13 = 0x0D,
50-
PA_14 = 0x0E,
51-
PA_15 = 0x0F,
52-
53-
PB_0 = 0x10,
54-
PB_1 = 0x11,
55-
PB_2 = 0x12,
56-
PB_3 = 0x13,
57-
PB_4 = 0x14,
58-
PB_5 = 0x15,
59-
PB_6 = 0x16,
60-
PB_7 = 0x17,
61-
PB_8 = 0x18,
62-
PB_9 = 0x19,
63-
PB_9_ALT0 = PB_9 | ALT0,
64-
PB_10 = 0x1A,
65-
PB_11 = 0x1B,
66-
PB_12 = 0x1C,
67-
PB_13 = 0x1D,
68-
PB_14 = 0x1E,
69-
PB_15 = 0x1F,
70-
71-
PC_0 = 0x20,
72-
PC_1 = 0x21,
73-
PC_2 = 0x22,
74-
PC_3 = 0x23,
75-
PC_4 = 0x24,
76-
PC_5 = 0x25,
77-
PC_6 = 0x26,
78-
PC_10 = 0x2A,
79-
PC_11 = 0x2B,
80-
PC_12 = 0x2C,
81-
PC_13 = 0x2D,
82-
PC_14 = 0x2E,
83-
PC_15 = 0x2F,
84-
85-
PD_0 = 0x30,
86-
PD_1 = 0x31,
87-
88-
PH_3 = 0x73,
89-
90-
// ADC internal channels
91-
ADC_TEMP = 0xF0,
92-
ADC_VREF = 0xF1,
93-
ADC_VBAT = 0xF2,
40+
41+
PA_0 = 0x00,
42+
PA_1 = 0x01,
43+
PA_2 = 0x02,
44+
PA_3 = 0x03,
45+
PA_4 = 0x04,
46+
PA_5 = 0x05,
47+
PA_6 = 0x06,
48+
PA_7 = 0x07,
49+
PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
50+
PA_8 = 0x08,
51+
PA_9 = 0x09,
52+
PA_10 = 0x0A,
53+
PA_11 = 0x0B,
54+
PA_12 = 0x0C,
55+
PA_13 = 0x0D,
56+
PA_14 = 0x0E,
57+
PA_15 = 0x0F,
58+
PB_0 = 0x10,
59+
PB_1 = 0x11,
60+
PB_2 = 0x12,
61+
PB_3 = 0x13,
62+
PB_4 = 0x14,
63+
PB_5 = 0x15,
64+
PB_6 = 0x16,
65+
PB_7 = 0x17,
66+
PB_8 = 0x18,
67+
PB_9 = 0x19,
68+
PB_9_ALT0 = PB_9 | ALT0, // same pin used for alternate HW
69+
PB_10 = 0x1A,
70+
PB_11 = 0x1B,
71+
PB_12 = 0x1C,
72+
PB_13 = 0x1D,
73+
PB_14 = 0x1E,
74+
PB_15 = 0x1F,
75+
PC_0 = 0x20,
76+
PC_1 = 0x21,
77+
PC_2 = 0x22,
78+
PC_3 = 0x23,
79+
PC_4 = 0x24,
80+
PC_5 = 0x25,
81+
PC_6 = 0x26,
82+
PC_10 = 0x2A,
83+
PC_11 = 0x2B,
84+
PC_12 = 0x2C,
85+
PC_13 = 0x2D,
86+
PC_14 = 0x2E,
87+
PC_15 = 0x2F,
88+
PD_0 = 0x30,
89+
PD_1 = 0x31,
90+
PE_4 = 0x44,
91+
PH_3 = 0x73,
92+
93+
/**** ADC internal channels ****/
94+
95+
ADC_TEMP = 0xF0, // Internal pin virtual value
96+
ADC_VREF = 0xF1, // Internal pin virtual value
97+
ADC_VBAT = 0xF2, // Internal pin virtual value
9498

9599
// Arduino connector
96100
A0 = PC_0,

0 commit comments

Comments
 (0)