Add new tag for the LUFA-120219-BETA release.
[pub/USBasp.git] / Demos / Device / Incomplete / Sideshow / Descriptors.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2012.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 #ifndef _DESCRIPTORS_H_
32 #define _DESCRIPTORS_H_
33
34 /* Includes: */
35 #include <LUFA/Drivers/USB/USB.h>
36
37 #include <avr/pgmspace.h>
38
39 #include "Sideshow.h"
40
41 /* Macros: */
42 #define SIDESHOW_IN_EPNUM 3
43 #define SIDESHOW_OUT_EPNUM 4
44 #define SIDESHOW_IO_EPSIZE 64
45
46 /* Type Defines: */
47 typedef struct
48 {
49 USB_Descriptor_Configuration_Header_t Config;
50
51 // SideShow Interface
52 USB_Descriptor_Interface_t SSHOW_Interface;
53 USB_Descriptor_Endpoint_t SSHOW_DataInEndpoint;
54 USB_Descriptor_Endpoint_t SSHOW_DataOutEndpoint;
55 } USB_Descriptor_Configuration_t;
56
57 typedef struct
58 {
59 USB_Descriptor_Header_t Header;
60
61 int Signature[7];
62 uint16_t VendorCode;
63 } USB_OSDescriptor_t;
64
65 typedef struct
66 {
67 uint8_t FirstInterfaceNumber;
68
69 uint8_t Reserved;
70
71 uint8_t CompatibleID[8];
72 uint8_t SubCompatibleID[8];
73
74 uint8_t Reserved2[6];
75 } USB_OSCompatibleSection_t;
76
77 typedef struct
78 {
79 uint32_t TotalLength;
80 uint16_t Version;
81 uint16_t Index;
82 uint8_t TotalSections;
83
84 uint8_t Reserved[7];
85
86 USB_OSCompatibleSection_t SideshowCompatID;
87 } USB_OSCompatibleIDDescriptor_t;
88
89 /* Function Prototypes: */
90 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
91 const uint8_t wIndex,
92 const void** const DescriptorAddress)
93 ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
94
95 uint16_t USB_GetOSFeatureDescriptor(const uint16_t wValue,
96 const uint8_t wIndex,
97 const void** const DescriptorAddress)
98 ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
99
100 #endif
101