Standardized the naming scheme given to configuration descriptor sub-elements in...
[pub/lufa.git] / Projects / TemperatureDataLogger / Descriptors.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2010.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
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 #include <LUFA/Drivers/USB/Class/MassStorage.h>
17 #include <LUFA/Drivers/USB/Class/HID.h>
18
19 #include "TempDataLogger.h"
20
21 /* Macros: */
22 /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */
23 #define MASS_STORAGE_IN_EPNUM 3
24
25 /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */
26 #define MASS_STORAGE_OUT_EPNUM 4
27
28 /** Size in bytes of the Mass Storage data endpoints. */
29 #define MASS_STORAGE_IO_EPSIZE 64
30
31 /** Endpoint number of the Generic HID reporting IN endpoint. */
32 #define GENERIC_IN_EPNUM 1
33
34 /** Size in bytes of the Generic HID reporting endpoint. */
35 #define GENERIC_EPSIZE 16
36
37 /** Size in bytes of the Generic HID reports (including report ID byte). */
38 #define GENERIC_REPORT_SIZE sizeof(Device_Report_t)
39
40 /* Type Defines: */
41 /** Type define for the device configuration descriptor structure. This must be defined in the
42 * application code, as the configuration descriptor contains several sub-descriptors which
43 * vary between devices, and which describe the device's usage to the host.
44 */
45 typedef struct
46 {
47 USB_Descriptor_Configuration_Header_t Config;
48 USB_Descriptor_Interface_t MS_Interface;
49 USB_Descriptor_Endpoint_t MS_DataInEndpoint;
50 USB_Descriptor_Endpoint_t MS_DataOutEndpoint;
51 USB_Descriptor_Interface_t HID_Interface;
52 USB_HID_Descriptor_t HID_GenericHID;
53 USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
54 } USB_Descriptor_Configuration_t;
55
56 /* Function Prototypes: */
57 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
58 ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
59
60 #endif