USB device stack for NUCLEO-F042K6, NUCLEO-L152RE and NUCLEO-F103RB.
Fork of L152RE_USBDevice by
I tried USB device using HAL_PCD.
Nucleo-F042K6 | USB |
---|---|
PA11 (CN3-13) | DM (2 WHITE) |
PA12 (CN3-5) | DP (3 GREEN) |
GND (CN3-4) | GND (5 BLACK) |
VIN (CN4-1) | VBUS(1 RED) |
Examples
Import programF042K6_USBDevice_example
NUCLEO-F042K6 USBDevice example code
Import programL152RE_USBDevice_example
L152RE_USBDevice example code
Import programF042K6_Simple-CMSIS-DAP
cmsis-dap debug adapter
Import programL152RE_Simple-CMSIS-DAP
cmsis-dap debug adapter
Diff: USBDevice/USBHAL.h
- Revision:
- 16:4f6df64750bd
- Parent:
- 11:eeb3cbbaa996
- Child:
- 25:7c72828865f3
--- a/USBDevice/USBHAL.h Tue Nov 05 09:45:23 2013 +0000 +++ b/USBDevice/USBHAL.h Thu Dec 05 13:00:15 2013 +0000 @@ -74,9 +74,9 @@ virtual bool EP2_IN_callback(){return false;}; virtual bool EP3_OUT_callback(){return false;}; virtual bool EP3_IN_callback(){return false;}; +#if !defined(TARGET_STM32F4) virtual bool EP4_OUT_callback(){return false;}; virtual bool EP4_IN_callback(){return false;}; - #if !defined(TARGET_LPC11U24) virtual bool EP5_OUT_callback(){return false;}; virtual bool EP5_IN_callback(){return false;}; @@ -101,6 +101,7 @@ virtual bool EP15_OUT_callback(){return false;}; virtual bool EP15_IN_callback(){return false;}; #endif +#endif private: void usbisr(void); @@ -109,6 +110,8 @@ #if defined(TARGET_LPC11U24) bool (USBHAL::*epCallback[10 - 2])(void); +#elif defined(TARGET_STM32F4XX) + bool (USBHAL::*epCallback[8 - 2])(void); #else bool (USBHAL::*epCallback[32 - 2])(void); #endif