diff options
Diffstat (limited to 'lib/lufa/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h')
| -rw-r--r-- | lib/lufa/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/lib/lufa/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h b/lib/lufa/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h new file mode 100644 index 000000000..628b63a50 --- /dev/null +++ b/lib/lufa/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h | |||
| @@ -0,0 +1,104 @@ | |||
| 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 | /* | ||
| 10 | Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) | ||
| 11 | Copyright 2010 Peter Lawrence (majbthrd [at] gmail [dot] com) | ||
| 12 | |||
| 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. | ||
| 21 | |||
| 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 | ||
| 29 | this software. | ||
| 30 | */ | ||
| 31 | |||
| 32 | /** \file | ||
| 33 | * | ||
| 34 | * Header file for Descriptors.c. | ||
| 35 | */ | ||
| 36 | |||
| 37 | #ifndef _DESCRIPTORS_H_ | ||
| 38 | #define _DESCRIPTORS_H_ | ||
| 39 | |||
| 40 | /* Includes: */ | ||
| 41 | #include <avr/pgmspace.h> | ||
| 42 | |||
| 43 | #include <LUFA/Drivers/USB/USB.h> | ||
| 44 | |||
| 45 | /* Macros: */ | ||
| 46 | /** Endpoint address of the TMC notification IN endpoint. */ | ||
| 47 | #define TMC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) | ||
| 48 | |||
| 49 | /** Endpoint address of the TMC device-to-host data IN endpoint. */ | ||
| 50 | #define TMC_IN_EPADDR (ENDPOINT_DIR_IN | 3) | ||
| 51 | |||
| 52 | /** Endpoint address of the TMC host-to-device data OUT endpoint. */ | ||
| 53 | #define TMC_OUT_EPADDR (ENDPOINT_DIR_OUT | 4) | ||
| 54 | |||
| 55 | /** Size in bytes of the TMC data endpoints. */ | ||
| 56 | #define TMC_IO_EPSIZE 64 | ||
| 57 | |||
| 58 | /** Size in bytes of the TMC notification endpoint. */ | ||
| 59 | #define TMC_NOTIFICATION_EPSIZE 8 | ||
| 60 | |||
| 61 | /* Type Defines: */ | ||
| 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. | ||
| 65 | */ | ||
| 66 | typedef struct | ||
| 67 | { | ||
| 68 | USB_Descriptor_Configuration_Header_t Config; | ||
| 69 | |||
| 70 | // Test and Measurement Interface | ||
| 71 | USB_Descriptor_Interface_t TM_Interface; | ||
| 72 | USB_Descriptor_Endpoint_t TM_DataOutEndpoint; | ||
| 73 | USB_Descriptor_Endpoint_t TM_DataInEndpoint; | ||
| 74 | USB_Descriptor_Endpoint_t TM_NotificationEndpoint; | ||
| 75 | } USB_Descriptor_Configuration_t; | ||
| 76 | |||
| 77 | /** Enum for the device interface descriptor IDs within the device. Each interface descriptor | ||
| 78 | * should have a unique ID index associated with it, which can be used to refer to the | ||
| 79 | * interface from other descriptors. | ||
| 80 | */ | ||
| 81 | enum InterfaceDescriptors_t | ||
| 82 | { | ||
| 83 | INTERFACE_ID_TestAndMeasurement = 0, /**< Test and measurement interface descriptor ID */ | ||
| 84 | }; | ||
| 85 | |||
| 86 | /** Enum for the device string descriptor IDs within the device. Each string descriptor should | ||
| 87 | * have a unique ID index associated with it, which can be used to refer to the string from | ||
| 88 | * other descriptors. | ||
| 89 | */ | ||
| 90 | enum StringDescriptors_t | ||
| 91 | { | ||
| 92 | STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ | ||
| 93 | STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ | ||
| 94 | STRING_ID_Product = 2, /**< Product string ID */ | ||
| 95 | }; | ||
| 96 | |||
| 97 | /* Function Prototypes: */ | ||
| 98 | uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, | ||
| 99 | const uint16_t wIndex, | ||
| 100 | const void** const DescriptorAddress) | ||
| 101 | ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); | ||
| 102 | |||
| 103 | #endif | ||
| 104 | |||
