Skip to content

Commit 8a7b390

Browse files
authored
Merge pull request #6102 from Ultimaker/master
Add support for STEVAL-3DP001V1 board
2 parents 2e69ddd + 62599a9 commit 8a7b390

File tree

11 files changed

+802
-1
lines changed

11 files changed

+802
-1
lines changed

features/unsupported/USBDevice/targets/TARGET_STM/USBHAL_IP_OTGFSHS.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ USBHAL::USBHAL(void) {
202202
__HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE();
203203
__HAL_RCC_USB_OTG_HS_CLK_ENABLE();
204204

205+
#elif defined(TARGET_STEVAL_3DP001V1)
206+
__HAL_RCC_GPIOB_CLK_ENABLE();
207+
pin_function(PA_11, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // DM
208+
pin_function(PA_12, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // DP
209+
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
210+
205211
#else
206212
#error "USB pins are not configured !"
207213
#endif

features/unsupported/USBDevice/targets/TARGET_STM/USBHAL_STM32.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#if defined(TARGET_NUCLEO_F207ZG) || \
2222
defined(TARGET_NUCLEO_F401RE) || \
23+
defined(TARGET_STEVAL_3DP001V1) || \
2324
defined(TARGET_NUCLEO_F411RE) || \
2425
defined(TARGET_NUCLEO_F412ZG) || \
2526
defined(TARGET_NUCLEO_F413ZH) || \

features/unsupported/USBHost/targets/TARGET_STM/USBHALHost_STM.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ USBHALHost::USBHALHost()
259259
pin_function(PA_10, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)); // ID
260260
pin_function(PC_11, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // VBUS
261261

262+
#elif defined(TARGET_STEVAL_3DP001V1)
263+
__HAL_RCC_GPIOA_CLK_ENABLE();
264+
pin_function(PA_11, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // DM
265+
pin_function(PA_12, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // DP
266+
262267
#else
263268
#error "USB pins are not configured !"
264269
#endif
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2014, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
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.
17+
*
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+
*******************************************************************************
29+
*/
30+
#ifndef MBED_PERIPHERALNAMES_H
31+
#define MBED_PERIPHERALNAMES_H
32+
33+
#include "cmsis.h"
34+
35+
#ifdef __cplusplus
36+
extern "C" {
37+
#endif
38+
39+
typedef enum {
40+
ADC_1 = (int)ADC1_BASE
41+
} ADCName;
42+
43+
typedef enum {
44+
UART_1 = (int)USART1_BASE,
45+
UART_2 = (int)USART2_BASE,
46+
UART_6 = (int)USART6_BASE
47+
} UARTName;
48+
49+
typedef enum {
50+
SPI_1 = (int)SPI1_BASE,
51+
SPI_2 = (int)SPI2_BASE,
52+
SPI_3 = (int)SPI3_BASE,
53+
SPI_4 = (int)SPI4_BASE
54+
} SPIName;
55+
56+
typedef enum {
57+
I2C_1 = (int)I2C1_BASE,
58+
I2C_2 = (int)I2C2_BASE,
59+
I2C_3 = (int)I2C3_BASE
60+
} I2CName;
61+
62+
typedef enum {
63+
PWM_1 = (int)TIM1_BASE,
64+
PWM_2 = (int)TIM2_BASE,
65+
PWM_3 = (int)TIM3_BASE,
66+
PWM_4 = (int)TIM4_BASE,
67+
PWM_5 = (int)TIM5_BASE,
68+
PWM_9 = (int)TIM9_BASE,
69+
PWM_10 = (int)TIM10_BASE,
70+
PWM_11 = (int)TIM11_BASE
71+
} PWMName;
72+
73+
#ifdef __cplusplus
74+
}
75+
#endif
76+
77+
#endif

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_STEVAL_3DP001V1/PeripheralPins.c

Lines changed: 255 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2014, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
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.
17+
*
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+
*******************************************************************************
29+
*/
30+
#ifndef MBED_PINNAMES_H
31+
#define MBED_PINNAMES_H
32+
33+
#include "cmsis.h"
34+
#include "PinNamesTypes.h"
35+
36+
#ifdef __cplusplus
37+
extern "C" {
38+
#endif
39+
40+
typedef enum {
41+
ALT0 = 0x100,
42+
ALT1 = 0x200
43+
} ALTx;
44+
45+
typedef enum {
46+
PA_0 = 0x00,
47+
PA_1 = 0x01,
48+
PA_2 = 0x02,
49+
PA_2_ALT0 = PA_2|ALT0,
50+
PA_3 = 0x03,
51+
PA_3_ALT0 = PA_3|ALT0,
52+
PA_4 = 0x04,
53+
PA_4_ALT0 = PA_4|ALT0,
54+
PA_5 = 0x05,
55+
PA_6 = 0x06,
56+
PA_7 = 0x07,
57+
PA_7_ALT0 = PA_7|ALT0,
58+
PA_8 = 0x08,
59+
PA_9 = 0x09,
60+
PA_10 = 0x0A,
61+
PA_11 = 0x0B,
62+
PA_12 = 0x0C,
63+
PA_13 = 0x0D,
64+
PA_14 = 0x0E,
65+
PA_15 = 0x0F,
66+
PA_15_ALT0 = PA_15|ALT0,
67+
68+
PB_0 = 0x10,
69+
PB_0_ALT0 = PB_0|ALT0,
70+
PB_1 = 0x11,
71+
PB_1_ALT0 = PB_1|ALT0,
72+
PB_2 = 0x12,
73+
PB_3 = 0x13,
74+
PB_3_ALT0 = PB_3|ALT0,
75+
PB_4 = 0x14,
76+
PB_4_ALT0 = PB_4|ALT0,
77+
PB_5 = 0x15,
78+
PB_5_ALT0 = PB_5|ALT0,
79+
PB_6 = 0x16,
80+
PB_7 = 0x17,
81+
PB_8 = 0x18,
82+
PB_8_ALT0 = PB_8|ALT0,
83+
PB_9 = 0x19,
84+
PB_9_ALT0 = PB_9|ALT0,
85+
PB_10 = 0x1A,
86+
PB_12 = 0x1C,
87+
PB_13 = 0x1D,
88+
PB_14 = 0x1E,
89+
PB_15 = 0x1F,
90+
91+
PC_0 = 0x20,
92+
PC_1 = 0x21,
93+
PC_2 = 0x22,
94+
PC_3 = 0x23,
95+
PC_4 = 0x24,
96+
PC_5 = 0x25,
97+
PC_6 = 0x26,
98+
PC_7 = 0x27,
99+
PC_8 = 0x28,
100+
PC_9 = 0x29,
101+
PC_10 = 0x2A,
102+
PC_11 = 0x2B,
103+
PC_12 = 0x2C,
104+
PC_13 = 0x2D,
105+
PC_14 = 0x2E,
106+
PC_15 = 0x2F,
107+
108+
PD_0 = 0x30,
109+
PD_1 = 0x31,
110+
PD_2 = 0x32,
111+
PD_3 = 0x33,
112+
PD_4 = 0x34,
113+
PD_5 = 0x35,
114+
PD_6 = 0x36,
115+
PD_7 = 0x37,
116+
PD_8 = 0x38,
117+
PD_9 = 0x39,
118+
PD_10 = 0x3A,
119+
PD_11 = 0x3B,
120+
PD_12 = 0x3C,
121+
PD_13 = 0x3D,
122+
PD_14 = 0x3E,
123+
PD_15 = 0x3F,
124+
125+
PE_0 = 0x40,
126+
PE_1 = 0x41,
127+
PE_2 = 0x42,
128+
PE_3 = 0x43,
129+
PE_4 = 0x44,
130+
PE_5 = 0x45,
131+
PE_6 = 0x46,
132+
PE_7 = 0x47,
133+
PE_8 = 0x48,
134+
PE_9 = 0x49,
135+
PE_10 = 0x4A,
136+
PE_11 = 0x4B,
137+
PE_12 = 0x4C,
138+
PE_13 = 0x4D,
139+
PE_14 = 0x4E,
140+
PE_15 = 0x4F,
141+
142+
PH_0 = 0x70, // Connected to RCC_OSC_IN
143+
PH_1 = 0x71, // Connected to RCC_OSC_OUT
144+
145+
// ADC internal channels
146+
ADC_TEMP = 0xF0,
147+
ADC_VREF = 0xF1,
148+
ADC_VBAT = 0xF2,
149+
150+
// STDIO for console print
151+
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
152+
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
153+
#else
154+
STDIO_UART_TX = PA_9,
155+
#endif
156+
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
157+
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
158+
#else
159+
STDIO_UART_RX = PA_10,
160+
#endif
161+
162+
// Generic signals namings
163+
LED1 = PA_5,
164+
LED2 = PA_5,
165+
LED3 = PA_5,
166+
LED4 = PA_5,
167+
LED_RED = LED1,
168+
USER_BUTTON = PE_7,
169+
// Standardized button names
170+
BUTTON1 = USER_BUTTON,
171+
SERIAL_TX = STDIO_UART_TX,
172+
SERIAL_RX = STDIO_UART_RX,
173+
USBTX = STDIO_UART_TX,
174+
USBRX = STDIO_UART_RX,
175+
I2C_SCL = PB_8,
176+
I2C_SDA = PB_9,
177+
SPI_MOSI = PA_7,
178+
SPI_MISO = PA_6,
179+
SPI_SCK = PA_5,
180+
SPI_CS = PB_6,
181+
PWM_OUT = PB_3,
182+
183+
//USB pins
184+
USB_OTG_FS_SOF = PA_8,
185+
USB_OTG_FS_VBUS = PA_9,
186+
USB_OTG_FS_ID = PA_10,
187+
USB_OTG_FS_DM = PA_11,
188+
USB_OTG_FS_DP = PA_12,
189+
190+
// Not connected
191+
NC = (int)0xFFFFFFFF
192+
} PinName;
193+
194+
#ifdef __cplusplus
195+
}
196+
#endif
197+
198+
#endif

0 commit comments

Comments
 (0)