usbd_config.h 1017 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2006-2021, 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. #include <rtconfig.h>
  14. #ifdef BSP_USBD_TYPE_HS
  15. #define USBD_IRQ_TYPE OTG_HS_IRQn
  16. #define USBD_IRQ_HANDLER OTG_HS_IRQHandler
  17. #define USBD_INSTANCE USB_OTG_HS
  18. #else
  19. #define USBD_IRQ_TYPE OTG_FS_IRQn
  20. #define USBD_IRQ_HANDLER OTG_FS_IRQHandler
  21. #define USBD_INSTANCE USB_OTG_FS
  22. #endif
  23. #ifdef BSP_USBD_SPEED_HS
  24. #define USBD_PCD_SPEED PCD_SPEED_HIGH
  25. #elif BSP_USBD_SPEED_HSINFS
  26. #define USBD_PCD_SPEED PCD_SPEED_HIGH_IN_FULL
  27. #else
  28. #define USBD_PCD_SPEED PCD_SPEED_FULL
  29. #endif
  30. #ifdef BSP_USBD_PHY_ULPI
  31. #define USBD_PCD_PHY_MODULE PCD_PHY_ULPI
  32. #elif BSP_USBD_PHY_UTMI
  33. #define USBD_PCD_PHY_MODULE PCD_PHY_UTMI
  34. #else
  35. #define USBD_PCD_PHY_MODULE PCD_PHY_EMBEDDED
  36. #endif
  37. #endif