summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-05-04 15:10:17 +0200
committerHiFiPhile <[email protected]>2025-05-04 15:10:17 +0200
commit6a92b8efa442d0bfffa5bb43419d35d12c753910 (patch)
tree7402e51b0d14bcd627a20b31a3b5ba3463f1a112 /src/portable
parent1a783b357343d053eb861ae783922371ce9e1b17 (diff)
dcd/ci_hs: add vbus charge option.
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/chipidea/ci_hs/dcd_ci_hs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/portable/chipidea/ci_hs/dcd_ci_hs.c b/src/portable/chipidea/ci_hs/dcd_ci_hs.c
index a716dc24c..244f5a2d4 100644
--- a/src/portable/chipidea/ci_hs/dcd_ci_hs.c
+++ b/src/portable/chipidea/ci_hs/dcd_ci_hs.c
@@ -239,7 +239,11 @@ bool dcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
usbmode |= USBMODE_CM_DEVICE;
dcd_reg->USBMODE = usbmode;
+#ifdef CFG_TUD_CI_HS_VBUS_CHARGE
+ dcd_reg->OTGSC = OTGSC_VBUS_CHARGE | OTGSC_OTG_TERMINATION;
+#else
dcd_reg->OTGSC = OTGSC_VBUS_DISCHARGE | OTGSC_OTG_TERMINATION;
+#endif
#if !TUD_OPT_HIGH_SPEED
dcd_reg->PORTSC1 = PORTSC1_FORCE_FULL_SPEED;