Handling different STM32 OTG variants through registry.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9569 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-06-04 14:25:28 +00:00
parent ec871b0ef1
commit e0251cf966
2 changed files with 15 additions and 3 deletions

View File

@ -38,9 +38,7 @@
#define EP0_MAX_INSIZE 64
#define EP0_MAX_OUTSIZE 64
#if defined(STM32F7XX)
#define GCCFG_INIT_VALUE GCCFG_PWRDWN
#else
#if STM32_OTG_STEPPING == 1
#if defined(BOARD_OTG_NOVBUSSENS)
#define GCCFG_INIT_VALUE (GCCFG_NOVBUSSENS | GCCFG_VBUSASEN | \
GCCFG_VBUSBSEN | GCCFG_PWRDWN)
@ -48,6 +46,16 @@
#define GCCFG_INIT_VALUE (GCCFG_VBUSASEN | GCCFG_VBUSBSEN | \
GCCFG_PWRDWN)
#endif
#elif STM32_OTG_STEPPING == 2
#if defined(BOARD_OTG_NOVBUSSENS)
#define GCCFG_INIT_VALUE GCCFG_PWRDWN
#else
#define GCCFG_INIT_VALUE (GCCFG_VBDEN | GCCFG_PWRDWN)
#endif
#else
#error "unsupported STM32_OTG_STEPPING"
#endif
/*===========================================================================*/

View File

@ -429,12 +429,16 @@ typedef struct {
* @name GCCFG register bit definitions
* @{
*/
/* Definitions for stepping 1.*/
#define GCCFG_NOVBUSSENS (1U<<21) /**< VBUS sensing disable. */
#define GCCFG_SOFOUTEN (1U<<20) /**< SOF output enable. */
#define GCCFG_VBUSBSEN (1U<<19) /**< Enable the VBUS sensing "B"
device. */
#define GCCFG_VBUSASEN (1U<<18) /**< Enable the VBUS sensing "A"
device. */
/* Definitions for stepping 2.*/
#define GCCFG_VBDEN (1U<<21) /**< VBUS sensing enable. */
#define GCCFG_PWRDWN (1U<<16) /**< Power down. */
/** @} */