Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AndroidAccessoryClassCommon.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2014.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  9. Permission to use, copy, modify, distribute, and sell this
  10. software and its documentation for any purpose is hereby granted
  11. without fee, provided that the above copyright notice appear in
  12. all copies and that both that the copyright notice and this
  13. permission notice and warranty disclaimer appear in supporting
  14. documentation, and that the name of the author not be used in
  15. advertising or publicity pertaining to distribution of the
  16. software without specific, written prior permission.
  17. The author disclaims all warranties with regard to this
  18. software, including all implied warranties of merchantability
  19. and fitness. In no event shall the author be liable for any
  20. special, indirect or consequential damages or any damages
  21. whatsoever resulting from loss of use, data or profits, whether
  22. in an action of contract, negligence or other tortious action,
  23. arising out of or in connection with the use or performance of
  24. this software.
  25. */
  26. /** \file
  27. * \brief Common definitions and declarations for the library USB Android Open Accessory Class driver.
  28. *
  29. * Common definitions and declarations for the library USB Android Open Accessory Class driver.
  30. *
  31. * \note This file should not be included directly. It is automatically included as needed by the USB module driver
  32. * dispatch header located in LUFA/Drivers/USB.h.
  33. */
  34. /** \ingroup Group_USBClassAOA
  35. * \defgroup Group_USBClassAOACommon Common Class Definitions
  36. *
  37. * \section Sec_USBClassAOACommon_ModDescription Module Description
  38. * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB
  39. * Android Open Accessory Class.
  40. *
  41. * @{
  42. */
  43. #ifndef _AOA_CLASS_COMMON_H_
  44. #define _AOA_CLASS_COMMON_H_
  45. /* Includes: */
  46. #include "../../Core/StdDescriptors.h"
  47. /* Enable C linkage for C++ Compilers: */
  48. #if defined(__cplusplus)
  49. extern "C" {
  50. #endif
  51. /* Preprocessor Checks: */
  52. #if !defined(__INCLUDE_FROM_AOA_DRIVER)
  53. #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
  54. #endif
  55. /* Macros: */
  56. /** Product ID value in a Device Descriptor to indicate an Android device in Open Accessory mode. */
  57. #define ANDROID_ACCESSORY_PRODUCT_ID 0x2D00
  58. /** Product ID value in a Device Descriptor to indicate an Android device in Open Accessory and Android Debug mode. */
  59. #define ANDROID_ACCESSORY_ADB_PRODUCT_ID 0x2D01
  60. /* Enums: */
  61. /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the
  62. * Android Open Accessory class.
  63. */
  64. enum AOA_Descriptor_ClassSubclassProtocol_t
  65. {
  66. AOA_CSCP_AOADataClass = 0xFF, /**< Descriptor Class value indicating that the device or interface
  67. * belongs to the AOA data class.
  68. */
  69. AOA_CSCP_AOADataSubclass = 0xFF, /**< Descriptor Subclass value indicating that the device or interface
  70. * belongs to AOA data subclass.
  71. */
  72. AOA_CSCP_AOADataProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or interface
  73. * belongs to the AOA data class protocol.
  74. */
  75. };
  76. /** Enum for the Android Open Accessory class specific control requests that can be issued by the USB bus host. */
  77. enum AOA_ClassRequests_t
  78. {
  79. AOA_REQ_GetAccessoryProtocol = 0x33, /**< Android Open Accessory control request to retrieve the device's supported Accessory Protocol version. */
  80. AOA_REQ_SendString = 0x34, /**< Android Open Accessory control request to set an accessory property string in the device. */
  81. AOA_REQ_StartAccessoryMode = 0x35, /**< Android Open Accessory control request to switch the device into Accessory mode. */
  82. };
  83. /** Enum for the possible Android Open Accessory property string indexes. */
  84. enum AOA_Strings_t
  85. {
  86. AOA_STRING_Manufacturer = 0, /**< Index of the Manufacturer property string. */
  87. AOA_STRING_Model = 1, /**< Index of the Model Name property string. */
  88. AOA_STRING_Description = 2, /**< Index of the Description property string. */
  89. AOA_STRING_Version = 3, /**< Index of the Version Number property string. */
  90. AOA_STRING_URI = 4, /**< Index of the URI Information property string. */
  91. AOA_STRING_Serial = 5, /**< Index of the Serial Number property string. */
  92. #if !defined(__DOXYGEN__)
  93. AOA_STRING_TOTAL_STRINGS
  94. #endif
  95. };
  96. /** Enum for the possible Android Open Accessory protocol versions. */
  97. enum AOA_Protocols_t
  98. {
  99. AOA_PROTOCOL_AccessoryV1 = 0x0001, /**< Android Open Accessory version 1. */
  100. AOA_PROTOCOL_AccessoryV2 = 0x0002, /**< Android Open Accessory version 2. */
  101. };
  102. /* Disable C linkage for C++ Compilers: */
  103. #if defined(__cplusplus)
  104. }
  105. #endif
  106. #endif
  107. /** @} */