3 Copyright (C) Dean Camera, 2012.
5 dean [at] fourwalledcubicle [dot] com
10 Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11 Copyright 2012 Simon Foster (simon.foster [at] inbox [dot] com)
13 Permission to use, copy, modify, distribute, and sell this
14 software and its documentation for any purpose is hereby granted
15 without fee, provided that the above copyright notice appear in
16 all copies and that both that the copyright notice and this
17 permission notice and warranty disclaimer appear in supporting
18 documentation, and that the name of the author not be used in
19 advertising or publicity pertaining to distribution of the
20 software without specific, written prior permission.
22 The author disclaims all warranties with regard to this
23 software, including all implied warranties of merchantability
24 and fitness. In no event shall the author be liable for any
25 special, indirect or consequential damages or any damages
26 whatsoever resulting from loss of use, data or profits, whether
27 in an action of contract, negligence or other tortious action,
28 arising out of or in connection with the use or performance of
34 * Header file for Descriptors.c.
37 #ifndef _DESCRIPTORS_H_
38 #define _DESCRIPTORS_H_
41 #include <avr/pgmspace.h>
43 #include <LUFA/Drivers/USB/USB.h>
46 /** Endpoint address of the CDC device-to-host notification IN endpoint. */
47 #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
49 /** Endpoint address of the CDC device-to-host data IN endpoint. */
50 #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3)
52 /** Endpoint address of the CDC host-to-device data OUT endpoint. */
53 #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4)
55 /** Size in bytes of the CDC device-to-host notification IN endpoint. */
56 #define CDC_NOTIFICATION_EPSIZE 8
58 /** Size in bytes of the CDC data IN and OUT endpoints. */
59 #define CDC_TXRX_EPSIZE 16
62 /** Type define for the device configuration descriptor structure. This must be defined in the
63 * application code, as the configuration descriptor contains several sub-descriptors which
64 * vary between devices, and which describe the device's usage to the host.
68 USB_Descriptor_Configuration_Header_t Config
;
70 // CDC Command Interface
71 USB_Descriptor_Interface_t CDC_CCI_Interface
;
72 USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header
;
73 USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM
;
74 USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union
;
75 USB_Descriptor_Endpoint_t CDC_NotificationEndpoint
;
78 USB_Descriptor_Interface_t CDC_DCI_Interface
;
79 USB_Descriptor_Endpoint_t CDC_DataOutEndpoint
;
80 USB_Descriptor_Endpoint_t CDC_DataInEndpoint
;
81 } USB_Descriptor_Configuration_t
;
83 /* Function Prototypes: */
84 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue
,
86 const void** const DescriptorAddress
)
87 ATTR_WARN_UNUSED_RESULT
ATTR_NON_NULL_PTR_ARG(3);