From b05a5dcf2a2d5aa42e80cabf6aaf7a63133b5332 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Sat, 29 Oct 2011 21:30:26 +1300 Subject: Fixed some F105/F107 USB issues. Added user callback on SOF. Made examples depend on lib. --- include/libopencm3/stm32/otg_fs.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/libopencm3/stm32') 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) -- cgit v1.2.3