diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2012-01-21 21:54:13 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2012-01-21 21:54:13 +0100 |
commit | d734fc168e94f0bdb42f6b28e702d5a909146cef (patch) | |
tree | 6a0680f2cb0f76c72810c379ea196e3b96c31c83 | |
parent | 7891595ded1db9afb0ddffdc7d1292844bdc385d (diff) |
Set some flags for USB initialization.
-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(); |