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