Skip to content

Commit 66dea7b

Browse files
committed
STM32F0 USB pins addition
1 parent 5afd9eb commit 66dea7b

File tree

6 files changed

+41
-0
lines changed

6 files changed

+41
-0
lines changed

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+
};

0 commit comments

Comments
 (0)