Skip to content

Commit bef36f5

Browse files
authored
Merge pull request #12093 from ABOSTM/SUPPORT_NUCLEO_G071RB
TARGET_STM: add support of board NUCLEO_G071RB
2 parents 9cd3813 + 528ac27 commit bef36f5

File tree

172 files changed

+187899
-432
lines changed

Some content is hidden

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

172 files changed

+187899
-432
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/* mbed Microcontroller Library
2+
* SPDX-License-Identifier: BSD-3-Clause
3+
******************************************************************************
4+
*
5+
* Copyright (c) 2015 STMicroelectronics.
6+
* All rights reserved.
7+
*
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
12+
*
13+
******************************************************************************
14+
*/
15+
#ifndef MBED_PERIPHERALNAMES_H
16+
#define MBED_PERIPHERALNAMES_H
17+
18+
#include "cmsis.h"
19+
20+
#ifdef __cplusplus
21+
extern "C" {
22+
#endif
23+
24+
typedef enum {
25+
ADC_1 = (int)ADC1_BASE
26+
} ADCName;
27+
28+
typedef enum {
29+
DAC_1 = (int)DAC_BASE
30+
} DACName;
31+
32+
typedef enum {
33+
UART_1 = (int)USART1_BASE,
34+
UART_2 = (int)USART2_BASE,
35+
UART_3 = (int)USART3_BASE,
36+
UART_4 = (int)USART4_BASE,
37+
LPUART_1 = (int)LPUART1_BASE
38+
} UARTName;
39+
40+
#define DEVICE_SPI_COUNT 2
41+
typedef enum {
42+
SPI_1 = (int)SPI1_BASE,
43+
SPI_2 = (int)SPI2_BASE
44+
} SPIName;
45+
46+
typedef enum {
47+
I2C_1 = (int)I2C1_BASE,
48+
I2C_2 = (int)I2C2_BASE
49+
} I2CName;
50+
51+
typedef enum {
52+
PWM_1 = (int)TIM1_BASE,
53+
PWM_2 = (int)TIM2_BASE,
54+
PWM_3 = (int)TIM3_BASE,
55+
PWM_14 = (int)TIM14_BASE,
56+
PWM_15 = (int)TIM15_BASE,
57+
PWM_16 = (int)TIM16_BASE,
58+
PWM_17 = (int)TIM17_BASE
59+
} PWMName;
60+
61+
#ifdef __cplusplus
62+
}
63+
#endif
64+
65+
#endif

targets/TARGET_STM/TARGET_STM32G0/TARGET_STM32G071xx/TARGET_NUCLEO_G071RB/PeripheralPins.c

