usb_config.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #ifndef _USB_CONFIG_H
  2. #define _USB_CONFIG_H
  3. /* USB common Configuration */
  4. #ifndef CONFIG_USB_DBG_LEVEL
  5. #define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
  6. #endif
  7. #ifndef CONFIG_USB_PRINTF
  8. #define CONFIG_USB_PRINTF printf
  9. #endif
  10. #define CONFIG_USB_PRINTF_COLOR_ENABLE
  11. /* USB DEVICE Configuration */
  12. /* core */
  13. #ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
  14. #define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
  15. #endif
  16. // #define CONFIG_USBDEV_SETUP_LOG_PRINT
  17. // #define CONFIG_USBDEV_DESC_CHECK
  18. // #define CONFIG_USBDEV_TEST_MODE
  19. /* cdc class */
  20. // #define CONFIG_USBDEV_CDC_ACM_UART
  21. /* msc class */
  22. #ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
  23. #define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
  24. #endif
  25. #ifndef CONFIG_USBDEV_MSC_PRODUCT_STRING
  26. #define CONFIG_USBDEV_MSC_PRODUCT_STRING ""
  27. #endif
  28. #ifndef CONFIG_USBDEV_MSC_VERSION_STRING
  29. #define CONFIG_USBDEV_MSC_VERSION_STRING "0.01"
  30. #endif
  31. // #define CONFIG_USBDEV_MSC_THREAD
  32. #ifdef CONFIG_USBDEV_MSC_THREAD
  33. #ifndef CONFIG_USBDEV_MSC_STACKSIZE
  34. #define CONFIG_USBDEV_MSC_STACKSIZE 2048
  35. #endif
  36. #ifndef CONFIG_USBDEV_MSC_PRIO
  37. #define CONFIG_USBDEV_MSC_PRIO 4
  38. #endif
  39. #endif
  40. /* audio class */
  41. #ifndef CONFIG_USBDEV_AUDIO_VERSION
  42. #define CONFIG_USBDEV_AUDIO_VERSION 0x0100
  43. #endif
  44. #ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
  45. #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
  46. #endif
  47. /* USB HOST Configuration */
  48. #ifndef CONFIG_USBHOST_RHPORTS
  49. #define CONFIG_USBHOST_RHPORTS 1
  50. #endif
  51. #ifndef CONFIG_USBHOST_EHPORTS
  52. #define CONFIG_USBHOST_EHPORTS 4
  53. #endif
  54. #ifndef CONFIG_USBHOST_PIPE_NUM
  55. #define CONFIG_USBHOST_PIPE_NUM 10
  56. #endif
  57. #ifndef CONFIG_USBHOST_INTF_NUM
  58. #define CONFIG_USBHOST_INTF_NUM 6
  59. #endif
  60. #ifndef CONFIG_USBHOST_EP_NUM
  61. #define CONFIG_USBHOST_EP_NUM 4
  62. #endif
  63. #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT
  64. #define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 5000
  65. #endif
  66. #ifndef CONFIG_USBHOST_MSC_TIMEOUT
  67. #define CONFIG_USBHOST_MSC_TIMEOUT 5000
  68. #endif
  69. #ifndef CONFIG_USBHOST_HPWORKQ_PRIO
  70. #define CONFIG_USBHOST_HPWORKQ_PRIO 5
  71. #endif
  72. #ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
  73. #define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
  74. #endif
  75. #ifndef CONFIG_USBHOST_LPWORKQ_PRIO
  76. #define CONFIG_USBHOST_LPWORKQ_PRIO 1
  77. #endif
  78. #ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
  79. #define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
  80. #endif
  81. #ifndef CONFIG_USBHOST_PSC_PRIO
  82. #define CONFIG_USBHOST_PSC_PRIO 4
  83. #endif
  84. #ifndef CONFIG_USBHOST_PSC_STACKSIZE
  85. #define CONFIG_USBHOST_PSC_STACKSIZE 4096
  86. #endif
  87. #ifndef CONFIG_USBHOST_DEV_NAMELEN
  88. #define CONFIG_USBHOST_DEV_NAMELEN 16
  89. #endif
  90. #define CONFIG_USBHOST_ASYNCH
  91. //#define CONFIG_USBHOST_GET_STRING_DESC
  92. /* EHCI Configuration */
  93. #define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
  94. #define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
  95. #define CONFIG_USB_EHCI_QH_NUM (10)
  96. #define CONFIG_USB_EHCI_QTD_NUM (10)
  97. // #define CONFIG_USB_EHCI_INFO_ENABLE
  98. // #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
  99. #define CONFIG_USB_EHCI_CONFIGFLAG
  100. #endif