api_config.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. USB CONFIG 宏
  2. =========================
  3. 设备相关 CONFIG 宏
  4. ---------------------
  5. .. code-block:: C
  6. /* USB DEVICE Configuration */
  7. /* core */
  8. #ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
  9. #define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
  10. #endif
  11. #ifndef CONFIG_USBDEV_DESC_CHECK
  12. #define CONFIG_USBDEV_DESC_CHECK 0
  13. #endif
  14. #ifndef CONFIG_USBDEV_TEST_MODE
  15. #define CONFIG_USBDEV_TEST_MODE 0
  16. #endif
  17. /* msc class */
  18. #ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
  19. #define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
  20. #endif
  21. #ifndef CONFIG_USBDEV_MSC_PRODUCT_STRING
  22. #define CONFIG_USBDEV_MSC_PRODUCT_STRING ""
  23. #endif
  24. #ifndef CONFIG_USBDEV_MSC_VERSION_STRING
  25. #define CONFIG_USBDEV_MSC_VERSION_STRING "0.01"
  26. #endif
  27. /* audio class */
  28. #ifndef CONFIG_USBDEV_AUDIO_VERSION
  29. #define CONFIG_USBDEV_AUDIO_VERSION 0x0100
  30. #endif
  31. #ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
  32. #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
  33. #endif
  34. 主机相关 CONFIG 宏
  35. ---------------------
  36. .. code-block:: C
  37. /* USB HOST Configuration */
  38. #ifndef CONFIG_USBHOST_RHPORTS
  39. #define CONFIG_USBHOST_RHPORTS 1
  40. #endif
  41. #ifndef CONFIG_USBHOST_EHPORTS
  42. #define CONFIG_USBHOST_EHPORTS 4
  43. #endif
  44. #ifndef CONFIG_USBHOST_PIPE_NUM
  45. #define CONFIG_USBHOST_PIPE_NUM 10
  46. #endif
  47. #ifndef CONFIG_USBHOST_INTF_NUM
  48. #define CONFIG_USBHOST_INTF_NUM 6
  49. #endif
  50. #ifndef CONFIG_USBHOST_EP_NUM
  51. #define CONFIG_USBHOST_EP_NUM 4
  52. #endif
  53. #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT
  54. #define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 5000
  55. #endif
  56. #ifndef CONFIG_USBHOST_MSC_TIMEOUT
  57. #define CONFIG_USBHOST_MSC_TIMEOUT 5000
  58. #endif
  59. #ifndef CONFIG_USBHOST_HPWORKQ_PRIO
  60. #define CONFIG_USBHOST_HPWORKQ_PRIO 5
  61. #endif
  62. #ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
  63. #define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
  64. #endif
  65. #ifndef CONFIG_USBHOST_LPWORKQ_PRIO
  66. #define CONFIG_USBHOST_LPWORKQ_PRIO 1
  67. #endif
  68. #ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
  69. #define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
  70. #endif
  71. #ifndef CONFIG_USBHOST_PSC_PRIO
  72. #define CONFIG_USBHOST_PSC_PRIO 4
  73. #endif
  74. #ifndef CONFIG_USBHOST_PSC_STACKSIZE
  75. #define CONFIG_USBHOST_PSC_STACKSIZE 4096
  76. #endif
  77. #ifndef CONFIG_USBHOST_DEV_NAMELEN
  78. #define CONFIG_USBHOST_DEV_NAMELEN 16
  79. #endif
  80. #define CONFIG_USBHOST_ASYNCH
  81. //#define CONFIG_USBHOST_GET_STRING_DESC
  82. /* EHCI Configuration */
  83. #define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
  84. #define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
  85. #define CONFIG_USB_EHCI_QH_NUM (10)
  86. #define CONFIG_USB_EHCI_QTD_NUM (10)
  87. // #define CONFIG_USB_EHCI_INFO_ENABLE
  88. #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
  89. // #define CONFIG_USB_EHCI_CONFIGFLAG