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 31:5bf05f9b3c7b, committed 2014-08-21
- Comitter:
- mbed_official
- Date:
- Thu Aug 21 15:00:37 2014 +0100
- Parent:
- 30:4408411999c8
- Child:
- 32:37f14e05bfd7
- Commit message:
- Synchronized with git revision bbc120c4786e99dfa586e7a13f8638064f1e5938
Full URL: https://github.com/mbedmicro/mbed/commit/bbc120c4786e99dfa586e7a13f8638064f1e5938/
DISCO_F407VG - add USBDevice support and a variant - ARCH_MAX
Changed in this revision
--- a/USBDevice/USBEndpoints.h Wed Aug 20 13:15:20 2014 +0100 +++ b/USBDevice/USBEndpoints.h Thu Aug 21 15:00:37 2014 +0100 @@ -43,7 +43,7 @@ #include "USBEndpoints_LPC11U.h" #elif defined(TARGET_KL25Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D5M) | defined(TARGET_K64F) #include "USBEndpoints_KL25Z.h" -#elif defined (TARGET_STM32F4XX) +#elif defined (TARGET_STM32F4) #include "USBEndpoints_STM32F4.h" #else #error "Unknown target type"
--- a/USBDevice/USBHAL.h Wed Aug 20 13:15:20 2014 +0100
+++ b/USBDevice/USBHAL.h Thu Aug 21 15:00:37 2014 +0100
@@ -110,7 +110,7 @@
#if defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549)
bool (USBHAL::*epCallback[10 - 2])(void);
-#elif defined(TARGET_STM32F4XX)
+#elif defined(TARGET_STM32F4)
bool (USBHAL::*epCallback[8 - 2])(void);
#else
bool (USBHAL::*epCallback[32 - 2])(void);
--- a/USBDevice/USBHAL_STM32F4.cpp Wed Aug 20 13:15:20 2014 +0100
+++ b/USBDevice/USBHAL_STM32F4.cpp Thu Aug 21 15:00:37 2014 +0100
@@ -16,7 +16,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if defined(TARGET_STM32F4XX)
+#if defined(TARGET_STM32F4)
#include "USBHAL.h"
#include "USBRegs_STM32.h"
@@ -48,6 +48,13 @@
// Enable power and clocking
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
+#if defined(TARGET_STM32F407VG)
+ pin_function(PA_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS));
+ pin_function(PA_9, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLDOWN, GPIO_AF10_OTG_FS));
+ pin_function(PA_10, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS));
+ pin_function(PA_11, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS));
+ pin_function(PA_12, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS));
+#else
pin_function(PA_8, STM_PIN_DATA(2, 10));
pin_function(PA_9, STM_PIN_DATA(0, 0));
pin_function(PA_10, STM_PIN_DATA(2, 10));
@@ -61,6 +68,7 @@
// Set VBUS pin to open drain
pin_mode(PA_9, OpenDrain);
+#endif
RCC->AHB2ENR |= RCC_AHB2ENR_OTGFSEN;
