diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | main.cpp | 16 |
2 files changed, 17 insertions, 0 deletions
@@ -1,4 +1,5 @@ *.o *.a *.elf +*.swp .sconsign.dblite @@ -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(); |