void udd_disable(void) { irqflags_t flags; #ifdef UHD_ENABLE # ifdef USB_ID if (Is_otg_id_host()) { return; // Host mode running, ignore UDD disable } # else if (Is_otg_host_mode_forced()) { return; // Host mode running, ignore UDD disable } # endif #endif flags = cpu_irq_save(); otg_unfreeze_clock(); udd_detach(); #ifndef UDD_NO_SLEEP_MGR sleepmgr_unlock_mode(USBB_SLEEP_MODE_USB_SUSPEND); #endif #ifndef UHD_ENABLE otg_disable(); otg_disable_pad(); sysclk_disable_usb(); // Else the USB clock disable is done by UHC which manage USB dual role #endif cpu_irq_restore(flags); }
void udd_disable(void) { irqflags_t flags; flags = cpu_irq_save(); // Disable USB pad otg_disable(); otg_disable_pad(); sysclk_disable_usb(); udd_sleep_mode(false); #ifndef UDD_NO_SLEEP_MGR sleepmgr_unlock_mode(USBB_SLEEP_MODE_USB_SUSPEND); #endif cpu_irq_restore(flags); }
void udd_disable(void) { irqflags_t flags; flags = cpu_irq_save(); udd_detach_device(); // Disable interface USB_CTRLA = 0; USB_CTRLB = 0; sysclk_disable_usb(); udd_sleep_mode(false); #ifndef UDD_NO_SLEEP_MGR sleepmgr_unlock_mode(USBC_SLEEP_MODE_USB_SUSPEND); #endif cpu_irq_restore(flags); }
void uhd_disable(bool b_id_stop) { UNUSED(b_id_stop); irqflags_t flags; flags = cpu_irq_save(); ohci_deinit(); cpu_irq_restore(flags); /* Do not authorize asynchronous USB interrupts. */ // pmc_clr_fast_startup_input(PMC_FSMR_USBAL); sysclk_disable_usb(); pmc_disable_periph_clk(ID_UHP); uhd_sleep_mode(UHD_STATE_OFF); }
void udd_disable(void) { irqflags_t flags; flags = cpu_irq_save(); udd_detach(); udd_disable_periph_ck(); sysclk_disable_usb(); #ifndef UDD_NO_SLEEP_MGR sleepmgr_unlock_mode(UDP_SLEEP_MODE_USB_SUSPEND); #endif # if UDD_VBUS_IO udd_vbus_monitor_sleep_mode(false); # endif cpu_irq_restore(flags); }
void udd_disable(void) { irqflags_t flags; #ifdef UHD_ENABLE # if OTG_ID_IO if (Is_otg_id_host()) { // Freeze clock to switch mode otg_freeze_clock(); udd_detach(); otg_disable(); return; // Host mode running, ignore UDD disable } # else if (Is_otg_host_mode_forced()) { return; // Host mode running, ignore UDD disable } # endif #endif flags = cpu_irq_save(); otg_unfreeze_clock(); udd_detach(); #ifndef UDD_NO_SLEEP_MGR if (udd_b_sleep_initialized) { udd_b_sleep_initialized = false; sleepmgr_unlock_mode(UHDP_SLEEP_MODE_USB_SUSPEND); } #endif #ifndef UHD_ENABLE otg_disable(); sysclk_disable_usb(); pmc_disable_periph_clk(ID_UOTGHS); #endif cpu_irq_restore(flags); }