/*------------------------------------------------------------------------------
* RL-ARM - USB
*------------------------------------------------------------------------------
* Name: usb_config.c
* Purpose: System Configuration
* Rev.: V4.70
*------------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) 2004-2013 KEIL - An ARM Company. All rights reserved.
*----------------------------------------------------------------------------*/
//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
/*------------------------------------------------------------------------------
* USB Host Configuration
*----------------------------------------------------------------------------*/
// USB Host
// USB Host 0
// Enable the USB Host 0 functionality
// Controller Interface
// Selects the USB Host 0 controller interface
// <0=> Custom <1=> OHCI <2=> Custom EHCI for NXP Devices
//
#define USBH0_ENABLE 0
#define USBH0_HC_IF 0
// USB Host 1
// Enable the USB Host 1 functionality
// Controller Interface
// Selects the USB Host 1 controller interface
// <0=> Custom <1=> OHCI <2=> Custom EHCI for NXP Devices
//
#define USBH1_ENABLE 0
#define USBH1_HC_IF 0
// Class Configuration
// Selects supported classes
// Mass Storage Device Class (MSC)
// Number of concurrent MSC Devices on single USB Host controller <0-15>
//
// Human Interface Device Class (HID)
// Number of concurrent HID Devices on single USB Host controller <0-15>
//
// USB Device Class
// Number of concurrent Custom Class Devices on single USB Host controller <0-15>
//
//
#define USBH_CLASS 0x0000
#define USBH_MSC_NUM 0
#define USBH_HID_NUM 0
#define USBH_CLS_NUM 0
//
/*------------------------------------------------------------------------------
* USB Device Configuration
*----------------------------------------------------------------------------*/
// USB Device
// Enable the USB Device functionality
#define USBD_ENABLE 1
// High-speed
// Enable high-speed functionality (if device supports it)
#define USBD_HS_ENABLE 0
// Device Settings
// These settings affect Device Descriptor
// Power
// Default Power Setting
// <0=> Bus-powered
// <1=> Self-powered
// Max Endpoint 0 Packet Size
// Maximum packet size for endpoint zero (bMaxPacketSize0)
// <8=> 8 Bytes <16=> 16 Bytes <32=> 32 Bytes <64=> 64 Bytes
// Vendor ID <0x0000-0xFFFF>
// Vendor ID assigned by the USB-IF (idVendor)
// Product ID <0x0000-0xFFFF>
// Product ID assigned by the manufacturer (idProduct)
// Device Release Number <0x0000-0xFFFF>
// Device release number in binary-coded decimal (bcdDevice)
//
#define USBD_POWER 0
#define USBD_MAX_PACKET0 64
#define USBD_DEVDESC_IDVENDOR 0xC251
#define USBD_DEVDESC_IDPRODUCT 0xF001
#define USBD_DEVDESC_BCDDEVICE 0x0100
// Configuration Settings
// These settings affect Configuration Descriptor
// Remote Wakeup
// Configuration support for remote wakeup (D5: of bmAttributes)
// Maximum Power Consumption (in mA) <0-510><#/2>
// Maximum power consumption of the USB device
// from the bus in this specific configuration
// when the device is fully operational (bMaxPower)
//
#define USBD_CFGDESC_BMATTRIBUTES 0x80
#define USBD_CFGDESC_BMAXPOWER 0x32
// String Settings
// These settings affect String Descriptor
// Language ID <0x0000-0xFCFF>
// English (United States) = 0x0409
// Manufacturer String
// String descriptor describing manufacturer
// Product String
// String descriptor describing product
// Serial Number
// Enable serial number string
// If disabled serial number string will not be assigned to the USB Device
// Serial Number String
// String descriptor describing device's serial number
//
//
#define USBD_STRDESC_LANGID 0x0409
#define USBD_STRDESC_MAN L"ARM"
#define USBD_STRDESC_PROD L"DAPLink CMSIS-DAP"
#define USBD_STRDESC_SER_ENABLE 1
#define USBD_STRDESC_SER L"123456789012"
// Class Support
// Enables USB Device Class specific Requests
#define USBD_CLASS_ENABLE 1
// Human Interface Device (HID)
// Enable class support for Human Interface Device (HID)
// Interrupt Endpoint Settings
// Interrupt In Endpoint Number <1=> 1 <2=> 2 <3=> 3
// <4=> 4 <5=> 5 <6=> 6 <7=> 7
// <8=> 8 <9=> 9 <10=> 10 <11=> 11
// <12=> 12 <13=> 13 <14=> 14 <15=> 15
// Interrupt Out Endpoint Number <0=> Not used <1=> 1 <2=> 2 <3=> 3
// <4=> 4 <5=> 5 <6=> 6 <7=> 7
// <8=> 8 <9=> 9 <10=> 10 <11=> 11
// <12=> 12 <13=> 13 <14=> 14 <15=> 15
// If interrupt out endpoint is not used select "Not used"
// Endpoint Settings
// Maximum Endpoint Packet Size (in bytes) <0-64>
// Endpoint polling Interval (in ms) <1-255>
// High-speed
// If high-speed is enabled set endpoint settings for it
// Maximum Endpoint Packet Size (in bytes) <0-1024>
// Additional transactions per microframe <0=> None <1=> 1 additional <2=> 2 additional
// Endpoint polling Interval (in ms) <1=> 1 <2=> 2 <3=> 4 <4=> 8
// <5=> 16 <6=> 32 <7=> 64 <8=> 128
// <9=> 256 <10=> 512 <11=> 1024 <12=> 2048
// <13=> 4096 <14=> 8192 <15=> 16384 <16=> 32768
//
//
//
// Human Interface Device Settings
// Device specific settings
// HID Interface String
// Number of Input Reports <1-32>
// Number of Output Reports <1-32>
// Maximum Input Report Size (in bytes) <1-65535>
// Maximum Output Report Size (in bytes) <1-65535>
// Maximum Feature Report Size (in bytes) <1-65535>
//
//
#define USBD_HID_ENABLE 1
#define USBD_HID_EP_INTIN 1
#define USBD_HID_EP_INTOUT 1
#define USBD_HID_WMAXPACKETSIZE 64
#define USBD_HID_BINTERVAL 1
#define USBD_HID_HS_ENABLE 0
#define USBD_HID_HS_WMAXPACKETSIZE 4
#define USBD_HID_HS_BINTERVAL 6
#define USBD_HID_STRDESC L"CMSIS-DAP"
#define USBD_HID_INREPORT_NUM 1
#define USBD_HID_OUTREPORT_NUM 1
#define USBD_HID_INREPORT_MAX_SZ 64
#define USBD_HID_OUTREPORT_MAX_SZ 64
#define USBD_HID_FEATREPORT_MAX_SZ 1
// Mass Storage Device (MSC)
// Enable class support for Mass Storage Device (MSC)
// Bulk Endpoint Settings
// Bulk In Endpoint Number <1=> 1 <2=> 2 <3=> 3
// <4=> 4 <5=> 5 <6=> 6 <7=> 7
// <8=> 8 <9=> 9 <10=> 10 <11=> 11
// <12=> 12 <13=> 13 <14=> 14 <15=> 15
// Bulk Out Endpoint Number <1=> 1 <2=> 2 <3=> 3
// <4=> 4 <5=> 5 <6=> 6 <7=> 7
// <8=> 8 <9=> 9 <10=> 10 <11=> 11
// <12=> 12 <13=> 13 <14=> 14 <15=> 15
// Endpoint Settings
// Maximum Packet Size <1-1024>
// High-speed
// If high-speed is enabled set endpoint settings for it
// Maximum Packet Size <1-1024>
// Maximum NAK Rate <0-255>
//
//
//
// Mass Storage Device Settings
// Device specific settings
// MSC Interface String
// Inquiry Data
// Vendor Identification
// Product Identification
// Product Revision Level
//
//
//
#define USBD_MSC_ENABLE 0
#define USBD_MSC_EP_BULKIN 2
#define USBD_MSC_EP_BULKOUT 2
#define USBD_MSC_WMAXPACKETSIZE 64
#define USBD_MSC_HS_ENABLE 0
#define USBD_MSC_HS_WMAXPACKETSIZE 512
#define USBD_MSC_HS_BINTERVAL 0
#define USBD_MSC_STRDESC L"USB_MSC"
#define USBD_MSC_INQUIRY_DATA "Keil " \
"LPC23xx Disk " \
"1.0 "
// Audio Device (ADC)
// Enable class support for Audio Device (ADC)
// Isochronous Endpoint Settings
// Isochronous Out Endpoint Number <1=> 1 <2=> 2 <3=> 3
// <4=> 4 <5=> 5 <6=> 6 <7=> 7
// <8=> 8 <9=> 9 <10=> 10 <11=> 11
// <12=> 12 <13=> 13 <14=> 14 <15=> 15
// Endpoint Settings
// Maximum Endpoint Packet Size (in bytes) <0-1024>
// Endpoint polling Interval (in ms) <1=> 1 <2=> 2 <3=> 4 <4=> 8
// <5=> 16 <6=> 32 <7=> 64 <8=> 128
// <9=> 256 <10=> 512 <11=> 1024 <12=> 2048
// <13=> 4096 <14=> 8192 <15=> 16384 <16=> 32768
// High-speed
// If high-speed is enabled set endpoint settings for it
// Maximum Endpoint Packet Size (in bytes) <0-1024>
// Additional transactions per microframe <0=> None <1=> 1 additional <2=> 2 additional
//
//
//
// Audio Device Settings
// Device specific settings
// Audio Control Interface String
// Audio Streaming (Zero Bandwidth) Interface String
// Audio Streaming (Operational) Interface String
// Audio Subframe Size (in bytes) <0-255>
// Sample Resolution (in bits) <0-255>
// Sample Frequency (in Hz) <0-16777215>
// Packet Size (in bytes) <1-256>
// Packet Count <1-16>
//
//
#define USBD_ADC_ENABLE 0
#define USBD_ADC_EP_ISOOUT 3
#define USBD_ADC_WMAXPACKETSIZE 64
#define USBD_ADC_BINTERVAL 1
#define USBD_ADC_HS_ENABLE 0
#define USBD_ADC_HS_WMAXPACKETSIZE 64
#define USBD_ADC_CIF_STRDESC L"USB_ADC"
#define USBD_ADC_SIF1_STRDESC L"USB_ADC1"
#define USBD_ADC_SIF2_STRDESC L"USB_ADC2"
#define USBD_ADC_BSUBFRAMESIZE 2
#define USBD_ADC_BBITRESOLUTION 16
#define USBD_ADC_TSAMFREQ 32000
#define USBD_ADC_CFG_P_S 32
#define USBD_ADC_CFG_P_C 1
// Communication Device (CDC) - Abstract Control Model (ACM)
// Enable class support for Communication Device (CDC) - Abstract Control Model (ACM)
// Interrupt Endpoint Settings
// Interrupt In Endpoint Number <1=> 1 <2=> 2 <3=> 3
// <4=> 4 <5=> 5 <6=> 6 <7=> 7
// <8=> 8 <9=> 9 <10=> 10 <11=> 11
// <12=> 12 <13=> 13 <14=> 14 <15=> 15
// Endpoint Settings
// Maximum Endpoint Packet Size (in bytes) <0-1024>
// Endpoint polling Interval (in ms) <0-255>
// High-speed
// If high-speed is enabled set endpoint settings for it
// Maximum Endpoint Packet Size (in bytes) <0-1024>
// Additional transactions per microframe <0=> None <1=> 1 additional <2=> 2 additional
// Endpoint polling Interval (in ms) <1=> 1 <2=> 2 <3=> 4 <4=> 8
// <5=> 16 <6=> 32 <7=> 64 <8=> 128
// <9=> 256 <10=> 512 <11=> 1024 <12=> 2048
// <13=> 4096 <14=> 8192 <15=> 16384 <16=> 32768
//
//
//
// Bulk Endpoint Settings
// Bulk In Endpoint Number <1=> 1 <2=> 2 <3=> 3
// <4=> 4 <5=> 5 <6=> 6 <7=> 7
// <8=> 8 <9=> 9 <10=> 10 <11=> 11
// <12=> 12 <13=> 13 <14=> 14 <15=> 15
// Bulk Out Endpoint Number <1=> 1 <2=> 2 <3=> 3
// <4=> 4 <5=> 5 <6=> 6 <7=> 7
// <8=> 8 <9=> 9 <10=> 10 <11=> 11
// <12=> 12 <13=> 13 <14=> 14 <15=> 15
// Endpoint Settings
// Maximum Packet Size <1-1024>
// High-speed
// If high-speed is enabled set endpoint settings for it
// Maximum Packet Size <1-1024>
// Maximum NAK Rate <0-255>
//
//
//
// Communication Device Settings
// Device specific settings
// Communication Class Interface String
// Data Class Interface String
// Maximum Communication Device Send Buffer Size
// <8=> 8 Bytes <16=> 16 Bytes <32=> 32 Bytes <64=> 64 Bytes <128=> 128 Bytes
// <256=> 256 Bytes <512=> 512 Bytes <1024=> 1024 Bytes
// Maximum Communication Device Receive Buffer Size
// Minimum size must be as big as maximum packet size for Bulk Out Endpoint
// <8=> 8 Bytes <16=> 16 Bytes <32=> 32 Bytes <64=> 64 Bytes <128=> 128 Bytes
// <256=> 256 Bytes <512=> 512 Bytes <1024=> 1024 Bytes
//
//
#define USBD_CDC_ACM_ENABLE 1
#define USBD_CDC_ACM_EP_INTIN 2
#define USBD_CDC_ACM_WMAXPACKETSIZE 64
#define USBD_CDC_ACM_BINTERVAL 2
#define USBD_CDC_ACM_HS_ENABLE 0
#define USBD_CDC_ACM_HS_WMAXPACKETSIZE 16
#define USBD_CDC_ACM_HS_BINTERVAL 2
#define USBD_CDC_ACM_EP_BULKIN 3
#define USBD_CDC_ACM_EP_BULKOUT 3
#define USBD_CDC_ACM_WMAXPACKETSIZE1 64
#define USBD_CDC_ACM_HS_ENABLE1 0
#define USBD_CDC_ACM_HS_WMAXPACKETSIZE1 64
#define USBD_CDC_ACM_HS_BINTERVAL1 0
#define USBD_CDC_ACM_CIF_STRDESC L"CMSIS-DAP CDC"
#define USBD_CDC_ACM_DIF_STRDESC L"CMSIS-DAP DCI"
#define USBD_CDC_ACM_SENDBUF_SIZE 64
#define USBD_CDC_ACM_RECEIVEBUF_SIZE 64
#if (((USBD_CDC_ACM_HS_ENABLE1) && (USBD_CDC_ACM_SENDBUF_SIZE < USBD_CDC_ACM_HS_WMAXPACKETSIZE1)) || (USBD_CDC_ACM_SENDBUF_SIZE < USBD_CDC_ACM_WMAXPACKETSIZE1))
#error "Send Buffer size must be larger or equal to Bulk In maximum packet size!"
#endif
#if (((USBD_CDC_ACM_HS_ENABLE1) && (USBD_CDC_ACM_RECEIVEBUF_SIZE < USBD_CDC_ACM_HS_WMAXPACKETSIZE1)) || (USBD_CDC_ACM_RECEIVEBUF_SIZE < USBD_CDC_ACM_WMAXPACKETSIZE1))
#error "Receive Buffer size must be larger or equal to Bulk Out maximum packet size!"
#endif
// Custom Class Device
// Enables USB Custom Class Requests
// Class IDs:
// 0x00 - Class Reserved ID
// 0x01 - Class Audio ID
// 0x02 - Class Communications ID
// 0x03 - Class Human Interface ID
// 0x04 - Class Monitor ID
// 0x05 - Class Physical Interface ID
// 0x06 - Class Power ID
// 0x07 - Class Printer ID
// 0x08 - Class Storage ID
// 0x09 - Class HUB ID
// 0xEF - Class Miscellaneous ID
// 0xFF - Class Vendor Specific ID
//
#define USBD_CLS_ENABLE 0
//
//
/* USB Device Calculations ---------------------------------------------------*/
#define USBD_IF_NUM (USBD_HID_ENABLE+USBD_MSC_ENABLE+(USBD_ADC_ENABLE*2)+(USBD_CDC_ACM_ENABLE*2)+USBD_CLS_ENABLE)
#define USBD_MULTI_IF (USBD_CDC_ACM_ENABLE*(USBD_HID_ENABLE|USBD_MSC_ENABLE|USBD_ADC_ENABLE))
#define MAX(x, y) (((x) < (y)) ? (y) : (x))
#define USBD_EP_NUM_CALC0 MAX((USBD_HID_ENABLE *(USBD_HID_EP_INTIN )), (USBD_HID_ENABLE *(USBD_HID_EP_INTOUT!=0)*(USBD_HID_EP_INTOUT)))
#define USBD_EP_NUM_CALC1 MAX((USBD_MSC_ENABLE *(USBD_MSC_EP_BULKIN )), (USBD_MSC_ENABLE *(USBD_MSC_EP_BULKOUT)))
#define USBD_EP_NUM_CALC2 MAX((USBD_ADC_ENABLE *(USBD_ADC_EP_ISOOUT )), (USBD_CDC_ACM_ENABLE*(USBD_CDC_ACM_EP_INTIN)))
#define USBD_EP_NUM_CALC3 MAX((USBD_CDC_ACM_ENABLE*(USBD_CDC_ACM_EP_BULKIN)), (USBD_CDC_ACM_ENABLE*(USBD_CDC_ACM_EP_BULKOUT)))
#define USBD_EP_NUM_CALC4 MAX(USBD_EP_NUM_CALC0, USBD_EP_NUM_CALC1)
#define USBD_EP_NUM_CALC5 MAX(USBD_EP_NUM_CALC2, USBD_EP_NUM_CALC3)
#define USBD_EP_NUM_CALC6 MAX(USBD_EP_NUM_CALC4, USBD_EP_NUM_CALC5)
#define USBD_EP_NUM (USBD_EP_NUM_CALC6)
#if (USBD_HID_ENABLE)
#if (USBD_MSC_ENABLE)
#if ((((USBD_HID_EP_INTIN == USBD_MSC_EP_BULKIN) || \
(USBD_HID_EP_INTIN == USBD_MSC_EP_BULKIN))) || \
((USBD_HID_EP_INTOUT != 0) && \
(USBD_HID_EP_INTOUT == USBD_MSC_EP_BULKIN) || \
(USBD_HID_EP_INTOUT == USBD_MSC_EP_BULKOUT)))
#error "HID and Mass Storage Device Interface can not use same Endpoints!"
#endif
#endif
#if (USBD_ADC_ENABLE)
#if ((USBD_HID_EP_INTIN == USBD_ADC_EP_ISOOUT) || \
((USBD_HID_EP_INTOUT != 0) && \
(USBD_HID_EP_INTOUT == USBD_ADC_EP_ISOOUT)))
#error "HID and Audio Device Interface can not use same Endpoints!"
#endif
#endif
#if (USBD_CDC_ACM_ENABLE)
#if (((USBD_HID_EP_INTIN == USBD_CDC_ACM_EP_INTIN) || \
(USBD_HID_EP_INTIN == USBD_CDC_ACM_EP_BULKIN) || \
(USBD_HID_EP_INTIN == USBD_CDC_ACM_EP_BULKOUT)) || \
((USBD_HID_EP_INTOUT != 0) && \
((USBD_HID_EP_INTOUT == USBD_CDC_ACM_EP_INTIN) || \
(USBD_HID_EP_INTOUT == USBD_CDC_ACM_EP_BULKIN) || \
(USBD_HID_EP_INTOUT == USBD_CDC_ACM_EP_BULKOUT))))
#error "HID and Communication Device Interface can not use same Endpoints!"
#endif
#endif
#endif
#if (USBD_MSC_ENABLE)
#if (USBD_ADC_ENABLE)
#if ((USBD_MSC_EP_BULKIN == USBD_ADC_EP_ISOOUT) || \
(USBD_MSC_EP_BULKOUT == USBD_ADC_EP_ISOOUT))
#error "Mass Storage Device and Audio Device Interface can not use same Endpoints!"
#endif
#endif
#if (USBD_CDC_ACM_ENABLE)
#if ((USBD_MSC_EP_BULKIN == USBD_CDC_ACM_EP_INTIN) || \
(USBD_MSC_EP_BULKIN == USBD_CDC_ACM_EP_BULKIN) || \
(USBD_MSC_EP_BULKIN == USBD_CDC_ACM_EP_BULKOUT) || \
(USBD_MSC_EP_BULKOUT == USBD_CDC_ACM_EP_INTIN) || \
(USBD_MSC_EP_BULKOUT == USBD_CDC_ACM_EP_BULKIN) || \
(USBD_MSC_EP_BULKOUT == USBD_CDC_ACM_EP_BULKOUT))
#error "Mass Storage Device and Communication Device Interface can not use same Endpoints!"
#endif
#endif
#endif
#if (USBD_ADC_ENABLE)
#if (USBD_CDC_ACM_ENABLE)
#if ((USBD_ADC_EP_ISOOUT == USBD_CDC_ACM_EP_INTIN) || \
(USBD_ADC_EP_ISOOUT == USBD_CDC_ACM_EP_BULKIN) || \
(USBD_ADC_EP_ISOOUT == USBD_CDC_ACM_EP_BULKOUT))
#error "Audio Device and Communication Device Interface can not use same Endpoints!"
#endif
#endif
#endif
#define USBD_ADC_CIF_NUM (0)
#define USBD_ADC_SIF1_NUM (1)
#define USBD_ADC_SIF2_NUM (2)
#define USBD_CDC_ACM_CIF_NUM (USBD_ADC_ENABLE * 2 + 0)
#define USBD_CDC_ACM_DIF_NUM (USBD_ADC_ENABLE * 2 + 1)
#define USBD_HID_IF_NUM (USBD_ADC_ENABLE * 2 + USBD_CDC_ACM_ENABLE * 2)
#define USBD_MSC_IF_NUM (USBD_ADC_ENABLE * 2 + USBD_CDC_ACM_ENABLE * 2 + USBD_HID_ENABLE)
#define USBD_ADC_CIF_STR_NUM (3 + USBD_STRDESC_SER_ENABLE + 0)
#define USBD_ADC_SIF1_STR_NUM (3 + USBD_STRDESC_SER_ENABLE + 1)
#define USBD_ADC_SIF2_STR_NUM (3 + USBD_STRDESC_SER_ENABLE + 2)
#define USBD_CDC_ACM_CIF_STR_NUM (3 + USBD_STRDESC_SER_ENABLE + USBD_ADC_ENABLE * 3 + 0)
#define USBD_CDC_ACM_DIF_STR_NUM (3 + USBD_STRDESC_SER_ENABLE + USBD_ADC_ENABLE * 3 + 1)
#define USBD_HID_IF_STR_NUM (3 + USBD_STRDESC_SER_ENABLE + USBD_ADC_ENABLE * 3 + USBD_CDC_ACM_ENABLE * 2)
#define USBD_MSC_IF_STR_NUM (3 + USBD_STRDESC_SER_ENABLE + USBD_ADC_ENABLE * 3 + USBD_CDC_ACM_ENABLE * 2 + USBD_HID_ENABLE)
#if (USBD_HID_ENABLE)
#if (USBD_HID_HS_ENABLE)
#define USBD_HID_MAX_PACKET ((USBD_HID_HS_WMAXPACKETSIZE > USBD_HID_WMAXPACKETSIZE) ? USBD_HID_HS_WMAXPACKETSIZE : USBD_HID_WMAXPACKETSIZE)
#else
#define USBD_HID_MAX_PACKET (USBD_HID_WMAXPACKETSIZE)
#endif
#else
#define USBD_HID_MAX_PACKET (0)
#endif
#if (USBD_MSC_ENABLE)
#if (USBD_MSC_HS_ENABLE)
#define USBD_MSC_MAX_PACKET ((USBD_MSC_HS_WMAXPACKETSIZE > USBD_MSC_WMAXPACKETSIZE) ? USBD_MSC_HS_WMAXPACKETSIZE : USBD_MSC_WMAXPACKETSIZE)
#else
#define USBD_MSC_MAX_PACKET (USBD_MSC_WMAXPACKETSIZE)
#endif
#else
#define USBD_MSC_MAX_PACKET (0)
#endif
#if (USBD_ADC_ENABLE)
#if (USBD_ADC_HS_ENABLE)
#define USBD_ADC_MAX_PACKET ((USBD_ADC_HS_WMAXPACKETSIZE > USBD_ADC_WMAXPACKETSIZE) ? USBD_ADC_HS_WMAXPACKETSIZE : USBD_ADC_WMAXPACKETSIZE)
#else
#define USBD_ADC_MAX_PACKET (USBD_ADC_WMAXPACKETSIZE)
#endif
#else
#define USBD_ADC_MAX_PACKET (0)
#endif
#if (USBD_CDC_ACM_ENABLE)
#if (USBD_CDC_ACM_HS_ENABLE)
#define USBD_CDC_ACM_MAX_PACKET ((USBD_CDC_ACM_HS_WMAXPACKETSIZE > USBD_CDC_ACM_WMAXPACKETSIZE) ? USBD_CDC_ACM_HS_WMAXPACKETSIZE : USBD_CDC_ACM_WMAXPACKETSIZE)
#else
#define USBD_CDC_ACM_MAX_PACKET (USBD_CDC_ACM_WMAXPACKETSIZE)
#endif
#if (USBD_CDC_ACM_HS_ENABLE1)
#define USBD_CDC_ACM_MAX_PACKET1 ((USBD_CDC_ACM_HS_WMAXPACKETSIZE1 > USBD_CDC_ACM_WMAXPACKETSIZE1) ? USBD_CDC_ACM_HS_WMAXPACKETSIZE1 : USBD_CDC_ACM_WMAXPACKETSIZE1)
#else
#define USBD_CDC_ACM_MAX_PACKET1 (USBD_CDC_ACM_WMAXPACKETSIZE1)
#endif
#else
#define USBD_CDC_ACM_MAX_PACKET (0)
#define USBD_CDC_ACM_MAX_PACKET1 (0)
#endif
#define USBD_MAX_PACKET_CALC0 ((USBD_HID_MAX_PACKET > USBD_HID_MAX_PACKET ) ? (USBD_HID_MAX_PACKET ) : (USBD_HID_MAX_PACKET ))
#define USBD_MAX_PACKET_CALC1 ((USBD_ADC_MAX_PACKET > USBD_CDC_ACM_MAX_PACKET ) ? (USBD_ADC_MAX_PACKET ) : (USBD_CDC_ACM_MAX_PACKET ))
#define USBD_MAX_PACKET_CALC2 ((USBD_MAX_PACKET_CALC0 > USBD_MAX_PACKET_CALC1 ) ? (USBD_MAX_PACKET_CALC0) : (USBD_MAX_PACKET_CALC1 ))
#define USBD_MAX_PACKET ((USBD_MAX_PACKET_CALC2 > USBD_CDC_ACM_MAX_PACKET1 ) ? (USBD_MAX_PACKET_CALC2) : (USBD_CDC_ACM_MAX_PACKET1 ))
/*------------------------------------------------------------------------------
* USB Config Functions
*----------------------------------------------------------------------------*/
#ifndef __USB_CONFIG___
#define __USB_CONFIG__
#ifndef __NO_USB_LIB_C
#include
#endif
#endif /* __USB_CONFIG__ */