replacing hcd_pipe_xfer by usbh_edpt_xfer

This commit is contained in:
hathach
2020-09-06 11:49:00 +07:00
parent 9a6d7c648e
commit 15ad585e67
7 changed files with 58 additions and 10 deletions
+11 -4
View File
@@ -98,6 +98,11 @@ void SystemInit(void)
Chip_IOCON_Init(LPC_IOCON);
Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
/* CPU clock source starts with IRC */
/* Enable PBOOST for CPU clock over 100MHz */
Chip_SYSCTL_EnableBoost();
Chip_SetupXtalClocking();
}
@@ -130,13 +135,15 @@ void board_init(void)
Chip_USB_Init();
enum {
USBCLK = 0x1B // Host + Device + OTG + AHB
USBCLK_DEVCIE = 0x12, // AHB + Device
USBCLK_HOST = 0x19 , // AHB + OTG + Host
USBCLK_ALL = 0x1B // Host + Device + OTG + AHB
};
LPC_USB->OTGClkCtrl = USBCLK;
while ( (LPC_USB->OTGClkSt & USBCLK) != USBCLK ) {}
LPC_USB->OTGClkCtrl = USBCLK_ALL;
while ( (LPC_USB->OTGClkSt & USBCLK_ALL) != USBCLK_ALL ) {}
// USB1 = host, USB2 = device
// set portfunc: USB1 = host, USB2 = device
LPC_USB->StCtrl = 0x3;
}