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:
parent
ec871b0ef1
commit
e0251cf966
|
@ -38,9 +38,7 @@
|
||||||
#define EP0_MAX_INSIZE 64
|
#define EP0_MAX_INSIZE 64
|
||||||
#define EP0_MAX_OUTSIZE 64
|
#define EP0_MAX_OUTSIZE 64
|
||||||
|
|
||||||
#if defined(STM32F7XX)
|
#if STM32_OTG_STEPPING == 1
|
||||||
#define GCCFG_INIT_VALUE GCCFG_PWRDWN
|
|
||||||
#else
|
|
||||||
#if defined(BOARD_OTG_NOVBUSSENS)
|
#if defined(BOARD_OTG_NOVBUSSENS)
|
||||||
#define GCCFG_INIT_VALUE (GCCFG_NOVBUSSENS | GCCFG_VBUSASEN | \
|
#define GCCFG_INIT_VALUE (GCCFG_NOVBUSSENS | GCCFG_VBUSASEN | \
|
||||||
GCCFG_VBUSBSEN | GCCFG_PWRDWN)
|
GCCFG_VBUSBSEN | GCCFG_PWRDWN)
|
||||||
|
@ -48,6 +46,16 @@
|
||||||
#define GCCFG_INIT_VALUE (GCCFG_VBUSASEN | GCCFG_VBUSBSEN | \
|
#define GCCFG_INIT_VALUE (GCCFG_VBUSASEN | GCCFG_VBUSBSEN | \
|
||||||
GCCFG_PWRDWN)
|
GCCFG_PWRDWN)
|
||||||
#endif
|
#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
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -429,12 +429,16 @@ typedef struct {
|
||||||
* @name GCCFG register bit definitions
|
* @name GCCFG register bit definitions
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
/* Definitions for stepping 1.*/
|
||||||
#define GCCFG_NOVBUSSENS (1U<<21) /**< VBUS sensing disable. */
|
#define GCCFG_NOVBUSSENS (1U<<21) /**< VBUS sensing disable. */
|
||||||
#define GCCFG_SOFOUTEN (1U<<20) /**< SOF output enable. */
|
#define GCCFG_SOFOUTEN (1U<<20) /**< SOF output enable. */
|
||||||
#define GCCFG_VBUSBSEN (1U<<19) /**< Enable the VBUS sensing "B"
|
#define GCCFG_VBUSBSEN (1U<<19) /**< Enable the VBUS sensing "B"
|
||||||
device. */
|
device. */
|
||||||
#define GCCFG_VBUSASEN (1U<<18) /**< Enable the VBUS sensing "A"
|
#define GCCFG_VBUSASEN (1U<<18) /**< Enable the VBUS sensing "A"
|
||||||
device. */
|
device. */
|
||||||
|
|
||||||
|
/* Definitions for stepping 2.*/
|
||||||
|
#define GCCFG_VBDEN (1U<<21) /**< VBUS sensing enable. */
|
||||||
#define GCCFG_PWRDWN (1U<<16) /**< Power down. */
|
#define GCCFG_PWRDWN (1U<<16) /**< Power down. */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue