void usb_select_phy(uint32_t phy) { which_phy = phy; GR_USB_GGPIO = GGPIO_WRITE(USB_CUSTOM_CFG_REG, (USB_PHY_ACTIVE | which_phy)); CPRINTS("USB PHY %c", which_phy == USB_SEL_PHY0 ? 'A' : 'B'); }
void usb_release(void) { /* signal disconnect to host */ usb_disconnect(); /* disable interrupt handlers */ task_disable_irq(GC_IRQNUM_USB0_USBINTR); /* Deactivate the PHY */ GR_USB_GGPIO = GGPIO_WRITE(USB_CUSTOM_CFG_REG, 0); /* disable clocks */ clock_enable_module(MODULE_USB, 0); /* TODO: pin-mux */ /* USB is off, so sleep whenever */ enable_sleep(SLEEP_MASK_USB_DEVICE); }
static inline void select_phy(uint32_t phy) { which_phy = phy; GR_USB_GGPIO = GGPIO_WRITE(USB_CUSTOM_CFG_REG, (USB_PHY_ACTIVE | which_phy)); }