Merge pull request #553 from hathach/host-async-control

Host async control
This commit is contained in:
Ha Thach
2020-11-07 10:52:14 +07:00
committed by GitHub
27 changed files with 1731 additions and 1021 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;
}