/* Initializes the USB controller registers and prepares the core device mode or host mode operation.  */
void usb_initusbcore(LL_USB_TypeDef *USBx, USB_CORE_BASIC_CFGS *basic_cfgs)
/* Initializes the USB controller registers and prepares the core device mode or host mode operation.  */
void usb_initusbcore(LL_USB_TypeDef *USBx, USB_CORE_BASIC_CFGS *basic_cfgs)
{
    usb_coresoftrst(USBx);
    usb_PhySelect(USBx, basic_cfgs->phy_type);
    usb_coresoftrst(USBx);
    usb_mdelay(20UL);
    if (basic_cfgs->dmaen == 1U) {
        usb_BurstLenConfig(USBx, 5U);
        usb_DmaCmd(USBx, 1U);
    }
}