Skip to content

Commit 6f09320

Browse files
committed
STM32F4 USB pins addition
1 parent 6986daa commit 6f09320

File tree

45 files changed

+500
-22
lines changed

Some content is hidden

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

45 files changed

+500
-22
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/TARGET_DISCO_F401VC/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ typedef enum {
7171
PWM_11 = (int)TIM11_BASE
7272
} PWMName;
7373

74+
typedef enum {
75+
USB_FS = (int)USB_OTG_FS_PERIPH_BASE
76+
} USBName;
77+
7478
#ifdef __cplusplus
7579
}
7680
#endif

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/TARGET_DISCO_F401VC/PeripheralPins.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,14 @@ MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
245245
{PE_11, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)},
246246
{NC, NC, 0}
247247
};
248+
249+
//*** USBDEVICE ***
250+
251+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
252+
// {PA_8, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
253+
{PA_9, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS // Connected to VBUS_FS
254+
{PA_10, USB_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID // Connected to OTG_FS_ID
255+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM // Connected to OTG_FS_DM
256+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP // Connected to OTG_FS_DP
257+
{NC, NC, 0}
258+
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/TARGET_DISCO_F401VC/PinNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ typedef enum {
184184
SPI_CS = PB_6,
185185
PWM_OUT = PB_3,
186186

187-
/**** USB pins ****/
187+
/**** USB FS pins ****/
188188
USB_OTG_FS_DM = PA_11,
189189
USB_OTG_FS_DP = PA_12,
190190
USB_OTG_FS_ID = PA_10,

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ typedef enum {
7171
PWM_11 = (int)TIM11_BASE
7272
} PWMName;
7373

74+
typedef enum {
75+
USB_FS = (int)USB_OTG_FS_PERIPH_BASE
76+
} USBName;
77+
7478
#ifdef __cplusplus
7579
}
7680
#endif

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,14 @@ MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
226226
{PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)},
227227
{NC, NC, 0}
228228
};
229+
230+
//*** USBDEVICE ***
231+
232+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
233+
// {PA_8, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
234+
{PA_9, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS
235+
{PA_10, USB_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
236+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
237+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
238+
{NC, NC, 0}
239+
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PinNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ typedef enum {
175175
SPI_CS = PB_6,
176176
PWM_OUT = PB_3,
177177

178-
/**** USB pins ****/
178+
/**** USB FS pins ****/
179179
USB_OTG_FS_DM = PA_11,
180180
USB_OTG_FS_DP = PA_12,
181181
USB_OTG_FS_ID = PA_10,

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_STEVAL_3DP001V1/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ typedef enum {
7171
PWM_11 = (int)TIM11_BASE
7272
} PWMName;
7373

74+
typedef enum {
75+
USB_FS = (int)USB_OTG_FS_PERIPH_BASE
76+
} USBName;
77+
7478
#ifdef __cplusplus
7579
}
7680
#endif

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,14 @@ MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
253253
{PE_11, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
254254
{NC, NC, 0}
255255
};
256+
257+
//*** USBDEVICE ***
258+
259+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
260+
// {PA_8, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
261+
{PA_9, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS
262+
{PA_10, USB_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
263+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
264+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
265+
{NC, NC, 0}
266+
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_STEVAL_3DP001V1/PinNames.h

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,31 @@ typedef enum {
180180
SPI_CS = PB_6,
181181
PWM_OUT = PB_3,
182182

183-
//USB pins
184-
USB_OTG_FS_SOF = PA_8,
185-
USB_OTG_FS_VBUS = PA_9,
186-
USB_OTG_FS_ID = PA_10,
183+
/**** USB OTG FS pins ****/
187184
USB_OTG_FS_DM = PA_11,
188185
USB_OTG_FS_DP = PA_12,
186+
USB_OTG_FS_ID = PA_10,
187+
USB_OTG_FS_SOF = PA_8,
188+
USB_OTG_FS_VBUS = PA_9,
189+
190+
/**** OSCILLATOR pins ****/
191+
RCC_OSC32_IN = PC_14,
192+
RCC_OSC32_OUT = PC_15,
193+
RCC_OSC_IN = PH_0,
194+
RCC_OSC_OUT = PH_1,
195+
196+
/**** DEBUG pins ****/
197+
SYS_JTCK_SWCLK = PA_14,
198+
SYS_JTDI = PA_15,
199+
SYS_JTDO_SWO = PB_3,
200+
SYS_JTMS_SWDIO = PA_13,
201+
SYS_JTRST = PB_4,
202+
SYS_TRACECLK = PE_2,
203+
SYS_TRACED0 = PE_3,
204+
SYS_TRACED1 = PE_4,
205+
SYS_TRACED2 = PE_5,
206+
SYS_TRACED3 = PE_6,
207+
SYS_WKUP = PA_0,
189208

190209
// Not connected
191210
NC = (int)0xFFFFFFFF

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/TARGET_DISCO_F407VG/PeripheralNames.h

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

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

0 commit comments

Comments
 (0)