summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-09-01 00:51:58 +0700
committerhathach <[email protected]>2019-09-01 00:51:58 +0700
commit30f707cad274946dd87fea2b784b497fda07f256 (patch)
tree02a50e755e48c954bc5846ffa34ef998fbb5f041
parent0ab8829e5546bd34d114f6afb74c25e1287312f0 (diff)
rename lpc11_13_15 to simply lpc_usbd since it is almost used by in recent year for nxp mcu
-rw-r--r--hw/bsp/lpcxpresso11u68/board.mk2
-rw-r--r--hw/bsp/lpcxpresso1347/board.mk2
-rw-r--r--hw/bsp/lpcxpresso51u68/board.mk2
-rw-r--r--src/portable/nxp/lpc_usbd/dcd_lpc_usbd.c (renamed from src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c)25
4 files changed, 23 insertions, 8 deletions
diff --git a/hw/bsp/lpcxpresso11u68/board.mk b/hw/bsp/lpcxpresso11u68/board.mk
index f8db946c9..29287692e 100644
--- a/hw/bsp/lpcxpresso11u68/board.mk
+++ b/hw/bsp/lpcxpresso11u68/board.mk
@@ -26,7 +26,7 @@ INC += \
# For TinyUSB port source
VENDOR = nxp
-CHIP_FAMILY = lpc11_13_15
+CHIP_FAMILY = lpc_usbd
# For freeRTOS port source
FREERTOS_PORT = ARM_CM0
diff --git a/hw/bsp/lpcxpresso1347/board.mk b/hw/bsp/lpcxpresso1347/board.mk
index a12efeab6..f7600f427 100644
--- a/hw/bsp/lpcxpresso1347/board.mk
+++ b/hw/bsp/lpcxpresso1347/board.mk
@@ -25,7 +25,7 @@ INC += \
# For TinyUSB port source
VENDOR = nxp
-CHIP_FAMILY = lpc11_13_15
+CHIP_FAMILY = lpc_usbd
# For freeRTOS port source
FREERTOS_PORT = ARM_CM3
diff --git a/hw/bsp/lpcxpresso51u68/board.mk b/hw/bsp/lpcxpresso51u68/board.mk
index 4e61e1e53..83ad1d360 100644
--- a/hw/bsp/lpcxpresso51u68/board.mk
+++ b/hw/bsp/lpcxpresso51u68/board.mk
@@ -30,7 +30,7 @@ LIBS += $(TOP)/hw/mcu/nxp/lpc_driver/lpc51u6x/devices/LPC51U68/libpower.a
# For TinyUSB port source
VENDOR = nxp
-CHIP_FAMILY = lpc11_13_15
+CHIP_FAMILY = lpc_usbd
# For freeRTOS port source
FREERTOS_PORT = ARM_CM0
diff --git a/src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c b/src/portable/nxp/lpc_usbd/dcd_lpc_usbd.c
index 84aba742a..ec3177c4b 100644
--- a/src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c
+++ b/src/portable/nxp/lpc_usbd/dcd_lpc_usbd.c
@@ -26,7 +26,19 @@
#include "tusb_option.h"
-#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13XX || CFG_TUSB_MCU == OPT_MCU_LPC51UXX)
+/* Since 2012 starting with LPC11uxx, NXP start to use common USB Device Controller
+ * for almost their new MCUs. Currently supported and tested families are
+ * - LPC11Uxx
+ * - LPC13xx
+ * - LPC51Uxx
+ *
+ * For similar controller of other families, this file may require some minimal changes to work with.
+ * Previous MCUs such as LPC17xx, LPC40xx, LPC18xx, LPC43xx have their own driver implementation.
+ */
+
+#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_LPC11UXX || \
+ CFG_TUSB_MCU == OPT_MCU_LPC13XX || \
+ CFG_TUSB_MCU == OPT_MCU_LPC51UXX )
#if CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13XX
// LPC11Uxx and LPC13xx use lpcopen
@@ -53,12 +65,15 @@
#define SRAM_REGION 0x20000000
/* Although device controller are the same. DMA of
- * - LPC11u can only transfer up to nbytes = 64
- * - LPC13 can transfer nbytes = 1023 (maximum)
- * - LPC15 can ???
+ * - M0/M+ can only transfer up to nbytes = 64
+ * - M3/M4 can transfer nbytes = 1023 (maximum)
*/
enum {
- DMA_NBYTES_MAX = (CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC51UXX) ? 64 : 1023
+ #ifdef __ARM_ARCH_6M__ // Cortex M0/M0+
+ DMA_NBYTES_MAX = 64
+ #else
+ DMA_NBYTES_MAX = 1023
+ #endif
};
enum {