38#if __has_include("tinyusb_app_config.h")
39#include "tinyusb_app_config.h"
43#if MODULE_TINYUSB_CLASS_NET
49#if MODULE_TINYUSB_CLASS_NET_CDC_NCM && (MODULE_TINYUSB_CLASS_NET_CDC_ECM || MODULE_TINYUSB_CLASS_NET_RNDIS)
50#error "CDC NCM device class cannot be used together with CDC ECM or RNDIS device class"
53#ifndef CONFIG_TUSBD_AUDIO_NUMOF
54#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_AUDIO
55#define CONFIG_TUSBD_AUDIO_NUMOF 1
57#define CONFIG_TUSBD_AUDIO_NUMOF 0
61#ifndef CONFIG_TUSBD_BTH_NUMOF
62#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_BTH
63#define CONFIG_TUSBD_BTH_NUMOF 1
65#define CONFIG_TUSBD_BTH_NUMOF 0
69#ifndef CONFIG_TUSBD_CDC_NUMOF
70#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_CDC
71#define CONFIG_TUSBD_CDC_NUMOF 1
73#define CONFIG_TUSBD_CDC_NUMOF 0
77#ifndef CONFIG_TUSBD_DFU_NUMOF
78#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_DFU
79#define CONFIG_TUSBD_DFU_NUMOF 1
81#define CONFIG_TUSBD_DFU_NUMOF 0
85#ifndef CONFIG_TUSBD_DFU_RT_NUMOF
86#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_DFU_RUNTIME
87#define CONFIG_TUSBD_DFU_RT_NUMOF 1
89#define CONFIG_TUSBD_DFU_RT_NUMOF 0
93#ifndef CONFIG_TUSBD_HID_NUMOF
94#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_HID
95#define CONFIG_TUSBD_HID_NUMOF 1
97#define CONFIG_TUSBD_HID_NUMOF 0
101#ifndef CONFIG_TUSBD_MIDI_NUMOF
102#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_MIDI
103#define CONFIG_TUSBD_MIDI_NUMOF 1
105#define CONFIG_TUSBD_MIDI_NUMOF 0
109#ifndef CONFIG_TUSBD_MSC_NUMOF
110#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_MSC
111#define CONFIG_TUSBD_MSC_NUMOF 1
113#define CONFIG_TUSBD_MSC_NUMOF 0
117#ifndef CONFIG_TUSBD_USBTMC_NUMOF
118#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_USBTMC
119#define CONFIG_TUSBD_USBTMC_NUMOF 1
121#define CONFIG_TUSBD_USBTMC_NUMOF 0
125#ifndef CONFIG_TUSBD_VENDOR_NUMOF
126#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_VENDOR
127#define CONFIG_TUSBD_VENDOR_NUMOF 1
129#define CONFIG_TUSBD_VENDOR_NUMOF 0
133#ifndef CONFIG_TUSBD_VIDEO_NUMOF
134#if MODULE_TINYUSB_DEVICE && MODULE_TINYUSB_CLASS_VIDEO
135#define CONFIG_TUSBD_VIDEO_NUMOF 1
137#define CONFIG_TUSBD_VIDEO_NUMOF 0
141#ifndef CONFIG_TUSBH_CDC_NUMOF
142#if MODULE_TINYUSB_HOST && MODULE_TINYUSB_CLASS_CDC
143#define CONFIG_TUSBH_CDC_NUMOF 1
145#define CONFIG_TUSBH_CDC_NUMOF 0
149#ifndef CONFIG_TUSBH_HID_NUMOF
150#if MODULE_TINYUSB_HOST && MODULE_TINYUSB_CLASS_HID
151#define CONFIG_TUSBH_HID_NUMOF 1
153#define CONFIG_TUSBH_HID_NUMOF 0
157#ifndef CONFIG_TUSBH_HUB_NUMOF
158#if MODULE_TINYUSB_HOST && MODULE_TINYUSB_CLASS_HUB
159#define CONFIG_TUSBH_HUB_NUMOF 1
161#define CONFIG_TUSBH_HUB_NUMOF 0
165#ifndef CONFIG_TUSBH_MSC_NUMOF
166#if MODULE_TINYUSB_HOST && MODULE_TINYUSB_CLASS_MSC
167#define CONFIG_TUSBH_MSC_NUMOF 1
169#define CONFIG_TUSBH_MSC_NUMOF 0
173#ifndef CONFIG_TUSBH_VENDOR_NUMOF
174#if MODULE_TINYUSB_HOST && MODULE_TINYUSB_CLASS_VENDOR
175#define CONFIG_TUSBH_VENDOR_NUMOF 1
177#define CONFIG_TUSBH_VENDOR_NUMOF 0
181#ifndef CONFIG_TUSBD_EP0_SIZE
182#define CONFIG_TUSBD_EP0_SIZE 64
185#ifndef CONFIG_TUSBD_FS_EP_SIZE
186#define CONFIG_TUSBD_FS_EP_SIZE 64
189#ifndef CONFIG_TUSBD_HS_EP_SIZE
190#define CONFIG_TUSBD_HS_EP_SIZE 512
193#ifndef CONFIG_TUSBD_CDC_NOTIF_EP_SIZE
194#define CONFIG_TUSBD_CDC_NOTIF_EP_SIZE 8
197#ifndef CONFIG_TUSBD_CDC_FS_EP_SIZE
198#define CONFIG_TUSBD_CDC_FS_EP_SIZE CONFIG_TUSBD_FS_EP_SIZE
201#ifndef CONFIG_TUSBD_CDC_HS_EP_SIZE
202#define CONFIG_TUSBD_CDC_HS_EP_SIZE CONFIG_TUSBD_HS_EP_SIZE
205#ifndef CONFIG_TUSBD_DFU_ATTR
206#define CONFIG_TUSBD_DFU_ATTR (DFU_ATTR_CAN_DOWNLOAD | \
207 DFU_ATTR_WILL_DETACH | \
208 DFU_ATTR_MANIFESTATION_TOLERANT)
211#ifndef CONFIG_TUSBD_DFU_DETACH_TIMEOUT
212#define CONFIG_TUSBD_DFU_DETACH_TIMEOUT 1000
215#ifndef CONFIG_TUSBD_DFU_POLL_TIMEOUT
216#define CONFIG_TUSBD_DFU_POLL_TIMEOUT 1
219#ifndef CONFIG_TUSBD_DFU_RESET_DELAY
220#define CONFIG_TUSBD_DFU_RESET_DELAY 2
223#ifndef CONFIG_TUSBD_DFU_FS_XFER_SIZE
224#define CONFIG_TUSBD_DFU_FS_XFER_SIZE CONFIG_TUSBD_FS_EP_SIZE
227#ifndef CONFIG_TUSBD_DFU_HS_XFER_SIZE
228#define CONFIG_TUSBD_DFU_HS_XFER_SIZE CONFIG_TUSBD_HS_EP_SIZE
231#ifndef CONFIG_TUSBD_HID_EP_SIZE
232#define CONFIG_TUSBD_HID_EP_SIZE CONFIG_TUSBD_FS_EP_SIZE
235#ifndef CONFIG_TUSBD_DFU_RT_DETACH_TIMEOUT
236#define CONFIG_TUSBD_DFU_RT_DETACH_TIMEOUT 1000
239#ifndef CONFIG_TUSBD_DFU_RT_FS_XFER_SIZE
240#define CONFIG_TUSBD_DFU_RT_FS_XFER_SIZE CONFIG_TUSBD_FS_EP_SIZE
243#ifndef CONFIG_TUSBD_DFU_RT_HS_XFER_SIZE
244#define CONFIG_TUSBD_DFU_RT_HS_XFER_SIZE CONFIG_TUSBD_HS_EP_SIZE
247#ifndef CONFIG_TUSBD_HID_EP_SIZE
248#define CONFIG_TUSBD_HID_EP_SIZE CONFIG_TUSBD_FS_EP_SIZE
251#ifndef CONFIG_TUSBD_HID_0_POLL_INTERVALL
252#define CONFIG_TUSBD_HID_0_POLL_INTERVALL 10
255#ifndef CONFIG_TUSBD_HID_1_POLL_INTERVALL
256#define CONFIG_TUSBD_HID_1_POLL_INTERVALL 10
259#ifndef CONFIG_TUSBD_MSC_FS_EP_SIZE
260#define CONFIG_TUSBD_MSC_FS_EP_SIZE CONFIG_TUSBD_FS_EP_SIZE
263#ifndef CONFIG_TUSBD_MSC_HS_EP_SIZE
264#define CONFIG_TUSBD_MSC_HS_EP_SIZE CONFIG_TUSBD_HS_EP_SIZE
267#ifndef CONFIG_TUSBD_NET_FS_EP_SIZE
268#define CONFIG_TUSBD_NET_FS_EP_SIZE CONFIG_TUSBD_FS_EP_SIZE
271#ifndef CONFIG_TUSBD_NET_HS_EP_SIZE
272#define CONFIG_TUSBD_NET_HS_EP_SIZE CONFIG_TUSBD_HS_EP_SIZE
275#ifndef CONFIG_TUSBD_VENDOR_FS_EP_SIZE
276#define CONFIG_TUSBD_VENDOR_FS_EP_SIZE CONFIG_TUSBD_FS_EP_SIZE
279#ifndef CONFIG_TUSBD_VENDOR_HS_EP_SIZE
280#define CONFIG_TUSBD_VENDOR_HS_EP_SIZE CONFIG_TUSBD_HS_EP_SIZE
283#ifndef CONFIG_TUSBD_NET_NOTIF_EP_SIZE
284#define CONFIG_TUSBD_NET_NOTIF_EP_SIZE 64
287#ifndef CONFIG_TUSBD_NET_MTU_SIZE
288#define CONFIG_TUSBD_NET_MTU_SIZE ETHERNET_FRAME_LEN
291#if MODULE_TINYUSB_CLASS_NET_CDC_ECM
292#define CONFIG_TUSBD_NET_CDC_ECM 1
294#define CONFIG_TUSBD_NET_CDC_ECM 0
297#if MODULE_TINYUSB_CLASS_NET_CDC_NCM
298#define CONFIG_TUSBD_NET_CDC_NCM 1
300#define CONFIG_TUSBD_NET_CDC_NCM 0
303#if MODULE_TINYUSB_CLASS_NET_RNDIS
304#define CONFIG_TUSBD_NET_RNDIS 1
306#define CONFIG_TUSBD_NET_RNDIS 0
309#if CONFIG_TUSBD_NET_CDC_ECM || CONFIG_TUSBD_NET_CDC_NCM || CONFIG_TUSBD_NET_RNDIS
310#define CONFIG_TUSBD_NET_NUMOF 1
312#define CONFIG_TUSBD_NET_NUMOF 0
315#ifndef CONFIG_TUSBH_ENUM_SIZE
316#define CONFIG_TUSBH_ENUM_SIZE 256
319#ifndef CONFIG_TUSBH_HID_EPIN_SIZE
320#define CONFIG_TUSBH_HID_EPIN_SIZE CONFIG_TUSBD_HID_EP_SIZE
323#ifndef CONFIG_TUSBH_HID_EPOUT_SIZE
324#define CONFIG_TUSBH_HID_EPOUT_SIZE CONFIG_TUSBD_HID_EP_SIZE
333#error CFG_TUSB_MCU must be defined
337#define CFG_TUSB_OS OPT_OS_CUSTOM
340#ifndef CFG_TUSB_DEBUG
341#define CFG_TUSB_DEBUG 0
352#define CFG_TUSB_MEM_SECTION
353#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
361#define CFG_TUD_ENABLED MODULE_TINYUSB_DEVICE
363#define CFG_TUD_ENDPOINT0_SIZE CONFIG_TUSBD_EP0_SIZE
365#define CFG_TUD_AUDIO CONFIG_TUSBD_AUDIO_NUMOF
366#define CFG_TUD_BTH CONFIG_TUSBD_BTH_NUMOF
367#define CFG_TUD_CDC CONFIG_TUSBD_CDC_NUMOF
368#define CFG_TUD_ECM_RNDIS (CONFIG_TUSBD_NET_CDC_ECM || CONFIG_TUSBD_NET_RNDIS)
369#define CFG_TUD_DFU CONFIG_TUSBD_DFU_NUMOF
370#define CFG_TUD_DFU_RUNTIME CONFIG_TUSBD_DFU_RT_NUMOF
371#define CFG_TUD_HID CONFIG_TUSBD_HID_NUMOF
372#define CFG_TUD_MIDI CONFIG_TUSBD_MIDI_NUMOF
373#define CFG_TUD_MSC CONFIG_TUSBD_MSC_NUMOF
374#define CFG_TUD_NCM CONFIG_TUSBD_NET_CDC_NCM
375#define CFG_TUD_USBTMC CONFIG_TUSBD_USBTMC_NUMOF
376#define CFG_TUD_VENDOR CONFIG_TUSBD_VENDOR_NUMOF
377#define CFG_TUD_VIDEO CONFIG_TUSBD_VIDEO_NUMOF
385#define CFG_TUH_ENABLED MODULE_TINYUSB_HOST
387#define CFG_TUH_MAX_SPEED OPT_MODE_DEFAULT_SPEED
389#define CFG_TUH_ENUMERATION_BUFSIZE CONFIG_TUSBH_ENUM_SIZE
392#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 4 : 1)
394#define CFG_TUH_CDC CONFIG_TUSBH_CDC_NUMOF
395#define CFG_TUH_HID CONFIG_TUSBH_HID_NUMOF
396#define CFG_TUH_HUB CONFIG_TUSBH_HUB_NUMOF
397#define CFG_TUH_MSC CONFIG_TUSBH_MSC_NUMOF
398#define CFG_TUH_VENDOR CONFIG_TUSBH_VENDOR_NUMOF
406#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? CONFIG_TUSBD_CDC_HS_EP_SIZE \
407 : CONFIG_TUSBD_CDC_FS_EP_SIZE)
408#define CFG_TUD_CDC_RX_BUFSIZE CFG_TUD_CDC_EP_BUFSIZE
409#define CFG_TUD_CDC_TX_BUFSIZE CFG_TUD_CDC_EP_BUFSIZE
417#define CFG_TUD_DFU_XFER_BUFSIZE (TUD_OPT_HIGH_SPEED ? CONFIG_TUSBD_DFU_HS_XFER_SIZE \
418 : CONFIG_TUSBD_DFU_FS_XFER_SIZE)
425#define CFG_TUD_HID_EP_BUFSIZE CONFIG_TUSBD_HID_EP_SIZE
432#define CFG_TUD_MIDI_RX_BUFSIZE CFG_TUD_MIDI_EP_BUFSIZE
433#define CFG_TUD_MIDI_TX_BUFSIZE CFG_TUD_MIDI_EP_BUFSIZE
440#define CFG_TUD_MSC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? CONFIG_TUSBD_MSC_HS_EP_SIZE \
441 : CONFIG_TUSBD_MSC_FS_EP_SIZE)
448#define CFG_TUD_NET_MTU CONFIG_TUSBD_NET_MTU_SIZE
454#define CFG_TUH_HID_EPIN_BUFSIZE CONFIG_TUSBH_HID_EPIN_SIZE
455#define CFG_TUH_HID_EPOUT_BUFSIZE CONFIG_TUSBH_HID_EPOUT_SIZE
Definitions for Ethernet.