Lines changed: 309 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
/* mbed Microcontroller Library
2+
* SPDX-License-Identifier: BSD-3-Clause
3+
******************************************************************************
4+
*
5+
* Copyright (c) 2018 STMicroelectronics.
6+
* All rights reserved.
7+
*
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
12+
*
13+
******************************************************************************
14+
*/
15+
16+
#ifndef MBED_PINNAMES_H
17+
#define MBED_PINNAMES_H
18+
19+
#include "cmsis.h"
20+
#include "PinNamesTypes.h"
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
26+
typedef enum {
27+
ALT0 = 0x100,
28+
ALT1 = 0x200,
29+
ALT2 = 0x300,
30+
ALT3 = 0x400
31+
} ALTx;
32+
33+
typedef enum {
34+
PA_0 = 0x00,
35+
PA_1 = 0x01,
36+
PA_1_ALT0 = PA_1 | ALT0,
37+
PA_2 = 0x02,
38+
PA_2_ALT0 = PA_2 | ALT0,
39+
PA_2_ALT1 = PA_2 | ALT1,
40+
PA_3 = 0x03,
41+
PA_3_ALT0 = PA_3 | ALT0,
42+
PA_3_ALT1 = PA_3 | ALT1,
43+
PA_4 = 0x04,
44+
PA_5 = 0x05,
45+
PA_6 = 0x06,
46+
PA_6_ALT0 = PA_6 | ALT0,
47+
PA_7 = 0x07,
48+
PA_7_ALT0 = PA_7 | ALT0,
49+
PA_7_ALT1 = PA_7 | ALT1,
50+
PA_7_ALT2 = PA_7 | ALT2,
51+
PA_8 = 0x08,
52+
PA_9 = 0x09,
53+
PA_9_ALT0 = PA_9 | ALT0,
54+
PA_10 = 0x0A,
55+
PA_10_ALT0 = PA_10 | ALT0,
56+
PA_11 = 0x0B,
57+
PA_12 = 0x0C,
58+
PA_13 = 0x0D,
59+
PA_14 = 0x0E,
60+
PA_14_ALT0 = PA_14 | ALT0,
61+
PA_15 = 0x0F,
62+
PA_15_ALT0 = PA_15 | ALT0,
63+
64+
PB_0 = 0x10,
65+
PB_0_ALT0 = PB_0 | ALT0,
66+
PB_1 = 0x11,
67+
PB_1_ALT0 = PB_1 | ALT0,
68+
PB_1_ALT1 = PB_1 | ALT1,
69+
PB_2 = 0x12,
70+
PB_3 = 0x13,
71+
PB_4 = 0x14,
72+
PB_4_ALT0 = PB_4 | ALT0,
73+
PB_4_ALT1 = PB_4 | ALT1,
74+
PB_5 = 0x15,
75+
PB_5_ALT0 = PB_5 | ALT0,
76+
PB_5_ALT1 = PB_5 | ALT1,
77+
PB_6 = 0x16,
78+
PB_6_ALT0 = PB_6 | ALT0,
79+
PB_7 = 0x17,
80+
PB_8 = 0x18,
81+
PB_9 = 0x19,
82+
PB_10 = 0x1A,
83+
PB_11 = 0x1B,
84+
PB_12 = 0x1C,
85+
PB_13 = 0x1D,
86+
PB_13_ALT0 = PB_13 | ALT0,
87+
PB_14 = 0x1E,
88+
PB_14_ALT0 = PB_14 | ALT0,
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_4_ALT0 = PC_4 | ALT0,
99+
PC_5 = 0x25,
100+
PC_5_ALT0 = PC_5 | ALT0,
101+
PC_6 = 0x26,
102+
PC_6_ALT0 = PC_6 | ALT0,
103+
PC_7 = 0x27,
104+
PC_7_ALT0 = PC_7 | ALT0,
105+
PC_8 = 0x28,
106+
PC_8_ALT0 = PC_8 | ALT0,
107+
PC_9 = 0x29,
108+
PC_9_ALT0 = PC_9 | ALT0,
109+
PC_10 = 0x2A,
110+
PC_10_ALT0 = PC_10 | ALT0,
111+
PC_11 = 0x2B,
112+
PC_11_ALT0 = PC_11 | ALT0,
113+
PC_12 = 0x2C,
114+
PC_13 = 0x2D,
115+
PC_14 = 0x2E,
116+
PC_15 = 0x2F,
117+
118+
PD_0 = 0x30,
119+
PD_1 = 0x31,
120+
PD_2 = 0x32,
121+
PD_3 = 0x33,
122+
PD_4 = 0x34,
123+
PD_5 = 0x35,
124+
PD_6 = 0x36,
125+
PD_8 = 0x38,
126+
PD_9 = 0x39,
127+
128+
PF_0 = 0x50,
129+
PF_1 = 0x51,
130+
131+
// ADC internal channels
132+
ADC_TEMP = 0xF0,
133+
ADC_VREF = 0xF1,
134+
ADC_VBAT = 0xF2,
135+
136+
// Arduino connector namings
137+
A0 = PA_0,
138+
A1 = PA_1,
139+
A2 = PA_4,
140+
A3 = PB_1,
141+
A4 = PB_11,
142+
A5 = PB_12,
143+
D0 = PC_5,
144+
D1 = PC_4,
145+
D2 = PA_10,
146+
D3 = PB_3,
147+
D4 = PB_5,
148+
D5 = PB_4,
149+
D6 = PB_14,
150+
D7 = PA_8,
151+
D8 = PA_9,
152+
D9 = PC_7,
153+
D10 = PB_0,
154+
D11 = PA_7,
155+
D12 = PA_6,
156+
D13 = PA_5,
157+
D14 = PB_9,
158+
D15 = PB_8,
159+
160+
// STDIO for console print
161+
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
162+
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
163+
#else
164+
STDIO_UART_TX = PA_2,
165+
#endif
166+
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
167+
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
168+
#else
169+
STDIO_UART_RX = PA_3,
170+
#endif
171+
172+
// Generic signals namings
173+
LED1 = PA_5,
174+
LED2 = PA_5,
175+
LED3 = PA_5,
176+
LED4 = PA_5,
177+
USER_BUTTON = PC_13,
178+
// Standardized button names
179+
BUTTON1 = USER_BUTTON,
180+
SERIAL_TX = STDIO_UART_TX,
181+
SERIAL_RX = STDIO_UART_RX,
182+
USBTX = STDIO_UART_TX,
183+
USBRX = STDIO_UART_RX,
184+
I2C_SCL = PB_8,
185+
I2C_SDA = PB_9,
186+
SPI_MOSI = PA_7,
187+
SPI_MISO = PA_6,
188+
SPI_SCK = PA_5,
189+
SPI_CS = PB_0,
190+
PWM_OUT = PB_3,
191+
192+
193+
194+
/**** OSCILLATOR pins ****/
195+
RCC_OSC32_EN = PC_15,
196+
RCC_OSC32_IN = PC_14,
197+
RCC_OSC32_OUT = PC_15,
198+
RCC_OSC_EN = PC_15,
199+
RCC_OSC_EN_ALT0 = PF_1,
200+
RCC_OSC_IN = PF_0,
201+
RCC_OSC_OUT = PF_1,
202+
203+
/**** DEBUG pins ****/
204+
SYS_PVD_IN = PB_7,
205+
SYS_SWCLK = PA_14,
206+
SYS_SWDIO = PA_13,
207+
208+
209+
SYS_WKUP1 = PA_0,
210+
SYS_WKUP2 = PC_13,
211+
SYS_WKUP4 = PA_2,
212+
SYS_WKUP5 = PC_5,
213+
SYS_WKUP6 = PB_5,
214+
215+
// Not connected
216+
NC = (int)0xFFFFFFFF
217+
} PinName;
218+
219+
#ifdef __cplusplus
220+
}
221+
#endif
222+
223+
#endif

0 commit comments

Comments
 (0)