Skip to content

Commit df79609

Browse files
authored
Merge pull request #11675 from jeromecoutant/PR_USB_STEP1
STM32 USB update step 1
2 parents 4b21157 + dab09f3 commit df79609

File tree

151 files changed

+1595
-355
lines changed

Some content is hidden

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

151 files changed

+1595
-355
lines changed

targets/TARGET_STM/PeripheralPins.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "pinmap.h"
3535
#include "PeripheralNames.h"
3636

37+
#define GPIO_AF_NONE 0
38+
3739
//*** ADC ***
3840
#if DEVICE_ANALOGIN
3941
extern const PinMap PinMap_ADC[];
@@ -89,4 +91,16 @@ extern const PinMap PinMap_QSPI_SCLK[];
8991
extern const PinMap PinMap_QSPI_SSEL[];
9092
#endif
9193

94+
#if DEVICE_USBDEVICE
95+
96+
#define USE_USB_NO_OTG 0
97+
#define USE_USB_OTG_FS 1
98+
#define USE_USB_OTG_HS 2
99+
#define USE_USB_HS_IN_FS 3
100+
101+
extern const PinMap PinMap_USB_HS[];
102+
extern const PinMap PinMap_USB_FS[];
103+
104+
#endif /* DEVICE_USBDEVICE */
105+
92106
#endif

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ typedef enum {
6969
CAN_1 = (int)CAN_BASE
7070
} CANName;
7171

72+
typedef enum {
73+
USB_FS = (int)USB_BASE,
74+
} USBName;
75+
7276
#ifdef __cplusplus
7377
}
7478
#endif

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/PeripheralPins.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,14 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
195195
{PA_12, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_CAN)},
196196
{NC, NC, 0}
197197
};
198+
199+
//*** USBDEVICE ***
200+
201+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
202+
// {PA_4, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE
203+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
204+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
205+
// {PA_13, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE // Connected to SWDIO
206+
// {PA_15, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_USB)}, // USB_NOE // Connected to STDIO_UART_RX
207+
{NC, NC, 0}
208+
};

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ typedef enum {
6767
PWM_17 = (int)TIM17_BASE
6868
} PWMName;
6969

70+
typedef enum {
71+
USB_FS = (int)USB_BASE,
72+
} USBName;
73+
7074
#ifdef __cplusplus
7175
}
7276
#endif

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/PeripheralPins.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,12 @@ MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
218218
{PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)},
219219
{NC, NC, 0}
220220
};
221+
222+
//*** USBDEVICE ***
223+
224+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
225+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
226+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
227+
// {PA_13, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE // Connected to TMS
228+
{NC, NC, 0}
229+
};

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ typedef enum {
7676
CAN_1 = (int)CAN_BASE
7777
} CANName;
7878

79+
typedef enum {
80+
USB_FS = (int)USB_BASE,
81+
} USBName;
82+
7983
#ifdef __cplusplus
8084
}
8185
#endif

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/PeripheralPins.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,12 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
250250
{PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_CAN)},
251251
{NC, NC, 0}
252252
};
253+
254+
//*** USBDEVICE ***
255+
256+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
257+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
258+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
259+
// {PA_13, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE // Connected to TMS
260+
{NC, NC, 0}
261+
};

targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ typedef enum {
6868
CAN_1 = (int)CAN1_BASE
6969
} CANName;
7070

71+
typedef enum {
72+
USB_FS = (int)USB_BASE,
73+
} USBName;
74+
7175
#ifdef __cplusplus
7276
}
7377
#endif

targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/PeripheralPins.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,11 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
207207
{PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 10)}, // Remap CAN_TX to PB_9
208208
{NC, NC, 0}
209209
};
210+
211+
//*** USBDEVICE ***
212+
213+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
214+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)}, // USB_DM
215+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)}, // USB_DP
216+
{NC, NC, 0}
217+
};

targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/PeripheralNames.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ typedef enum {
8888
CAN_2 = (int)CAN2_BASE
8989
} CANName;
9090

91+
typedef enum {
92+
USB_FS = (int)USB_OTG_FS_PERIPH_BASE,
93+
USB_HS = (int)USB_OTG_HS_PERIPH_BASE
94+
} USBName;
95+
9196
#ifdef __cplusplus
9297
}
9398
#endif

0 commit comments

Comments
 (0)