Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of USBDevice by
Revision 24:4ed3e25c3edc, committed 2014-03-30
- Comitter:
- tolaipner
- Date:
- Sun Mar 30 07:30:18 2014 +0000
- Parent:
- 23:ee5d634d099e
- Commit message:
- Added Nucleo F401RE support
Changed in this revision
USBDevice/USBHAL_STM32F4.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r ee5d634d099e -r 4ed3e25c3edc USBDevice/USBHAL_STM32F4.cpp --- a/USBDevice/USBHAL_STM32F4.cpp Sun Mar 30 07:24:27 2014 +0000 +++ b/USBDevice/USBHAL_STM32F4.cpp Sun Mar 30 07:30:18 2014 +0000 @@ -62,6 +62,14 @@ pin_function(PA_10, STM_PIN_DATA(2, 10)); pin_function(PA_11, STM_PIN_DATA(2, 10)); pin_function(PA_12, STM_PIN_DATA(2, 10)); + + // Set ID pin to open drain with pull-up resistor + pin_mode(PA_10, OpenDrain); + GPIOA->PUPDR &= ~(0x3 << 20); + GPIOA->PUPDR |= 1 << 20; + + // Set VBUS pin to open drain + pin_mode(PA_9, OpenDrain); #endif RCC->AHB2ENR |= RCC_AHB2ENR_OTGFSEN;