added - basic flatUSB_config.h concept added - example JSONs added - CDC request replies fixed
36 lines
768 B
C
36 lines
768 B
C
#ifndef STM32_USB_DRV
|
|
#define STM32_USB_DRV
|
|
|
|
#include "usb_common_defs.h"
|
|
|
|
// Select IO crossbar advanced function
|
|
#if defined(USB_STM32H7)
|
|
#ifndef STM32H723xx
|
|
#define USB_GPIO_AF (GPIO_AF10_OTG2_FS)
|
|
#else
|
|
// #define USB_GPIO_AF (GPIO_AF10_OTG1_HS)
|
|
#endif
|
|
#elif defined(USB_STM32F4)
|
|
#ifdef USB_HIGH_SPEED
|
|
#define USB_GPIO_AF (GPIO_AF10_OTG_HS)
|
|
#else
|
|
#define USB_GPIO_AF (GPIO_AF10_OTG_FS)
|
|
#endif
|
|
#endif
|
|
|
|
// Set TOCAL and TRDT values (see Ref. Man.)
|
|
#if defined(USB_STM32H7) /*|| defined(USB_HIGH_SPEED)*/
|
|
#define TOCAL_VALUE (0x00)
|
|
#define TRDT_VALUE (0x05)
|
|
#elif defined(USB_STM32F4)
|
|
#if !defined(USB_HIGH_SPEED)
|
|
#define TOCAL_VALUE (0x07)
|
|
#define TRDT_VALUE (0x06)
|
|
#else
|
|
#define TOCAL_VALUE (0x07)
|
|
#define TRDT_VALUE (0x09)
|
|
#endif
|
|
#endif
|
|
|
|
#endif /* STM32_USB_DRV */
|