flatUSB/driver/stm32/usb_drv.h
Epagris dcf2c2b808 - CMake target on generating descriptors from JSON
added
- basic flatUSB_config.h concept added
- example JSONs added
- CDC request replies fixed
2024-11-14 13:19:09 +01:00

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 */