diff options
-rw-r--r-- | usb/dwc_otg.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usb/dwc_otg.h b/usb/dwc_otg.h index dccd8e9..56a317f 100644 --- a/usb/dwc_otg.h +++ b/usb/dwc_otg.h @@ -126,6 +126,14 @@ class USB_otg : public USB_generic { rxfifo_size = size; } + void set_vbus_sense(bool enabled) { + if(enabled) { + otg.reg.GCCFG &= ~(1 << 21); // NOVBUSSENS + } else { + otg.reg.GCCFG |= (1 << 21); // NOVBUSSENS + } + } + void init() { // Set PHYSEL. otg.reg.GUSBCFG |= (1 << 6); |