summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_otgfshost.c')
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_otgfshost.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
index c3a795faf..68cfe7fca 100644
--- a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
+++ b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
@@ -65,7 +65,7 @@
#include "stm32_usbhost.h"
-#if defined(CONFIG_USBHOST) && defined(CONFIG_STM32_OTGFS)
+#if defined(CONFIG_USBHOST) && (defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_OTGFS2))
/*******************************************************************************
* Definitions
@@ -163,6 +163,13 @@
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
+/* For OTGFS2 mode (FS mode of HS module), remap the IRQ number *****************/
+
+#ifdef CONFIG_STM32_OTGFS2
+# undef STM32_IRQ_OTGFS
+# define STM32_IRQ_OTGFS STM32_IRQ_OTGHS
+#endif
+
/*******************************************************************************
* Private Types
*******************************************************************************/
@@ -4310,9 +4317,15 @@ FAR struct usbhost_connection_s *stm32_otgfshost_initialize(int controller)
* *Pins may vary from device-to-device.
*/
+#ifdef CONFIG_STM32_OTGFS2
+ stm32_configgpio(GPIO_OTGFS2_DM);
+ stm32_configgpio(GPIO_OTGFS2_DP);
+ stm32_configgpio(GPIO_OTGFS2_ID); /* Only needed for OTG */
+#else
stm32_configgpio(GPIO_OTGFS_DM);
stm32_configgpio(GPIO_OTGFS_DP);
stm32_configgpio(GPIO_OTGFS_ID); /* Only needed for OTG */
+#endif
/* SOF output pin configuration is configurable */