1 /* 2 * Copyright (c) 2006-2023, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2019-04-10 ZYH first version 9 * 2019-10-27 flybreak Compatible with the HS 10 */ 11 #ifndef __USBD_CONFIG_H__ 12 #define __USBD_CONFIG_H__ 13 14 #include <rtconfig.h> 15 16 #ifdef BSP_USBD_TYPE_HS 17 #define USBD_IRQ_TYPE OTG_HS_IRQn 18 #define USBD_IRQ_HANDLER OTG_HS_IRQHandler 19 #define USBD_INSTANCE USB_OTG_HS 20 #else 21 #define USBD_IRQ_TYPE OTG_FS_IRQn 22 #define USBD_IRQ_HANDLER OTG_FS_IRQHandler 23 #define USBD_INSTANCE USB_OTG_FS 24 #endif 25 26 #ifdef BSP_USBD_SPEED_HS 27 #define USBD_PCD_SPEED PCD_SPEED_HIGH 28 #elif BSP_USBD_SPEED_HSINFS 29 #define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL 30 #else 31 #define USBD_PCD_SPEED PCD_SPEED_FULL 32 #endif 33 34 #ifdef BSP_USBD_PHY_ULPI 35 #define USBD_PCD_PHY_MODULE PCD_PHY_ULPI 36 #elif BSP_USBD_PHY_UTMI 37 #define USBD_PCD_PHY_MODULE PCD_PHY_UTMI 38 #else 39 #define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED 40 #endif 41 42 #endif 43