]> git.donarmstrong.com Git - qmk_firmware.git/blob - lib/lufa/Projects/TempDataLogger/Descriptors.h
Merge commit '60b30c036397cb5627fa374bb930794b225daa29' as 'lib/lufa'
[qmk_firmware.git] / lib / lufa / Projects / TempDataLogger / Descriptors.h
1 /*
2              LUFA Library
3      Copyright (C) Dean Camera, 2017.
4
5   dean [at] fourwalledcubicle [dot] com
6            www.lufa-lib.org
7 */
8
9 #ifndef _DESCRIPTORS_H_
10 #define _DESCRIPTORS_H_
11
12         /* Includes: */
13                 #include <avr/pgmspace.h>
14
15                 #include <LUFA/Drivers/USB/USB.h>
16
17                 #include "TempDataLogger.h"
18                 #include "Config/AppConfig.h"
19
20         /* Macros: */
21                 /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */
22                 #define MASS_STORAGE_IN_EPADDR         (ENDPOINT_DIR_IN  | 3)
23
24                 /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */
25                 #define MASS_STORAGE_OUT_EPADDR        (ENDPOINT_DIR_OUT | 4)
26
27                 /** Size in bytes of the Mass Storage data endpoints. */
28                 #define MASS_STORAGE_IO_EPSIZE         64
29
30                 /** Endpoint address of the Generic HID reporting IN endpoint. */
31                 #define GENERIC_IN_EPADDR              (ENDPOINT_DIR_IN  | 1)
32
33                 /** Size in bytes of the Generic HID reporting endpoint. */
34                 #define GENERIC_EPSIZE                 16
35
36                 /** Size in bytes of the Generic HID reports (including report ID byte). */
37                 #define GENERIC_REPORT_SIZE            sizeof(Device_Report_t)
38
39         /* Type Defines: */
40                 /** Type define for the device configuration descriptor structure. This must be defined in the
41                  *  application code, as the configuration descriptor contains several sub-descriptors which
42                  *  vary between devices, and which describe the device's usage to the host.
43                  */
44                 typedef struct
45                 {
46                         USB_Descriptor_Configuration_Header_t Config;
47
48                         // Mass Storage Interface
49                         USB_Descriptor_Interface_t            MS_Interface;
50                         USB_Descriptor_Endpoint_t             MS_DataInEndpoint;
51                         USB_Descriptor_Endpoint_t             MS_DataOutEndpoint;
52
53                         // Settings Management Generic HID Interface
54                         USB_Descriptor_Interface_t            HID_Interface;
55                         USB_HID_Descriptor_HID_t              HID_GenericHID;
56                         USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
57                 } USB_Descriptor_Configuration_t;
58
59                 /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
60                  *  should have a unique ID index associated with it, which can be used to refer to the
61                  *  interface from other descriptors.
62                  */
63                 enum InterfaceDescriptors_t
64                 {
65                         INTERFACE_ID_MassStorage = 0, /**< Mass storage interface descriptor ID */
66                         INTERFACE_ID_HID         = 1, /**< HID interface descriptor ID */
67                 };
68
69                 /** Enum for the device string descriptor IDs within the device. Each string descriptor should
70                  *  have a unique ID index associated with it, which can be used to refer to the string from
71                  *  other descriptors.
72                  */
73                 enum StringDescriptors_t
74                 {
75                         STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
76                         STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
77                         STRING_ID_Product      = 2, /**< Product string ID */
78                 };
79
80         /* Function Prototypes: */
81                 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
82                                                     const uint16_t wIndex,
83                                                     const void** const DescriptorAddress)
84                                                     ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
85
86 #endif
87