summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Conrad <[email protected]>2019-09-11 20:36:48 -0400
committerNathan Conrad <[email protected]>2019-09-11 20:36:48 -0400
commitd3507b0787c44590b4796bbd6fd4b5a1fb54fb48 (patch)
tree239b531b1e74c14ef626a64be4c0b3d101c627d6 /src
parent3326b9d00802b21d0e31bd58e97ac90fc72dddeb (diff)
parent2683d60b3310a97d657bbe9898313352251b338a (diff)
Merge remote-tracking branch 'origin/master' into stfsdev_cleanups
Diffstat (limited to 'src')
-rw-r--r--src/portable/st/synopsys/dcd_synopsys.c18
-rw-r--r--src/tusb_option.h12
2 files changed, 20 insertions, 10 deletions
diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c
index 57f01d1ac..56660643d 100644
--- a/src/portable/st/synopsys/dcd_synopsys.c
+++ b/src/portable/st/synopsys/dcd_synopsys.c
@@ -28,20 +28,28 @@
#include "tusb_option.h"
#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_STM32F4 || \
- CFG_TUSB_MCU == OPT_MCU_STM32H7 )
+ CFG_TUSB_MCU == OPT_MCU_STM32H7 || \
+ CFG_TUSB_MCU == OPT_MCU_STM32F7)
+// TODO Support OTG_HS
+// EP_MAX : Max number of bi-directional endpoints including EP0
+// EP_FIFO_SIZE : Size of dedicated USB SRAM
#if CFG_TUSB_MCU == OPT_MCU_STM32F4
#include "stm32f4xx.h"
- // TODO Merge with OTG_HS
- // Max endpoints for each direction
+
#define EP_MAX USB_OTG_FS_MAX_IN_ENDPOINTS
#define EP_FIFO_SIZE USB_OTG_FS_TOTAL_FIFO_SIZE
#elif CFG_TUSB_MCU == OPT_MCU_STM32H7
#include "stm32h7xx.h"
- // TODO There is no equivalent macro for max endpoints in H7 header.
- #define EP_MAX 8
+
+ #define EP_MAX 9
#define EP_FIFO_SIZE 4096
// TODO The official name of the USB FS peripheral on H7 is "USB2_OTG_FS".
+#else
+ #include "stm32f7xx.h"
+
+ #define EP_MAX 6
+ #define EP_FIFO_SIZE 1280
#endif
#include "device/dcd.h"
diff --git a/src/tusb_option.h b/src/tusb_option.h
index dc76ce5f6..eccb4245c 100644
--- a/src/tusb_option.h
+++ b/src/tusb_option.h
@@ -52,11 +52,13 @@
#define OPT_MCU_SAMD51 201 ///< MicroChip SAMD51
// ST Synopsis OTG devices
-#define OPT_MCU_STM32F4 300 ///< ST STM32F4
-#define OPT_MCU_STM32F3 301 ///< ST STM32F0x0
-#define OPT_MCU_STM32H7 302 ///< ST STM32H7
-#define OPT_MCU_STM32F0 303 ///< ST STM32F0
-#define OPT_MCU_STM32F1 304 ///< ST STM32F1
+#define OPT_MCU_STM32F0 300 ///< ST STM32F0
+#define OPT_MCU_STM32F1 301 ///< ST STM32F1
+#define OPT_MCU_STM32F2 302 ///< ST STM32F2
+#define OPT_MCU_STM32F3 303 ///< ST STM32F3
+#define OPT_MCU_STM32F4 304 ///< ST STM32F4
+#define OPT_MCU_STM32F7 305 ///< ST STM32F7
+#define OPT_MCU_STM32H7 306 ///< ST STM32H7
/** @} */