sanguino/firmwares/arduino-usbserial/Descriptors.h

Fri, 17 Nov 2017 10:13:31 +0100

author
mdd
date
Fri, 17 Nov 2017 10:13:31 +0100
changeset 3
770b218a4931
parent 2
b373b0288715
permissions
-rw-r--r--

proper configuration, homing and planner optimization

2
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
1 /*
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
2 LUFA Library
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
3 Copyright (C) Dean Camera, 2010.
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
4
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
5 dean [at] fourwalledcubicle [dot] com
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
6 www.fourwalledcubicle.com
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
7 */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
8
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
9 /*
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
10 Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
11
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
12 Permission to use, copy, modify, distribute, and sell this
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
13 software and its documentation for any purpose is hereby granted
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
14 without fee, provided that the above copyright notice appear in
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
15 all copies and that both that the copyright notice and this
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
16 permission notice and warranty disclaimer appear in supporting
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
17 documentation, and that the name of the author not be used in
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
18 advertising or publicity pertaining to distribution of the
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
19 software without specific, written prior permission.
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
20
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
21 The author disclaim all warranties with regard to this
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
22 software, including all implied warranties of merchantability
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
23 and fitness. In no event shall the author be liable for any
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
24 special, indirect or consequential damages or any damages
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
25 whatsoever resulting from loss of use, data or profits, whether
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
26 in an action of contract, negligence or other tortious action,
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
27 arising out of or in connection with the use or performance of
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
28 this software.
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
29 */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
30
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
31 /** \file
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
32 *
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
33 * Header file for Descriptors.c.
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
34 */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
35
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
36 #ifndef _DESCRIPTORS_H_
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
37 #define _DESCRIPTORS_H_
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
38
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
39 /* Includes: */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
40 #include <avr/pgmspace.h>
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
41
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
42 #include <LUFA/Drivers/USB/USB.h>
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
43 #include <LUFA/Drivers/USB/Class/CDC.h>
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
44
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
45 /* Product-specific definitions: */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
46 #define ARDUINO_UNO_PID 0x0001
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
47 #define ARDUINO_MEGA2560_PID 0x0010
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
48
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
49 /* Macros: */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
50 /** Endpoint number of the CDC device-to-host notification IN endpoint. */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
51 #define CDC_NOTIFICATION_EPNUM 2
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
52
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
53 /** Endpoint number of the CDC device-to-host data IN endpoint. */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
54 #define CDC_TX_EPNUM 3
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
55
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
56 /** Endpoint number of the CDC host-to-device data OUT endpoint. */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
57 #define CDC_RX_EPNUM 4
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
58
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
59 /** Size in bytes of the CDC device-to-host notification IN endpoint. */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
60 #define CDC_NOTIFICATION_EPSIZE 8
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
61
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
62 /** Size in bytes of the CDC data IN and OUT endpoints. */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
63 #define CDC_TXRX_EPSIZE 64
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
64
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
65 /* Type Defines: */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
66 /** Type define for the device configuration descriptor structure. This must be defined in the
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
67 * application code, as the configuration descriptor contains several sub-descriptors which
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
68 * vary between devices, and which describe the device's usage to the host.
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
69 */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
70 typedef struct
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
71 {
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
72 USB_Descriptor_Configuration_Header_t Config;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
73 USB_Descriptor_Interface_t CDC_CCI_Interface;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
74 CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
75 CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
76 CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
77 USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
78 USB_Descriptor_Interface_t CDC_DCI_Interface;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
79 USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
80 USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
81 } USB_Descriptor_Configuration_t;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
82
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
83 /* Function Prototypes: */
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
84 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
85 const uint8_t wIndex,
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
86 void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
87
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
88 #endif

mercurial