STM32F7 USB: change VBUS pin for DISCO_F746NG FS

pull/9768/head
bcostm 2018-11-08 13:06:50 +01:00 committed by Russ Butler
parent 28462d476a
commit e96b8a4803
1 changed files with 6 additions and 1 deletions

View File

@ -215,7 +215,12 @@ void USBPhyHw::init(USBPhyEvents *events)
__HAL_RCC_GPIOA_CLK_ENABLE();
pin_function(PA_11, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // DM
pin_function(PA_12, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // DP
#if defined(TARGET_DISCO_F746NG_OTG_FS)
__HAL_RCC_GPIOJ_CLK_ENABLE();
pin_function(PJ_12, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // VBUS
#else
pin_function(PA_9, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // VBUS
#endif
pin_function(PA_10, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)); // ID
pin_function(PA_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); // SOF
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
@ -271,7 +276,7 @@ void USBPhyHw::init(USBPhyEvents *events)
pin_function(PH_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_HS)); // NXT
#if defined(TARGET_DISCO_F769NI)
pin_function(PI_11, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_HS)); // DIR
#else // TARGET_DISCO_F746NG
#else
pin_function(PC_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_HS)); // DIR
#endif
__HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE();