aboutsummaryrefslogtreecommitdiff
path: root/embassy-usb-synopsys-otg/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-usb-synopsys-otg/src/lib.rs')
-rw-r--r--embassy-usb-synopsys-otg/src/lib.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/embassy-usb-synopsys-otg/src/lib.rs b/embassy-usb-synopsys-otg/src/lib.rs
index b145f4aa8..3ff965149 100644
--- a/embassy-usb-synopsys-otg/src/lib.rs
+++ b/embassy-usb-synopsys-otg/src/lib.rs
@@ -584,6 +584,22 @@ impl<'d, const MAX_EP_COUNT: usize> Bus<'d, MAX_EP_COUNT> {
584 }); 584 });
585 } 585 }
586 586
587 pub fn config_v5(&mut self) {
588 let r = self.instance.regs;
589
590 r.gccfg_v3().modify(|w| {
591 w.set_vbvaloven(true);
592 w.set_vbvaloval(true);
593 w.set_vbden(self.config.vbus_detection);
594 });
595
596 // Force B-peripheral session
597 r.gotgctl().modify(|w| {
598 w.set_vbvaloen(!self.config.vbus_detection);
599 w.set_bvaloval(true);
600 });
601 }
602
587 fn init(&mut self) { 603 fn init(&mut self) {
588 let r = self.instance.regs; 604 let r = self.instance.regs;
589 let phy_type = self.instance.phy_type; 605 let phy_type = self.instance.phy_type;