Power_Off (&USB_OTG_dev);
Delay_ms(3000);
Power_On (&USB_OTG_dev);
Delay_ms(3000);
void Power_On(USB_OTG_CORE_HANDLE *pusbdev)
{
USB_OTG_DCTL_Type dctl_cfg;
dctl_cfg.u32val = 0;
dctl_cfg.b.sftdis = 0;
USB_OTG_WRITE_R32 (&pusbdev->regs.DREGS->DCTRL, dctl_cfg.u32val);
}
void Power_Off(USB_OTG_CORE_HANDLE *pusbdev)
{
USB_OTG_DCTL_Type dctl_cfg;
dctl_cfg.u32val = 0;
dctl_cfg.b.sftdis = 1;
USB_OTG_WRITE_R32 (&pusbdev->regs.DREGS->DCTRL, dctl_cfg.u32val);
}
|