Debian Codegraph @

cores/arduino/USBDesc.h

raw
1 /*
2 Copyright (c) 2011, Peter Barrett
3 Copyright (c) 2015, Arduino LLC
4
5 Permission to use, copy, modify, and/or distribute this software for
6 any purpose with or without fee is hereby granted, provided that the
7 above copyright notice and this permission notice appear in all copies.
8
9 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
12 BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
13 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
14 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
15 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
16 SOFTWARE.
17 */
18
19 #define PLUGGABLE_USB_ENABLED
20
21 #if defined(EPRST6)
22 #define USB_ENDPOINTS 7 // AtMegaxxU4
23 #else
24 #define USB_ENDPOINTS 5 // AtMegaxxU2
25 #endif
26
27 #define ISERIAL_MAX_LEN 20
28
29 // Uncomment the following line or pass -DCDC_DISABLED to the compiler
30 // to disable CDC (serial console via USB).
31 // That's useful if you want to create an USB device (like an USB Boot Keyboard)
32 // that works even with problematic devices (like KVM switches).
33 // Keep in mind that with this change you'll have to use the Arduino's
34 // reset button to be able to flash it.
35 //#define CDC_DISABLED
36
37 #ifndef CDC_DISABLED
38 #define CDC_ENABLED
39 #endif
40
41 #ifdef CDC_ENABLED
42 #define CDC_INTERFACE_COUNT 2
43 #define CDC_ENPOINT_COUNT 3
44 #else // CDC_DISABLED
45 #define CDC_INTERFACE_COUNT 0
46 #define CDC_ENPOINT_COUNT 0
47 #endif
48
49 #define CDC_ACM_INTERFACE 0 // CDC ACM
50 #define CDC_DATA_INTERFACE 1 // CDC Data
51 #define CDC_FIRST_ENDPOINT 1
52 #define CDC_ENDPOINT_ACM (CDC_FIRST_ENDPOINT) // CDC First
53 #define CDC_ENDPOINT_OUT (CDC_FIRST_ENDPOINT+1)
54 #define CDC_ENDPOINT_IN (CDC_FIRST_ENDPOINT+2)
55
56 #define INTERFACE_COUNT (MSC_INTERFACE + MSC_INTERFACE_COUNT)
57
58 #define CDC_RX CDC_ENDPOINT_OUT
59 #define CDC_TX CDC_ENDPOINT_IN
60
61 #define IMANUFACTURER 1
62 #define IPRODUCT 2
63 #define ISERIAL 3