diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-15 17:58:54 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-15 17:58:54 +0000 |
commit | 959ba74831ee6f6c253f345f6db3e920d7a7bbcc (patch) | |
tree | c4b6b6cd353d5f26b5a944e52be46c57dd89542c /nuttx/arch/arm/src | |
parent | 1dbf5d6093e7058ee8bda9d8e97349ce6441b375 (diff) |
Some repartitioning of STM32 functionality to better support a USB host driver
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5028 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch/arm/src')
-rw-r--r-- | nuttx/arch/arm/src/stm32/Make.defs | 6 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_otgfshost.c (renamed from nuttx/arch/arm/src/stm32/stm32_usbhost.c) | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_usbhost.h | 31 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c | 2 |
5 files changed, 40 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/stm32/Make.defs b/nuttx/arch/arm/src/stm32/Make.defs index 9cdf1314ec..24af16c951 100644 --- a/nuttx/arch/arm/src/stm32/Make.defs +++ b/nuttx/arch/arm/src/stm32/Make.defs @@ -76,6 +76,12 @@ CMN_CSRCS += stm32_otgfsdev.c endif endif +ifeq ($(CONFIG_USBHOST),y) +ifeq ($(CONFIG_STM32_OTGFS),y) +CMN_CSRCS += stm32_otgfshost.c +endif +endif + ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y) CHIP_ASRCS += stm32_vectors.S endif diff --git a/nuttx/arch/arm/src/stm32/stm32_usbhost.c b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c index 4bf6d646da..75283107e3 100644 --- a/nuttx/arch/arm/src/stm32/stm32_usbhost.c +++ b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c @@ -1,5 +1,5 @@ /******************************************************************************* - * arch/arm/src/stm32/stm32_usbhost.c + * arch/arm/src/stm32/stm32_otgfshost.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/arch/arm/src/stm32/stm32_usbhost.h b/nuttx/arch/arm/src/stm32/stm32_usbhost.h index 854c327235..b4f8932670 100644 --- a/nuttx/arch/arm/src/stm32/stm32_usbhost.h +++ b/nuttx/arch/arm/src/stm32/stm32_usbhost.h @@ -47,6 +47,8 @@ #include "chip.h" #include "chip/stm32_otgfs.h" +#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST) + /************************************************************************************ * Public Functions ************************************************************************************/ @@ -61,11 +63,40 @@ extern "C" { #define EXTERN extern #endif +/*********************************************************************************** + * Name: stm32_usbhost_vbusdrive + * + * Description: + * Enable/disable driving of VBUS 5V output. This function must be provided be + * each platform that implements the STM32 OTG FS host interface + * + * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump + * or, if 5 V are available on the application board, a basic power switch, must + * be added externally to drive the 5 V VBUS line. The external charge pump can + * be driven by any GPIO output. When the application decides to power on VBUS + * using the chosen GPIO, it must also set the port power bit in the host port + * control and status register (PPWR bit in OTG_FS_HPRT). + * + * "The application uses this field to control power to this port, and the core + * clears this bit on an overcurrent condition." + * + * Input Parameters: + * iface - For future growth to handle multiple USB host interface. Should be zero. + * enable - true: enable VBUS power; false: disable VBUS power + * + * Returned Value: + * None + * + ***********************************************************************************/ + +EXTERN void stm32_usbhost_vbusdrive(int iface, bool enable); + #undef EXTERN #if defined(__cplusplus) } #endif #endif /* __ASSEMBLY__ */ +#endif /* CONFIG_STM32_OTGFS && CONFIG_USBHOST */ #endif /* __ARCH_ARM_SRC_STM32_STM32_USBHOST_H */ diff --git a/nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c index 8cfd405ded..335992524c 100644 --- a/nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c +++ b/nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c @@ -616,7 +616,7 @@ static void stm32_stdclockconfig(void) /* Set the PLL dividers and multiplers to configure the main PLL */ regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | - RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PPQ); + RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ); putreg32(regval, STM32_RCC_PLLCFG); /* Enable the main PLL */ diff --git a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c index 7ba341b2b8..45980f2889 100644 --- a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -618,7 +618,7 @@ static void stm32_stdclockconfig(void) /* Set the PLL dividers and multiplers to configure the main PLL */ regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP | - RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PPQ); + RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ); putreg32(regval, STM32_RCC_PLLCFG); /* Enable the main PLL */ |