19#ifndef TINYUSB_DESCRIPTORS_H
20#define TINYUSB_DESCRIPTORS_H
32#if !defined(CONFIG_TUSBD_USE_CUSTOM_DESC)
34#if !defined(HAVE_TUSBD_ITF_TYPE)
36#if CONFIG_TUSBD_CDC_NUMOF > 0
40#if CONFIG_TUSBD_CDC_NUMOF > 1
44#if CONFIG_TUSBD_DFU_NUMOF
47#if CONFIG_TUSBD_DFU_RT_NUMOF
50#if CONFIG_TUSBD_HID_NUMOF > 0
53#if CONFIG_TUSBD_HID_NUMOF > 1
56#if CONFIG_TUSBD_MSC_NUMOF
59#if CONFIG_TUSBD_NET_NUMOF
63#if CONFIG_TUSBD_VENDOR_NUMOF
70#if !defined(HAVE_TUSBD_EP_TYPE)
72#if CONFIG_TUSBD_CDC_NUMOF > 0
73 TUSBD_EP_CDC_0_NOTIF = TUSBD_ITF_CDC_0 + 0x81,
74 TUSBD_EP_CDC_0_OUT = TUSBD_ITF_CDC_0_DATA + 0x01,
75 TUSBD_EP_CDC_0_IN = TUSBD_ITF_CDC_0_DATA + 0x81,
77#if CONFIG_TUSBD_CDC_NUMOF > 1
78 TUSBD_EP_CDC_1_NOTIF = TUSBD_ITF_CDC_1 + 0x81,
79 TUSBD_EP_CDC_1_OUT = TUSBD_ITF_CDC_1_DATA + 0x01,
80 TUSBD_EP_CDC_1_IN = TUSBD_ITF_CDC_1_DATA + 0x81,
82#if CONFIG_TUSBD_HID_NUMOF > 0
83 TUSBD_EP_HID_0_OUT = TUSBD_ITF_HID_0 + 0x01,
84 TUSBD_EP_HID_0_IN = TUSBD_ITF_HID_0 + 0x81,
86#if CONFIG_TUSBD_HID_NUMOF > 1
87 TUSBD_EP_HID_1_OUT = TUSBD_ITF_HID_1 + 0x01,
88 TUSBD_EP_HID_1_IN = TUSBD_ITF_HID_1 + 0x81,
90#if CONFIG_TUSBD_MSC_NUMOF
91 TUSBD_EP_MSC_OUT = TUSBD_ITF_MSC + 0x01,
92 TUSBD_EP_MSC_IN = TUSBD_ITF_MSC + 0x81,
94#if CONFIG_TUSBD_NET_NUMOF
95 TUSBD_EP_NET_NOTIF = TUSBD_ITF_NET + 0x81,
96 TUSBD_EP_NET_OUT = TUSBD_ITF_NET_DATA + 0x01,
97 TUSBD_EP_NET_IN = TUSBD_ITF_NET_DATA + 0x81,
99#if CONFIG_TUSBD_VENDOR_NUMOF
100 TUSBD_EP_VENDOR_OUT = TUSBD_ITF_VENDOR + 0x01,
101 TUSBD_EP_VENDOR_IN = TUSBD_ITF_VENDOR + 0x81,
107#if !defined(HAVE_TUSBD_STR_IDX_TYPE)
109 TUSBD_STR_IDX_LANGUAGE = 0,
110 TUSBD_STR_IDX_MANUFACTURER,
111 TUSBD_STR_IDX_PRODUCT,
112 TUSBD_STR_IDX_SERIAL,
113#if CONFIG_TUSBD_CDC_NUMOF > 0
116#if CONFIG_TUSBD_CDC_NUMOF > 1
119#if CONFIG_TUSBD_DFU_NUMOF
120 TUSBD_STR_IDX_DFU_SLOT_0,
121 TUSBD_STR_IDX_DFU_SLOT_1,
123#if CONFIG_TUSBD_DFU_RT_NUMOF
124 TUSBD_STR_IDX_DFU_RT,
126#if CONFIG_TUSBD_HID_NUMOF > 0
129#if CONFIG_TUSBD_HID_NUMOF > 1
132#if CONFIG_TUSBD_MSC_NUMOF
136#if CONFIG_TUSBD_NET_NUMOF
137#if CONFIG_TUSBD_NET_CDC_ECM
138 TUSBD_STR_IDX_NET_CDC_ECM,
140#if CONFIG_TUSBD_NET_CDC_NCM
141 TUSBD_STR_IDX_NET_CDC_NCM,
143#if CONFIG_TUSBD_NET_RNDIS
144 TUSBD_STR_IDX_NET_RNDIS,
146 TUSBD_STR_IDX_NET_MAC,
149#if CONFIG_TUSBD_VENDOR_NUMOF
150 TUSBD_STR_IDX_VENDOR,
157#define CONFIG_TUSBD_DFU_ALT_NUMOF 2
159#if !defined(TUSBD_DESC_TOTAL_LEN)
161#if CONFIG_TUSBD_NET_CDC_ECM
162#define TUSBD_DESC_NET_LEN TUD_CDC_ECM_DESC_LEN
163#elif CONFIG_TUSBD_NET_CDC_NCM
164#define TUSBD_DESC_NET_LEN TUD_CDC_NCM_DESC_LEN
165#elif CONFIG_TUSBD_NET_RNDIS
166#define TUSBD_DESC_NET_LEN TUD_RNDIS_DESC_LEN
168#define TUSBD_DESC_NET_LEN 0
171#define TUSBD_DESC_TOTAL_LEN (TUD_CONFIG_DESC_LEN + \
172 (CONFIG_TUSBD_CDC_NUMOF * TUD_CDC_DESC_LEN) + \
173 (CONFIG_TUSBD_DFU_NUMOF * TUD_DFU_DESC_LEN(CONFIG_TUSBD_DFU_ALT_NUMOF)) + \
174 (CONFIG_TUSBD_DFU_RT_NUMOF * TUD_DFU_RT_DESC_LEN) + \
175 (CONFIG_TUSBD_HID_NUMOF * TUD_HID_INOUT_DESC_LEN) + \
176 (CONFIG_TUSBD_MSC_NUMOF * TUD_MSC_DESC_LEN) + \
177 (CONFIG_TUSBD_VENDOR_NUMOF * TUD_VENDOR_DESC_LEN) + \
186#if CONFIG_TUSBD_NET_CDC_ECM && CONFIG_TUSBD_NET_RNDIS
188#define TUSBD_DESC_ALT_NET_LEN TUD_RNDIS_DESC_LEN
190#define TUSBD_DESC_ALT_TOTAL_LEN (TUD_CONFIG_DESC_LEN + \
191 (CONFIG_TUSBD_CDC_NUMOF * TUD_CDC_DESC_LEN) + \
192 (CONFIG_TUSBD_DFU_NUMOF * TUD_DFU_DESC_LEN(CONFIG_TUSBD_DFU_ALT_NUMOF)) + \
193 (CONFIG_TUSBD_DFU_RT_NUMOF * TUD_DFU_RT_DESC_LEN) + \
194 (CONFIG_TUSBD_HID_NUMOF * TUD_HID_INOUT_DESC_LEN) + \
195 (CONFIG_TUSBD_MSC_NUMOF * TUD_MSC_DESC_LEN) + \
196 (CONFIG_TUSBD_VENDOR_NUMOF * TUD_VENDOR_DESC_LEN) + \
197 TUSBD_DESC_ALT_NET_LEN)
TinyUSB default configurations.