Add missing doxygen group terminator to the new CompilerSpecific.h header file.
[pub/USBasp.git] / LUFA / Drivers / USB / Core / Host.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2011.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2011 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 disclaim 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 USB Host definitions for all architectures.
33 * \copydetails Group_Host
34 *
35 * \note This file should not be included directly. It is automatically included as needed by the USB driver
36 * dispatch header located in LUFA/Drivers/USB/USB.h.
37 */
38
39 /** \ingroup Group_USB
40 * \defgroup Group_Host Host Management
41 * \brief USB Host management definitions for USB host mode.
42 *
43 * USB Host mode related macros and enums. This module contains macros and enums which are used when
44 * the USB controller is initialized in host mode.
45 *
46 * @{
47 */
48
49 #ifndef __USBHOST_H__
50 #define __USBHOST_H__
51
52 /* Includes: */
53 #include "../../../Common/Common.h"
54 #include "USBMode.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_USB_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
64 #endif
65
66 /* Public Interface - May be used in end-application: */
67 /* Enums: */
68 /** Enum for the various states of the USB Host state machine. Only some states are
69 * implemented in the LUFA library - other states are left to the user to implement.
70 *
71 * For information on each possible USB host state, refer to the USB 2.0 specification.
72 * Several of the USB host states are broken up further into multiple smaller sub-states,
73 * so that they can be internally implemented inside the library in an efficient manner.
74 *
75 * \see \ref USB_HostState, which stores the current host state machine state.
76 */
77 enum USB_Host_States_t
78 {
79 HOST_STATE_WaitForDeviceRemoval = 0, /**< Internally implemented by the library. This state can be
80 * used by the library to wait until the attached device is
81 * removed by the user - useful for when an error occurs or
82 * further communication with the device is not needed. This
83 * allows for other code to run while the state machine is
84 * effectively disabled.
85 */
86 HOST_STATE_WaitForDevice = 1, /**< Internally implemented by the library. This state indicates
87 * that the stack is waiting for an interval to elapse before
88 * continuing with the next step of the device enumeration
89 * process.
90 *
91 * \note Do not manually change to this state in the user code.
92 */
93 HOST_STATE_Unattached = 2, /**< Internally implemented by the library. This state indicates
94 * that the host state machine is waiting for a device to be
95 * attached so that it can start the enumeration process.
96 *
97 * \note Do not manually change to this state in the user code.
98 */
99 HOST_STATE_Powered = 3, /**< Internally implemented by the library. This state indicates
100 * that a device has been attached, and the library's internals
101 * are being configured to begin the enumeration process.
102 *
103 * \note Do not manually change to this state in the user code.
104 */
105 HOST_STATE_Powered_WaitForDeviceSettle = 4, /**< Internally implemented by the library. This state indicates
106 * that the stack is waiting for the initial settling period to
107 * elapse before beginning the enumeration process.
108 *
109 * \note Do not manually change to this state in the user code.
110 */
111 HOST_STATE_Powered_WaitForConnect = 5, /**< Internally implemented by the library. This state indicates
112 * that the stack is waiting for a connection event from the USB
113 * controller to indicate a valid USB device has been attached to
114 * the bus and is ready to be enumerated.
115 *
116 * \note Do not manually change to this state in the user code.
117 */
118 HOST_STATE_Powered_DoReset = 6, /**< Internally implemented by the library. This state indicates
119 * that a valid USB device has been attached, and that it is
120 * will now be reset to ensure it is ready for enumeration.
121 *
122 * \note Do not manually change to this state in the user code.
123 */
124 HOST_STATE_Powered_ConfigPipe = 7, /**< Internally implemented by the library. This state indicates
125 * that the attached device is currently powered and reset, and
126 * that the control pipe is now being configured by the stack.
127 *
128 * \note Do not manually change to this state in the user code.
129 */
130 HOST_STATE_Default = 8, /**< Internally implemented by the library. This state indicates
131 * that the stack is currently retrieving the control endpoint's
132 * size from the device, so that the control pipe can be altered
133 * to match.
134 *
135 * \note Do not manually change to this state in the user code.
136 */
137 HOST_STATE_Default_PostReset = 9, /**< Internally implemented by the library. This state indicates that
138 * the control pipe is being reconfigured to match the retrieved
139 * control endpoint size from the device, and the device's USB bus
140 * address is being set.
141 *
142 * \note Do not manually change to this state in the user code.
143 */
144 HOST_STATE_Default_PostAddressSet = 10, /**< Internally implemented by the library. This state indicates that
145 * the device's address has now been set, and the stack is has now
146 * completed the device enumeration process. This state causes the
147 * stack to change the current USB device address to that set for
148 * the connected device, before progressing to the user-implemented
149 * \ref HOST_STATE_Addressed state for further communications.
150 *
151 * \note Do not manually change to this state in the user code.
152 */
153 HOST_STATE_Addressed = 11, /**< May be implemented by the user project. This state should
154 * set the device configuration before progressing to the
155 * \ref HOST_STATE_Configured state. Other processing (such as the
156 * retrieval and processing of the device descriptor) should also
157 * be placed in this state.
158 */
159 HOST_STATE_Configured = 12, /**< May be implemented by the user project. This state should implement the
160 * actual work performed on the attached device and changed to the
161 * \ref HOST_STATE_Suspended or \ref HOST_STATE_WaitForDeviceRemoval states as needed.
162 */
163 HOST_STATE_Suspended = 15, /**< May be implemented by the user project. This state should be maintained
164 * while the bus is suspended, and changed to either the \ref HOST_STATE_Configured
165 * (after resuming the bus with the USB_Host_ResumeBus() macro) or the
166 * \ref HOST_STATE_WaitForDeviceRemoval states as needed.
167 */
168 };
169
170 /* Architecture Includes: */
171 #if (ARCH == ARCH_AVR8)
172 #include "AVR8/Host_AVR8.h"
173 #elif (ARCH == ARCH_UC3)
174 #include "UC3/Host_UC3.h"
175 #endif
176
177 /* Disable C linkage for C++ Compilers: */
178 #if defined(__cplusplus)
179 }
180 #endif
181
182 #endif
183
184 /** @} */
185