usb_device_config.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*
  2. * The Clear BSD License
  3. * Copyright (c) 2015, Freescale Semiconductor, Inc.
  4. * Copyright 2016 - 2018 NXP
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without modification,
  8. * are permitted (subject to the limitations in the disclaimer below) provided
  9. * that the following conditions are met:
  10. *
  11. * o Redistributions of source code must retain the above copyright notice, this list
  12. * of conditions and the following disclaimer.
  13. *
  14. * o Redistributions in binary form must reproduce the above copyright notice, this
  15. * list of conditions and the following disclaimer in the documentation and/or
  16. * other materials provided with the distribution.
  17. *
  18. * o Neither the name of the copyright holder nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  25. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  27. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  28. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  29. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  30. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef _USB_DEVICE_CONFIG_H_
  35. #define _USB_DEVICE_CONFIG_H_
  36. /*******************************************************************************
  37. * Definitions
  38. ******************************************************************************/
  39. /*!
  40. * @name Hardware instance define
  41. * @{
  42. */
  43. /*! @brief KHCI instance count */
  44. #define USB_DEVICE_CONFIG_KHCI (0U)
  45. /*! @brief EHCI instance count */
  46. #define USB_DEVICE_CONFIG_EHCI (0U)
  47. /*! @brief LPC USB IP3511 FS instance count */
  48. #define USB_DEVICE_CONFIG_LPCIP3511FS (1U)
  49. /*! @brief LPC USB IP3511 HS instance count */
  50. #define USB_DEVICE_CONFIG_LPCIP3511HS (0U)
  51. /*! @brief Device instance count, the sum of KHCI and EHCI instance counts*/
  52. #define USB_DEVICE_CONFIG_NUM \
  53. (USB_DEVICE_CONFIG_KHCI + USB_DEVICE_CONFIG_EHCI + USB_DEVICE_CONFIG_LPCIP3511FS + USB_DEVICE_CONFIG_LPCIP3511HS)
  54. /* @} */
  55. /*!
  56. * @addtogroup usb_device_configuration
  57. * @{
  58. */
  59. /*!
  60. * @name class instance define
  61. * @{
  62. */
  63. /*! @brief HID instance count */
  64. #define USB_DEVICE_CONFIG_HID (0U)
  65. /*! @brief CDC ACM instance count */
  66. #define USB_DEVICE_CONFIG_CDC_ACM (1U)
  67. /*! @brief MSC instance count */
  68. #define USB_DEVICE_CONFIG_MSC (0U)
  69. /*! @brief Audio instance count */
  70. #define USB_DEVICE_CONFIG_AUDIO (0U)
  71. /*! @brief PHDC instance count */
  72. #define USB_DEVICE_CONFIG_PHDC (0U)
  73. /*! @brief Video instance count */
  74. #define USB_DEVICE_CONFIG_VIDEO (0U)
  75. /*! @brief CCID instance count */
  76. #define USB_DEVICE_CONFIG_CCID (0U)
  77. /*! @brief Printer instance count */
  78. #define USB_DEVICE_CONFIG_PRINTER (0U)
  79. /*! @brief DFU instance count */
  80. #define USB_DEVICE_CONFIG_DFU (0U)
  81. /* @} */
  82. /*! @brief Whether device is self power. 1U supported, 0U not supported */
  83. #define USB_DEVICE_CONFIG_SELF_POWER (1U)
  84. /*! @brief How many endpoints are supported in the stack. */
  85. #define USB_DEVICE_CONFIG_ENDPOINTS (4U)
  86. /*! @brief Whether the device task is enabled. */
  87. #define USB_DEVICE_CONFIG_USE_TASK (0U)
  88. /*! @brief How many the notification message are supported when the device task is enabled. */
  89. #define USB_DEVICE_CONFIG_MAX_MESSAGES (8U)
  90. /*! @brief Whether test mode enabled. */
  91. #define USB_DEVICE_CONFIG_USB20_TEST_MODE (0U)
  92. /*! @brief Whether device CV test is enabled. */
  93. #define USB_DEVICE_CONFIG_CV_TEST (0U)
  94. /*! @brief Whether device compliance test is enabled. If the macro is enabled,
  95. the test mode and CV test macroes will be set.*/
  96. #define USB_DEVICE_CONFIG_COMPLIANCE_TEST (0U)
  97. #if ((defined(USB_DEVICE_CONFIG_COMPLIANCE_TEST)) && (USB_DEVICE_CONFIG_COMPLIANCE_TEST > 0U))
  98. /*! @brief Undefine the marco USB_DEVICE_CONFIG_USB20_TEST_MODE. */
  99. #undef USB_DEVICE_CONFIG_USB20_TEST_MODE
  100. /*! @brief Undefine the marco USB_DEVICE_CONFIG_CV_TEST. */
  101. #undef USB_DEVICE_CONFIG_CV_TEST
  102. /*! @brief enable the test mode. */
  103. #define USB_DEVICE_CONFIG_USB20_TEST_MODE (1U)
  104. /*! @brief enable the CV test */
  105. #define USB_DEVICE_CONFIG_CV_TEST (1U)
  106. #endif
  107. #if ((defined(USB_DEVICE_CONFIG_KHCI)) && (USB_DEVICE_CONFIG_KHCI > 0U))
  108. /*! @brief The MAX buffer length for the KHCI DMA workaround.*/
  109. #define USB_DEVICE_CONFIG_KHCI_DMA_ALIGN_BUFFER_LENGTH (64U)
  110. #endif
  111. #if ((defined(USB_DEVICE_CONFIG_EHCI)) && (USB_DEVICE_CONFIG_EHCI > 0U))
  112. /*! @brief How many the DTD are supported. */
  113. #define USB_DEVICE_CONFIG_EHCI_MAX_DTD (16U)
  114. /*! @brief Whether the EHCI ID pin detect feature enabled. */
  115. #define USB_DEVICE_CONFIG_EHCI_ID_PIN_DETECT (0U)
  116. #endif
  117. /*! @brief Whether the keep alive feature enabled. */
  118. #define USB_DEVICE_CONFIG_KEEP_ALIVE_MODE (0U)
  119. /*! @brief Whether the transfer buffer is cache-enabled or not. */
  120. #ifndef USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE
  121. #define USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE (0U)
  122. #endif
  123. /*! @brief Whether the low power mode is enabled or not. */
  124. #define USB_DEVICE_CONFIG_LOW_POWER_MODE (0U)
  125. #if ((defined(USB_DEVICE_CONFIG_LOW_POWER_MODE)) && (USB_DEVICE_CONFIG_LOW_POWER_MODE > 0U))
  126. /*! @brief Whether device remote wakeup supported. 1U supported, 0U not supported */
  127. #define USB_DEVICE_CONFIG_REMOTE_WAKEUP (0U)
  128. /*! @brief Whether LPM is supported. 1U supported, 0U not supported */
  129. #define USB_DEVICE_CONFIG_LPM_L1 (0U)
  130. #else
  131. /*! @brief The device remote wakeup is unsupported. */
  132. #define USB_DEVICE_CONFIG_REMOTE_WAKEUP (0U)
  133. #endif
  134. /*! @brief Whether the device detached feature is enabled or not. */
  135. #define USB_DEVICE_CONFIG_DETACH_ENABLE (0U)
  136. /*! @brief Whether handle the USB bus error. */
  137. #define USB_DEVICE_CONFIG_ERROR_HANDLING (0U)
  138. /* @} */
  139. #endif /* _USB_DEVICE_CONFIG_H_ */