USB device stack for NUCLEO-F042K6, NUCLEO-L152RE and NUCLEO-F103RB.

Dependents:   LPE-SEM01

Fork of L152RE_USBDevice by Norimasa Okamoto

I tried USB device using HAL_PCD.

/media/uploads/va009039/f042k6_usbdevice_vin.jpg

Nucleo-F042K6USB
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

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Wed Aug 20 13:15:20 2014 +0100
Parent:
29:b7a0ea455a0c
Child:
31:5bf05f9b3c7b
Commit message:
Synchronized with git revision acf895235e4476b0740a6a55381433645ae03873

Full URL: https://github.com/mbedmicro/mbed/commit/acf895235e4476b0740a6a55381433645ae03873/

[USBDevice] use target group LPC11UXX instead of LPC11U24 or LPC11U35_501

Changed in this revision

USBDevice/USBHAL.h Show annotated file Show diff for this revision Revisions of this file
USBDevice/USBHAL_LPC11U.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/USBDevice/USBHAL.h	Mon Aug 18 13:45:19 2014 +0100
+++ b/USBDevice/USBHAL.h	Wed Aug 20 13:15:20 2014 +0100
@@ -77,7 +77,7 @@
 #if !defined(TARGET_STM32F4)
     virtual bool EP4_OUT_callback(){return false;};
     virtual bool EP4_IN_callback(){return false;};
-#if !defined(TARGET_LPC11U24)
+#if !(defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549))
     virtual bool EP5_OUT_callback(){return false;};
     virtual bool EP5_IN_callback(){return false;};
     virtual bool EP6_OUT_callback(){return false;};
@@ -108,7 +108,7 @@
     static void _usbisr(void);
     static USBHAL * instance;
 
-#if defined(TARGET_LPC11U24)
+#if defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549)
         bool (USBHAL::*epCallback[10 - 2])(void);
 #elif defined(TARGET_STM32F4XX)
         bool (USBHAL::*epCallback[8 - 2])(void);
--- a/USBDevice/USBHAL_LPC11U.cpp	Mon Aug 18 13:45:19 2014 +0100
+++ b/USBDevice/USBHAL_LPC11U.cpp	Wed Aug 20 13:15:20 2014 +0100
@@ -16,11 +16,11 @@
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 
-#if defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC1347) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPC11U68) || defined(TARGET_LPC1549)
+#if defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549)
 
 #if defined(TARGET_LPC1347) || defined(TARGET_LPC1549)
 #define USB_IRQ USB_IRQ_IRQn
-#elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPC11U68)
+#else
 #define USB_IRQ USB_IRQn
 #endif
 
@@ -167,7 +167,7 @@
        FCCO = FCLKOUT * 2 * P = 48MHz * 2 * 2 = 192MHz (within FCCO range) */
     LPC_SYSCON->USBPLLCTRL = (0x3 | (1UL << 6));
 
-    /* Powerup USB PLL */  
+    /* Powerup USB PLL */
     LPC_SYSCON->PDRUNCFG &= ~(CLK_USB);
 
     /* Wait for PLL to lock */