diff options
| author | hathach <[email protected]> | 2019-09-11 12:05:55 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-09-11 12:05:55 +0700 |
| commit | ec50b274fc7cea2d2c37e75f6bc75ae2871c3c31 (patch) | |
| tree | 8db6ec771f7b56e777af4b919989ce57b8474015 | |
| parent | 3f02c359832ec19400265a5ee335e30fde10d24d (diff) | |
added stm32f072disco board
close #104
| -rw-r--r-- | hw/bsp/stm32f072disco/stm32f072disco.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/bsp/stm32f072disco/stm32f072disco.c b/hw/bsp/stm32f072disco/stm32f072disco.c index 1e2e2b855..cb9a1ddb5 100644 --- a/hw/bsp/stm32f072disco/stm32f072disco.c +++ b/hw/bsp/stm32f072disco/stm32f072disco.c @@ -104,7 +104,15 @@ void board_init(void) GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct); - // Start USB clock + // USB Pins + // Configure USB DM and DP pins. This is optional, and maintained only for user guidance. + GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12); + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + // USB Clock enable __HAL_RCC_USB_CLK_ENABLE(); } |
