mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-06 21:54:15 +01:00
OP-901 updated STM32 USB OTG Driver (updated configuration)
This commit is contained in:
parent
24fcea168c
commit
95a3e99b7c
@ -2,20 +2,26 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file usb_conf.h
|
* @file usb_conf.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V2.0.0
|
* @version V2.1.0
|
||||||
* @date 22-July-2011
|
* @date 19-March-2012
|
||||||
* @brief general low level driver configuration
|
* @brief General low level driver configuration
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
*
|
*
|
||||||
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||||
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
*
|
||||||
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||||
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
* You may not use this file except in compliance with the License.
|
||||||
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
* You may obtain a copy of the License at:
|
||||||
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
*
|
||||||
|
* http://www.st.com/software_license_agreement_liberty_v2
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -26,6 +32,7 @@
|
|||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "stm32f4xx.h"
|
#include "stm32f4xx.h"
|
||||||
|
|
||||||
|
#include "usb_conf.h"
|
||||||
|
|
||||||
/** @addtogroup USB_OTG_DRIVER
|
/** @addtogroup USB_OTG_DRIVER
|
||||||
* @{
|
* @{
|
||||||
@ -45,10 +52,37 @@
|
|||||||
configuration, you can declare the needed define in your toolchain
|
configuration, you can declare the needed define in your toolchain
|
||||||
compiler preprocessor.
|
compiler preprocessor.
|
||||||
*/
|
*/
|
||||||
|
/****************** USB OTG FS PHY CONFIGURATION *******************************
|
||||||
|
* The USB OTG FS Core supports one on-chip Full Speed PHY.
|
||||||
|
*
|
||||||
|
* The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor
|
||||||
|
* when FS core is used.
|
||||||
|
*******************************************************************************/
|
||||||
#ifndef USE_USB_OTG_FS
|
#ifndef USE_USB_OTG_FS
|
||||||
#define USE_USB_OTG_FS
|
#define USE_USB_OTG_FS
|
||||||
#endif /* USE_USB_OTG_FS */
|
#endif /* USE_USB_OTG_FS */
|
||||||
|
|
||||||
|
#ifdef USE_USB_OTG_FS
|
||||||
|
#define USB_OTG_FS_CORE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************** USB OTG HS PHY CONFIGURATION *******************************
|
||||||
|
* The USB OTG HS Core supports two PHY interfaces:
|
||||||
|
* (i) An ULPI interface for the external High Speed PHY: the USB HS Core will
|
||||||
|
* operate in High speed mode
|
||||||
|
* (ii) An on-chip Full Speed PHY: the USB HS Core will operate in Full speed mode
|
||||||
|
*
|
||||||
|
* You can select the PHY to be used using one of these two defines:
|
||||||
|
* (i) USE_ULPI_PHY: if the USB OTG HS Core is to be used in High speed mode
|
||||||
|
* (ii) USE_EMBEDDED_PHY: if the USB OTG HS Core is to be used in Full speed mode
|
||||||
|
*
|
||||||
|
* Notes:
|
||||||
|
* - The USE_ULPI_PHY symbol is defined in the project compiler preprocessor as
|
||||||
|
* default PHY when HS core is used.
|
||||||
|
* - On STM322xG-EVAL and STM324xG-EVAL boards, only configuration(i) is available.
|
||||||
|
* Configuration (ii) need a different hardware, for more details refer to your
|
||||||
|
* STM32 device datasheet.
|
||||||
|
*******************************************************************************/
|
||||||
#ifndef USE_USB_OTG_HS
|
#ifndef USE_USB_OTG_HS
|
||||||
//#define USE_USB_OTG_HS
|
//#define USE_USB_OTG_HS
|
||||||
#endif /* USE_USB_OTG_HS */
|
#endif /* USE_USB_OTG_HS */
|
||||||
@ -151,9 +185,6 @@
|
|||||||
#ifdef USE_EMBEDDED_PHY
|
#ifdef USE_EMBEDDED_PHY
|
||||||
#define USB_OTG_EMBEDDED_PHY_ENABLED
|
#define USB_OTG_EMBEDDED_PHY_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_I2C_PHY
|
|
||||||
#define USB_OTG_I2C_PHY_ENABLED
|
|
||||||
#endif
|
|
||||||
#define USB_OTG_HS_INTERNAL_DMA_ENABLED
|
#define USB_OTG_HS_INTERNAL_DMA_ENABLED
|
||||||
#define USB_OTG_HS_DEDICATED_EP1_ENABLED
|
#define USB_OTG_HS_DEDICATED_EP1_ENABLED
|
||||||
#endif
|
#endif
|
||||||
@ -171,20 +202,21 @@
|
|||||||
//#define USB_OTG_FS_LOW_PWR_MGMT_SUPPORT
|
//#define USB_OTG_FS_LOW_PWR_MGMT_SUPPORT
|
||||||
//#define USB_OTG_FS_SOF_OUTPUT_ENABLED
|
//#define USB_OTG_FS_SOF_OUTPUT_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
//#define VBUS_SENSING_ENABLED
|
||||||
|
/****************** USB OTG MODE CONFIGURATION ********************************/
|
||||||
|
//#define USE_HOST_MODE
|
||||||
|
|
||||||
/****************** USB OTG MODE CONFIGURATION ********************************/
|
/****************** USB OTG MODE CONFIGURATION ********************************/
|
||||||
//#define USE_HOST_MODE
|
//#define USE_HOST_MODE
|
||||||
#define USE_DEVICE_MODE
|
#define USE_DEVICE_MODE
|
||||||
//#define USE_OTG_MODE
|
//#define USE_OTG_MODE
|
||||||
|
|
||||||
|
|
||||||
#ifndef USB_OTG_FS_CORE
|
#ifndef USB_OTG_FS_CORE
|
||||||
#ifndef USB_OTG_HS_CORE
|
#ifndef USB_OTG_HS_CORE
|
||||||
#error "USB_OTG_HS_CORE or USB_OTG_FS_CORE should be defined"
|
#error "USB_OTG_HS_CORE or USB_OTG_FS_CORE should be defined"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef USE_DEVICE_MODE
|
#ifndef USE_DEVICE_MODE
|
||||||
#ifndef USE_HOST_MODE
|
#ifndef USE_HOST_MODE
|
||||||
#error "USE_DEVICE_MODE or USE_HOST_MODE should be defined"
|
#error "USE_DEVICE_MODE or USE_HOST_MODE should be defined"
|
||||||
@ -198,9 +230,7 @@
|
|||||||
#else //USE_USB_OTG_HS
|
#else //USE_USB_OTG_HS
|
||||||
#ifndef USE_ULPI_PHY
|
#ifndef USE_ULPI_PHY
|
||||||
#ifndef USE_EMBEDDED_PHY
|
#ifndef USE_EMBEDDED_PHY
|
||||||
#ifndef USE_I2C_PHY
|
#error "USE_ULPI_PHY or USE_EMBEDDED_PHY should be defined"
|
||||||
#error "USE_ULPI_PHY or USE_EMBEDDED_PHY or USE_I2C_PHY should be defined"
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
#define MAX_DATA_LENGTH 0x200
|
#define MAX_DATA_LENGTH 0xff
|
||||||
|
|
||||||
/** @defgroup USB_CORE_Exported_Types
|
/** @defgroup USB_CORE_Exported_Types
|
||||||
* @{
|
* @{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user