#ifndef CORE_USB_USB_COMMON_DEFS #define CORE_USB_USB_COMMON_DEFS #if defined(STM32H745xx) || defined(STM32H743xx) || defined(STM32H723xx) #include #include #if defined(STM32H745xx) || defined(STM32H743xx) #define USBG (USB_OTG_FS) #elif defined(STM32H723xx) #define USBG (USB_OTG_HS) #endif #define USB_STM32H7 #elif defined(STM32F407xx) || defined(STM32F401xC) #include #include #define USB_STM32F4 #ifdef USB_HIGH_SPEED #define USBG (USB_OTG_HS) #else #define USBG (USB_OTG_FS) #endif #endif #define USBD ((USB_OTG_DeviceTypeDef *) (((uint32_t)(USBG)) + ((uint32_t)(USB_OTG_DEVICE_BASE)))) #define USBINEP ((USB_OTG_INEndpointTypeDef *) (((uint32_t)(USBG)) + ((uint32_t)(USB_OTG_IN_ENDPOINT_BASE)))) #define USBOUTEP ((USB_OTG_OUTEndpointTypeDef *) (((uint32_t)(USBG)) + ((uint32_t)(USB_OTG_OUT_ENDPOINT_BASE)))) #define USBFIFO(ep) ((uint32_t *)(((uint32_t)(USBG)) + USB_OTG_FIFO_BASE + (USB_OTG_FIFO_SIZE) * (ep))) #define USBPCGCCTL ((uint32_t *)(((uint32_t)(USBG)) + USB_OTG_PCGCCTL_BASE)) #endif /* CORE_USB_USB_COMMON_DEFS */