aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3/stm32/otg_fs.h
diff options
context:
space:
mode:
authorGareth McMullin2011-10-29 21:30:26 +1300
committerGareth McMullin2011-10-29 21:30:26 +1300
commitb05a5dcf2a2d5aa42e80cabf6aaf7a63133b5332 (patch)
tree3dbefa4964a5c6a14e5105bb697d7f16ed0ce457 /include/libopencm3/stm32/otg_fs.h
parentf9a28a3d5e7438842f64c123ffff2488bdccff4d (diff)
Fixed some F105/F107 USB issues. Added user callback on SOF.
Made examples depend on lib.
Diffstat (limited to 'include/libopencm3/stm32/otg_fs.h')
-rw-r--r--include/libopencm3/stm32/otg_fs.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/libopencm3/stm32/otg_fs.h b/include/libopencm3/stm32/otg_fs.h
index e1d7a6a..18709e8 100644
--- a/include/libopencm3/stm32/otg_fs.h
+++ b/include/libopencm3/stm32/otg_fs.h
@@ -39,7 +39,7 @@
#define OTG_FS_GCCFG MMIO32(USB_OTG_FS_BASE + 0x038)
#define OTG_FS_CID MMIO32(USB_OTG_FS_BASE + 0x03C)
#define OTG_FS_HPTXFSIZ MMIO32(USB_OTG_FS_BASE + 0x100)
-#define OTG_FS_DIEPTXF(x) MMIO32(USB_OTG_FS_BASE + 0x104 + 4*(x))
+#define OTG_FS_DIEPTXF(x) MMIO32(USB_OTG_FS_BASE + 0x104 + 4*(x-1))
/* Host-mode Control and Status Registers */
#define OTG_FS_HCFG MMIO32(USB_OTG_FS_BASE + 0x400)
@@ -81,7 +81,7 @@
#define OTG_FS_PCGCCTL MMIO32(USB_OTG_FS_BASE + 0xE00)
/* Data FIFO */
-#define OTG_FS_FIFO(x) ((u32*)(USB_OTG_FS_BASE + (((x) + 1) << 12)))
+#define OTG_FS_FIFO(x) ((volatile u32*)(USB_OTG_FS_BASE + (((x) + 1) << 12)))
/* Global CSRs */
/* OTG_FS AHB configuration register (OTG_FS_GAHBCFG) */
@@ -100,8 +100,7 @@
#define OTG_FS_GUSBCFG_FHMOD 0x20000000
#define OTG_FS_GUSBCFG_FDMOD 0x40000000
#define OTG_FS_GUSBCFG_CTXPKT 0x80000000
-/* WARNING: not in reference manual */
-#define OTG_FS_GUSBCFG_PHYSEL (1 << 6)
+#define OTG_FS_GUSBCFG_PHYSEL (1 << 7)
/* OTG_FS reset register (OTG_FS_GRSTCTL) */
#define OTG_FS_GRSTCTL_AHBIDL (1 << 31)