From 57f9f6e3d1abc9893f985ef0efff634b2dfdbeda Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Mon, 30 Jan 2012 22:58:04 -0500 Subject: [PATCH] f4 usb: configure and build ST USB OTG and USB DEV libraries --- .../STM32_USB_Device_Library/Core/inc/usbd_conf.h | 3 --- .../STM32_USB_Device_Library/Core/inc/usbd_desc.h | 1 + .../Libraries/STM32_USB_OTG_Driver/inc/usb_conf.h | 4 ++-- flight/PiOS/STM32F4xx/library.mk | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 flight/PiOS/STM32F4xx/Libraries/STM32_USB_Device_Library/Core/inc/usbd_desc.h diff --git a/flight/PiOS/STM32F4xx/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf.h b/flight/PiOS/STM32F4xx/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf.h index 0c41fcbf6..3cfd5b6d6 100644 --- a/flight/PiOS/STM32F4xx/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf.h +++ b/flight/PiOS/STM32F4xx/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf.h @@ -31,11 +31,8 @@ /** @defgroup USB_CONF_Exported_Defines * @{ */ -#define USE_USB_OTG_HS - #define USBD_CFG_MAX_NUM 1 #define USB_MAX_STR_DESC_SIZ 64 -#define USBD_EP0_MAX_PACKET_SIZE 64 /** * @} diff --git a/flight/PiOS/STM32F4xx/Libraries/STM32_USB_Device_Library/Core/inc/usbd_desc.h b/flight/PiOS/STM32F4xx/Libraries/STM32_USB_Device_Library/Core/inc/usbd_desc.h new file mode 100644 index 000000000..6f0a6d268 --- /dev/null +++ b/flight/PiOS/STM32F4xx/Libraries/STM32_USB_Device_Library/Core/inc/usbd_desc.h @@ -0,0 +1 @@ +#define USBD_ITF_MAX_NUM 2 diff --git a/flight/PiOS/STM32F4xx/Libraries/STM32_USB_OTG_Driver/inc/usb_conf.h b/flight/PiOS/STM32F4xx/Libraries/STM32_USB_OTG_Driver/inc/usb_conf.h index a22c6f101..b479677c3 100644 --- a/flight/PiOS/STM32F4xx/Libraries/STM32_USB_OTG_Driver/inc/usb_conf.h +++ b/flight/PiOS/STM32F4xx/Libraries/STM32_USB_OTG_Driver/inc/usb_conf.h @@ -46,7 +46,7 @@ compiler preprocessor. */ #ifndef USE_USB_OTG_FS - //#define USE_USB_OTG_FS + #define USE_USB_OTG_FS #endif /* USE_USB_OTG_FS */ #ifndef USE_USB_OTG_HS @@ -58,7 +58,7 @@ #endif /* USE_ULPI_PHY */ #ifndef USE_EMBEDDED_PHY - //#define USE_EMBEDDED_PHY + #define USE_EMBEDDED_PHY #endif /* USE_EMBEDDED_PHY */ #ifndef USE_I2C_PHY diff --git a/flight/PiOS/STM32F4xx/library.mk b/flight/PiOS/STM32F4xx/library.mk index ae360ea2e..c86ea86ce 100644 --- a/flight/PiOS/STM32F4xx/library.mk +++ b/flight/PiOS/STM32F4xx/library.mk @@ -45,6 +45,21 @@ PERIPHLIB = $(PIOS_DEVLIB)/Libraries/STM32F4xx_StdPeriph_Driver SRC += $(wildcard $(PERIPHLIB)/src/*.c) EXTRAINCDIRS += $(PERIPHLIB)/inc +# +# ST USB OTG library +# +USBOTGLIB = $(PIOS_DEVLIB)/Libraries/STM32_USB_OTG_Driver +USBOTGLIB_SRC = usb_core.c usb_dcd.c usb_dcd_int.c +SRC += $(addprefix $(USBOTGLIB)/src/,$(USBOTGLIB_SRC)) +EXTRAINCDIRS += $(USBOTGLIB)/inc + +# +# ST USB Device library +# +USBDEVLIB = $(PIOS_DEVLIB)/Libraries/STM32_USB_Device_Library +SRC += $(wildcard $(USBDEVLIB)/Core/src/*.c) +EXTRAINCDIRS += $(USBDEVLIB)/Core/inc + # # FreeRTOS #