2 * The Clear BSD License
3 * Copyright (c) 2015, Freescale Semiconductor, Inc.
4 * Copyright 2016 - 2018 NXP
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:
11 * o Redistributions of source code must retain the above copyright notice, this list
12 * of conditions and the following disclaimer.
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.
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.
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.
35 #ifndef _USB_DEVICE_CONFIG_H_
36 #define _USB_DEVICE_CONFIG_H_
38 /*******************************************************************************
40 ******************************************************************************/
42 * @name Hardware instance define
46 /*! @brief KHCI instance count */
47 #define USB_DEVICE_CONFIG_KHCI (1U)
49 /*! @brief EHCI instance count */
50 #define USB_DEVICE_CONFIG_EHCI (0U)
52 /*! @brief LPC USB IP3511 FS instance count */
53 #define USB_DEVICE_CONFIG_LPCIP3511FS (0U)
55 /*! @brief LPC USB IP3511 HS instance count */
56 #define USB_DEVICE_CONFIG_LPCIP3511HS (0U)
58 /*! @brief Device instance count, the sum of KHCI and EHCI instance counts*/
59 #define USB_DEVICE_CONFIG_NUM \
60 (USB_DEVICE_CONFIG_KHCI + USB_DEVICE_CONFIG_EHCI + USB_DEVICE_CONFIG_LPCIP3511FS + USB_DEVICE_CONFIG_LPCIP3511HS)
65 * @addtogroup usb_device_configuration
70 * @name class instance define
74 /*! @brief HID instance count */
75 #define USB_DEVICE_CONFIG_HID (0U)
77 /*! @brief CDC ACM instance count */
78 #define USB_DEVICE_CONFIG_CDC_ACM (1U)
80 /*! @brief MSC instance count */
81 #define USB_DEVICE_CONFIG_MSC (0U)
83 /*! @brief Audio instance count */
84 #define USB_DEVICE_CONFIG_AUDIO (0U)
86 /*! @brief PHDC instance count */
87 #define USB_DEVICE_CONFIG_PHDC (0U)
89 /*! @brief Video instance count */
90 #define USB_DEVICE_CONFIG_VIDEO (0U)
92 /*! @brief CCID instance count */
93 #define USB_DEVICE_CONFIG_CCID (0U)
95 /*! @brief Printer instance count */
96 #define USB_DEVICE_CONFIG_PRINTER (0U)
98 /*! @brief DFU instance count */
99 #define USB_DEVICE_CONFIG_DFU (0U)
103 /*! @brief Whether device is self power. 1U supported, 0U not supported */
104 #define USB_DEVICE_CONFIG_SELF_POWER (1U)
106 /*! @brief How many endpoints are supported in the stack. */
107 #define USB_DEVICE_CONFIG_ENDPOINTS (4U)
109 /*! @brief Whether the device task is enabled. */
110 #define USB_DEVICE_CONFIG_USE_TASK (0U)
112 /*! @brief How many the notification message are supported when the device task is enabled. */
113 #define USB_DEVICE_CONFIG_MAX_MESSAGES (8U)
115 /*! @brief Whether test mode enabled. */
116 #define USB_DEVICE_CONFIG_USB20_TEST_MODE (0U)
118 /*! @brief Whether device CV test is enabled. */
119 #define USB_DEVICE_CONFIG_CV_TEST (0U)
121 /*! @brief Whether device compliance test is enabled. If the macro is enabled,
122 the test mode and CV test macroes will be set.*/
123 #define USB_DEVICE_CONFIG_COMPLIANCE_TEST (0U)
125 #if ((defined(USB_DEVICE_CONFIG_COMPLIANCE_TEST)) && (USB_DEVICE_CONFIG_COMPLIANCE_TEST > 0U))
127 /*! @brief Undefine the marco USB_DEVICE_CONFIG_USB20_TEST_MODE. */
128 #undef USB_DEVICE_CONFIG_USB20_TEST_MODE
129 /*! @brief Undefine the marco USB_DEVICE_CONFIG_CV_TEST. */
130 #undef USB_DEVICE_CONFIG_CV_TEST
132 /*! @brief enable the test mode. */
133 #define USB_DEVICE_CONFIG_USB20_TEST_MODE (1U)
135 /*! @brief enable the CV test */
136 #define USB_DEVICE_CONFIG_CV_TEST (1U)
140 #if ((defined(USB_DEVICE_CONFIG_KHCI)) && (USB_DEVICE_CONFIG_KHCI > 0U))
142 /*! @brief The MAX buffer length for the KHCI DMA workaround.*/
143 #define USB_DEVICE_CONFIG_KHCI_DMA_ALIGN_BUFFER_LENGTH (64U)
146 #if ((defined(USB_DEVICE_CONFIG_EHCI)) && (USB_DEVICE_CONFIG_EHCI > 0U))
147 /*! @brief How many the DTD are supported. */
148 #define USB_DEVICE_CONFIG_EHCI_MAX_DTD (16U)
150 /*! @brief Whether the EHCI ID pin detect feature enabled. */
151 #define USB_DEVICE_CONFIG_EHCI_ID_PIN_DETECT (0U)
154 /*! @brief Whether the keep alive feature enabled. */
155 #define USB_DEVICE_CONFIG_KEEP_ALIVE_MODE (0U)
157 /*! @brief Whether the transfer buffer is cache-enabled or not. */
158 #ifndef USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE
159 #define USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE (0U)
161 /*! @brief Whether the low power mode is enabled or not. */
162 #define USB_DEVICE_CONFIG_LOW_POWER_MODE (0U)
164 #if ((defined(USB_DEVICE_CONFIG_LOW_POWER_MODE)) && (USB_DEVICE_CONFIG_LOW_POWER_MODE > 0U))
165 /*! @brief Whether device remote wakeup supported. 1U supported, 0U not supported */
166 #define USB_DEVICE_CONFIG_REMOTE_WAKEUP (0U)
168 /*! @brief Whether LPM is supported. 1U supported, 0U not supported */
169 #define USB_DEVICE_CONFIG_LPM_L1 (0U)
171 /*! @brief The device remote wakeup is unsupported. */
172 #define USB_DEVICE_CONFIG_REMOTE_WAKEUP (0U)
175 /*! @brief Whether the device detached feature is enabled or not. */
176 #define USB_DEVICE_CONFIG_DETACH_ENABLE (0U)
178 /*! @brief Whether handle the USB bus error. */
179 #define USB_DEVICE_CONFIG_ERROR_HANDLING (0U)
183 #endif /* _USB_DEVICE_CONFIG_H_ */