summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-12-04 18:38:01 +0700
committerhathach <[email protected]>2018-12-04 18:38:01 +0700
commitfe8346e642c369ad0e0b5bbf3a10d8e7d16a10fc (patch)
treedb3ca83de3886c2cf35e27ad7c307a7e5882f239 /src
parent6c2404ca49772430585edda57c0b90064af02ab6 (diff)
move pinmux out of dcd into bsp
Diffstat (limited to 'src')
-rw-r--r--src/portable/nxp/lpc17_40/hal_lpc17_40.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/portable/nxp/lpc17_40/hal_lpc17_40.c b/src/portable/nxp/lpc17_40/hal_lpc17_40.c
index 668cabd80..cebddd883 100644
--- a/src/portable/nxp/lpc17_40/hal_lpc17_40.c
+++ b/src/portable/nxp/lpc17_40/hal_lpc17_40.c
@@ -66,24 +66,18 @@ bool tusb_hal_init(void)
Chip_USB_Init();
- /* Configure P0.29 as D+, P0.30 as D- */
- Chip_IOCON_PinMux(LPC_IOCON, 0, 29, IOCON_MODE_INACT, IOCON_FUNC1);
- Chip_IOCON_PinMux(LPC_IOCON, 0, 30, IOCON_MODE_INACT, IOCON_FUNC1);
-
#if MODE_HOST_SUPPORTED
+ // TODO move pin config to BSP
PINSEL_ConfigPin( &(PINSEL_CFG_Type) { .Portnum = 1, .Pinnum = 22, .Funcnum = 2} ); // P1.22 as USB_PWRD
PINSEL_ConfigPin( &(PINSEL_CFG_Type) { .Portnum = 1, .Pinnum = 19, .Funcnum = 2} ); // P1.19 as USB_PPWR
// Enable host
LPC_USB->USBClkCtrl = USBCLK_HOST;
while ((LPC_USB->USBClkSt & USBCLK_HOST) != USBCLK_HOST);
- LPC_USB->OTGStCtrl = 0x3;
+ LPC_USB->OTGClkSt = 0x3;
#endif
#if TUSB_OPT_DEVICE_ENABLED
- // P2_9 as USB Connect
- Chip_IOCON_PinMux(LPC_IOCON, 2, 9, IOCON_MODE_INACT, IOCON_FUNC1);
-
// Enable Device
LPC_USB->USBClkCtrl = USBCLK_DEVCIE;
while ((LPC_USB->USBClkSt & USBCLK_DEVCIE) != USBCLK_DEVCIE);