Descriptors.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2018.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2010 OBinou (obconseil [at] gmail [dot] com)
  9. Copyright 2018 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  10. Permission to use, copy, modify, distribute, and sell this
  11. software and its documentation for any purpose is hereby granted
  12. without fee, provided that the above copyright notice appear in
  13. all copies and that both that the copyright notice and this
  14. permission notice and warranty disclaimer appear in supporting
  15. documentation, and that the name of the author not be used in
  16. advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.
  18. The author disclaims all warranties with regard to this
  19. software, including all implied warranties of merchantability
  20. and fitness. In no event shall the author be liable for any
  21. special, indirect or consequential damages or any damages
  22. whatsoever resulting from loss of use, data or profits, whether
  23. in an action of contract, negligence or other tortious action,
  24. arising out of or in connection with the use or performance of
  25. this software.
  26. */
  27. /** \file
  28. *
  29. * Header file for Descriptors.c.
  30. */
  31. #ifndef _DESCRIPTORS_H_
  32. #define _DESCRIPTORS_H_
  33. /* Includes: */
  34. #include <avr/pgmspace.h>
  35. #include <LUFA/Drivers/USB/USB.h>
  36. /* Type Defines: */
  37. /** Type define for the device configuration descriptor structure. This must be defined in the
  38. * application code, as the configuration descriptor contains several sub-descriptors which
  39. * vary between devices, and which describe the device's usage to the host.
  40. */
  41. typedef struct
  42. {
  43. USB_Descriptor_Configuration_Header_t Config;
  44. // Relay Board Interface
  45. USB_Descriptor_Interface_t RelayBoardInterface;
  46. } USB_Descriptor_Configuration_t;
  47. /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
  48. * should have a unique ID index associated with it, which can be used to refer to the
  49. * interface from other descriptors.
  50. */
  51. enum InterfaceDescriptors_t
  52. {
  53. INTERFACE_ID_RelayBoard = 0, /**< Relay board interface descriptor ID */
  54. };
  55. /** Enum for the device string descriptor IDs within the device. Each string descriptor should
  56. * have a unique ID index associated with it, which can be used to refer to the string from
  57. * other descriptors.
  58. */
  59. enum StringDescriptors_t
  60. {
  61. STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
  62. STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
  63. STRING_ID_Product = 2, /**< Product string ID */
  64. STRING_ID_Serial = 3, /**< Serial number string ID */
  65. };
  66. /* Function Prototypes: */
  67. uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
  68. const uint16_t wIndex,
  69. const void** const DescriptorAddress)
  70. ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
  71. #endif