common: Silence compiler warnings about ignored Result return values.
[gps-watch.git] / src / common / usb_device_config.h
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
35 #ifndef _USB_DEVICE_CONFIG_H_
36 #define _USB_DEVICE_CONFIG_H_
37
38 /*******************************************************************************
39 * Definitions
40 ******************************************************************************/
41 /*!
42  * @name Hardware instance define
43  * @{
44  */
45
46 /*! @brief KHCI instance count */
47 #define USB_DEVICE_CONFIG_KHCI (1U)
48
49 /*! @brief EHCI instance count */
50 #define USB_DEVICE_CONFIG_EHCI (0U)
51
52 /*! @brief LPC USB IP3511 FS instance count */
53 #define USB_DEVICE_CONFIG_LPCIP3511FS (0U)
54
55 /*! @brief LPC USB IP3511 HS instance count */
56 #define USB_DEVICE_CONFIG_LPCIP3511HS (0U)
57
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)
61
62 /* @} */
63
64 /*!
65  * @addtogroup usb_device_configuration
66  * @{
67  */
68
69 /*!
70  * @name class instance define
71  * @{
72  */
73
74 /*! @brief HID instance count */
75 #define USB_DEVICE_CONFIG_HID (0U)
76
77 /*! @brief CDC ACM instance count */
78 #define USB_DEVICE_CONFIG_CDC_ACM (1U)
79
80 /*! @brief MSC instance count */
81 #define USB_DEVICE_CONFIG_MSC (0U)
82
83 /*! @brief Audio instance count */
84 #define USB_DEVICE_CONFIG_AUDIO (0U)
85
86 /*! @brief PHDC instance count */
87 #define USB_DEVICE_CONFIG_PHDC (0U)
88
89 /*! @brief Video instance count */
90 #define USB_DEVICE_CONFIG_VIDEO (0U)
91
92 /*! @brief CCID instance count */
93 #define USB_DEVICE_CONFIG_CCID (0U)
94
95 /*! @brief Printer instance count */
96 #define USB_DEVICE_CONFIG_PRINTER (0U)
97
98 /*! @brief DFU instance count */
99 #define USB_DEVICE_CONFIG_DFU (0U)
100
101 /* @} */
102
103 /*! @brief Whether device is self power. 1U supported, 0U not supported */
104 #define USB_DEVICE_CONFIG_SELF_POWER (1U)
105
106 /*! @brief How many endpoints are supported in the stack. */
107 #define USB_DEVICE_CONFIG_ENDPOINTS (4U)
108
109 /*! @brief Whether the device task is enabled. */
110 #define USB_DEVICE_CONFIG_USE_TASK (0U)
111
112 /*! @brief How many the notification message are supported when the device task is enabled. */
113 #define USB_DEVICE_CONFIG_MAX_MESSAGES (8U)
114
115 /*! @brief Whether test mode enabled. */
116 #define USB_DEVICE_CONFIG_USB20_TEST_MODE (0U)
117
118 /*! @brief Whether device CV test is enabled. */
119 #define USB_DEVICE_CONFIG_CV_TEST (0U)
120
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)
124
125 #if ((defined(USB_DEVICE_CONFIG_COMPLIANCE_TEST)) && (USB_DEVICE_CONFIG_COMPLIANCE_TEST > 0U))
126
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
131
132 /*! @brief enable the test mode. */
133 #define USB_DEVICE_CONFIG_USB20_TEST_MODE (1U)
134
135 /*! @brief enable the CV test */
136 #define USB_DEVICE_CONFIG_CV_TEST (1U)
137
138 #endif
139
140 #if ((defined(USB_DEVICE_CONFIG_KHCI)) && (USB_DEVICE_CONFIG_KHCI > 0U))
141
142 /*! @brief The MAX buffer length for the KHCI DMA workaround.*/
143 #define USB_DEVICE_CONFIG_KHCI_DMA_ALIGN_BUFFER_LENGTH (64U)
144 #endif
145
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)
149
150 /*! @brief Whether the EHCI ID pin detect feature enabled. */
151 #define USB_DEVICE_CONFIG_EHCI_ID_PIN_DETECT (0U)
152 #endif
153
154 /*! @brief Whether the keep alive feature enabled. */
155 #define USB_DEVICE_CONFIG_KEEP_ALIVE_MODE (0U)
156
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)
160 #endif
161 /*! @brief Whether the low power mode is enabled or not. */
162 #define USB_DEVICE_CONFIG_LOW_POWER_MODE (0U)
163
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)
167
168 /*! @brief Whether LPM is supported. 1U supported, 0U not supported */
169 #define USB_DEVICE_CONFIG_LPM_L1 (0U)
170 #else
171 /*! @brief The device remote wakeup is unsupported. */
172 #define USB_DEVICE_CONFIG_REMOTE_WAKEUP (0U)
173 #endif
174
175 /*! @brief Whether the device detached feature is enabled or not. */
176 #define USB_DEVICE_CONFIG_DETACH_ENABLE (0U)
177
178 /*! @brief Whether handle the USB bus error. */
179 #define USB_DEVICE_CONFIG_ERROR_HANDLING (0U)
180
181 /* @} */
182
183 #endif /* _USB_DEVICE_CONFIG_H_ */