Skip to content

Commit d219378

Browse files
committed
NUCLEO_WB55RG: enable PinMap_GPIO[]
1 parent 4e9ef59 commit d219378

File tree

2 files changed

+78
-34
lines changed

2 files changed

+78
-34
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, GPIO_NOPULL},
44+
{PA_1, 0, GPIO_NOPULL},
45+
{PA_2, 0, GPIO_NOPULL},
46+
{PA_3, 0, GPIO_NOPULL},
47+
{PA_4, 0, GPIO_NOPULL},
48+
{PA_5, 0, GPIO_NOPULL},
49+
{PA_6, 0, GPIO_NOPULL},
50+
{PA_7, 0, GPIO_NOPULL},
51+
{PA_8, 0, GPIO_NOPULL},
52+
{PA_9, 0, GPIO_NOPULL},
53+
{PA_10, 0, GPIO_NOPULL},
54+
{PA_11, 0, GPIO_NOPULL}, // Connected to USB_DM
55+
{PA_12, 0, GPIO_NOPULL}, // Connected to USB_DP
56+
{PA_13, 0, GPIO_NOPULL}, // Connected to JTMS
57+
{PA_14, 0, GPIO_NOPULL}, // Connected to JTCK
58+
{PA_15, 0, GPIO_NOPULL},
59+
{PB_0, 0, GPIO_NOPULL}, // Connected to LD2 [Green Led]
60+
{PB_1, 0, GPIO_NOPULL}, // Connected to LD3 [Red Led]
61+
{PB_2, 0, GPIO_NOPULL},
62+
{PB_3, 0, GPIO_NOPULL}, // Connected to JTDO
63+
{PB_4, 0, GPIO_NOPULL},
64+
{PB_5, 0, GPIO_NOPULL}, // Connected to LD1 [Blue Led]
65+
// {PB_6, 0, GPIO_NOPULL}, // Connected to STDIO_UART_TX
66+
// {PB_7, 0, GPIO_NOPULL}, // Connected to STDIO_UART_RX
67+
{PB_8, 0, GPIO_NOPULL},
68+
{PB_9, 0, GPIO_NOPULL},
69+
{PB_10, 0, GPIO_NOPULL},
70+
{PB_11, 0, GPIO_NOPULL},
71+
{PB_12, 0, GPIO_NOPULL},
72+
{PB_13, 0, GPIO_NOPULL},
73+
{PB_14, 0, GPIO_NOPULL},
74+
{PB_15, 0, GPIO_NOPULL},
75+
{PC_0, 0, GPIO_NOPULL},
76+
{PC_1, 0, GPIO_NOPULL},
77+
{PC_2, 0, GPIO_NOPULL},
78+
{PC_3, 0, GPIO_NOPULL},
79+
{PC_4, 0, GPIO_NOPULL}, // Connected to B1 [Push Button]
80+
{PC_5, 0, GPIO_NOPULL},
81+
{PC_6, 0, GPIO_NOPULL},
82+
{PC_10, 0, GPIO_NOPULL},
83+
{PC_11, 0, GPIO_NOPULL},
84+
{PC_12, 0, GPIO_NOPULL},
85+
{PC_13, 0, GPIO_NOPULL}, // Connected to SYS_WKUP2
86+
// {PC_14, 0, GPIO_NOPULL}, // Connected to RCC_OSC32_IN // PC14-OSC32_IN
87+
// {PC_15, 0, GPIO_NOPULL}, // Connected to RCC_OSC32_OUT // PC15-OSC32_OUT
88+
{PD_0, 0, GPIO_NOPULL}, // Connected to B2 [Push Button]
89+
{PD_1, 0, GPIO_NOPULL}, // Connected to B3 [Push Button]
90+
{PE_4, 0, GPIO_NOPULL},
91+
{PH_3, 0, GPIO_NOPULL}, // 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_NOPULL, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
114154
{PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_NOPULL, 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#include "cmsis.h"
2424
#include "PinNamesTypes.h"
2525

26+
/* If this macro is defined, then PinMap_GPIO is present in PeripheralPins.c */
27+
#define GPIO_PINMAP_READY 1
28+
2629
#ifdef __cplusplus
2730
extern "C" {
2831
#endif
@@ -32,6 +35,7 @@ typedef enum {
3235
} ALTx;
3336

3437
typedef enum {
38+
3539
PA_0 = 0x00,
3640
PA_1 = 0x01,
3741
PA_2 = 0x02,

0 commit comments

Comments
 (0)