From 18721cff00415071769de4bd1674296dcc2b25d2 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 14 May 2017 10:30:30 +0200 Subject: Added option to disable vbus sensing in dwc_otg driver. --- usb/dwc_otg.h | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- cgit v1.2.3