-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDescriptors.h
More file actions
59 lines (48 loc) · 1.93 KB
/
Descriptors.h
File metadata and controls
59 lines (48 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Descriptors.h
*
* Created: 5/4/2014 1:04:39 AM
* Author: geek
*/
#ifndef DESCRIPTORS_H_
#define DESCRIPTORS_H_
#include <LUFA-src/Drivers/USB/USB.h>
#include <avr/pgmspace.h>
/** Enum for the device string descriptor IDs within the device. Each string descriptor should
* have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors.
*/
enum StringDescriptors_t
{
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */
};
/** Endpoint address of the Bulk Vendor device-to-host data IN endpoint. */
#define VENDOR_IN_EPADDR (ENDPOINT_DIR_IN | 1)
/** Endpoint address of the Bulk Vendor host-to-device data OUT endpoint. */
#define VENDOR_OUT_EPADDR (ENDPOINT_DIR_OUT | 2)
/** Size in bytes of the Bulk Vendor data endpoints. */
#define VENDOR_IO_EPSIZE 32
typedef struct
{
USB_Descriptor_Configuration_Header_t Config;
// Vendor Interface
USB_Descriptor_Interface_t Vendor_Interface;
USB_Descriptor_Endpoint_t Vendor_DataInEndpoint;
USB_Descriptor_Endpoint_t Vendor_DataOutEndpoint;
} USB_Descriptor_Configuration_t;
/** Enum for the device interface descriptor IDs within the device. Each interface descriptor
* should have a unique ID index associated with it, which can be used to refer to the
* interface from other descriptors.
*/
enum InterfaceDescriptors_t
{
INTERFACE_ID_Vendor = 0, /**< Vendor interface descriptor ID */
};
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
#endif /* DESCRIPTORS_H_ */