summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2017-05-14 10:30:30 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2017-05-14 10:30:30 +0200
commit18721cff00415071769de4bd1674296dcc2b25d2 (patch)
tree27571e649ac665f8b7f6c6dcad28d99b196d2322
parent2be128221eca9e5b4cff80ba152db36d40868764 (diff)
Added option to disable vbus sensing in dwc_otg driver.
-rw-r--r--usb/dwc_otg.h8
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);