summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 807c0b0..3ea82b8 100644
--- a/main.cpp
+++ b/main.cpp
@@ -28,6 +28,22 @@ int main() {
led_blue.set_mode(Pin::Output);
RCC.enable(RCC.OTGFS);
+
+ // USB configuration
+ OTG_FS.reg.GUSBCFG = (1 << 30) | (0xf << 10) | (1 << 9) | (1 << 8);
+ // FDMOD TRDT HNPCAP SRPCAP
+
+ // interrupt mask
+ OTG_FS.reg.GINTMSK = (1 << 13) | (1 << 12) | (1 << 11) | (1 << 10) | (1 << 3) | (1 << 2) | (1 << 1);
+ // ENUMDNEM USBRST USBSUSPM ESUSPM SOFM OTGINT MMISM
+
+ // device configuration
+ OTG_FS.dev_reg.DCFG = (1 << 2) | 3;
+ // NZLSOHSK DSPD
+
+ // core configuration
+ OTG_FS.reg.GCCFG = (1 << 19);
+ // VBUSBSEN
while(1) {
led_green.on();